Chapter 8. Installation

Table of Contents

8.1. Introduction
8.2. Server specifications
8.3. Server setup
8.3.1. Creating a user to run DHIS2
8.3.2. Creating the configuration directory
8.3.3. Setting server time zone and locale
8.3.4. PostgreSQL installation
8.3.5. PostgreSQL performance tuning
8.3.6. Database configuration
8.3.7. Java installation
8.3.8. Tomcat and DHIS2 installation
8.3.9. Running DHIS2
8.4. File store configuration
8.5. Google service account configuration
8.6. LDAP configuration
8.7. Encryption configuration
8.7.1. Java Cryptography Extension
8.7.2. Password configuration
8.7.3. Considerations for encryption
8.8. Read replica database configuration
8.9. Web server cluster configuration
8.9.1. Cluster configuration
8.9.2. Load balancing
8.10. Application cache providers
8.10.1. Memcached
8.11. Starting Tomcat at boot time
8.12. Reverse proxy configuration
8.12.1. Basic nginx setup
8.12.2. Enabling SSL on nginx
8.12.3. Enabling caching and SSL on nginx
8.12.4. Additional resources on SSL
8.12.5. Making resources available with nginx
8.12.6. Basic reverse proxy setup with Apache
8.12.7. SSL encryption with Apache
8.13. DHIS2 configuration reference
8.14. Application logging
8.15. Working with the PostgreSQL database
8.16. DHIS2 Live setup

The installation chapter provides information on how to install DHIS2 in various contexts, including online central server, offline local network, standalone application and self-contained package called DHIS2 Live.

8.1. Introduction

DHIS2 runs on all platforms for which there exists a Java Runtime Environment version 8 or higher, which includes most popular operating systems such as Windows, Linux and Mac. DHIS2 also runs on many relational database systems such as PostgreSQL, MySQL, H2 and Derby. DHIS2 is packaged as a standard Java Web Archive (WAR-file) and thus runs on any Servlet containers such as Tomcat and Jetty.

The DHIS2 team recommends Ubuntu 16.04 LTS operating system, PostgreSQL database system and Tomcat Servlet container as the preferred environment for server installations.

This chapter provides a guide for setting up the above technology stack. It should however be read as a guide for getting up and running and not as an exhaustive documentation for the mentioned environment. We refer to the official Ubuntu, PostgreSQL and Tomcat documentation for in-depth reading.

The dhis2-tools Ubuntu package automates many of the tasks described in the guide below and is recommended for most users, especially those who are not familiar with the command line or administration of servers. It is described in detail in a separate chapter in this guide.