Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

DHIS2 (District Health Information Software 2) is an open-source platform used for health information systems. In this guide,

we'll walk you through installing DHIS2 version v40.3.0 on a server running Ubuntu 22.04.

...

✅ Prerequisites

  • A server

Prerequisites

...

  • running Ubuntu 22.04

  • SSH

...

  • access to the server with a non-root

...

  • user

...

  • that has sudo

...

  • privileges

Step1: Create a dhis2 system user

...

  • At least 8 GB RAM and 2 CPUs (recommended for production)


Step 1: Create a Dedicated DHIS2 User

We'll begin by creating a system user for running DHIS2:

sudo useradd -d /home/dhis

...

-m

...

dhis

...

-s

...

/bin/false

...

Set the password for the created user

sudo

...

passwd

...

dhis 

🔐 Use a strong password with at least 15 random characters.

...

Step 2: Set Up DHIS2 Configuration Directory

Create a directory for

...

DHIS2 configuration, logs, and app files:

sudo -u dhis mkdir /home/dhis/config

Set your system timezone (recommended for logging and DB timestamps):

sudo

...

dpkg-reconfigure

...

tzdata 

...

Choose:

Asia/Kolkata

PostgreSQL installation

...

Step 3:

...

Install PostgreSQL

...

16 with Required Extensions



  • Add PostgreSQL repository
    sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
    
  • Import the PostgreSQL repository signing key:
    curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
    
  • Update the package lists
    sudo apt update -y && sudo apt upgrade -y 
    
  • Install PostgreSQL 16

    sudo apt-get install -y postgresql-16 postgresql-16-postgis-3
    
  • Ensure postgresql is started and enabled

    sudo systemctl start postgresql
    sudo systemctl enable postgresql
    
  • Create a non-privileged database user dhis with the command below:

    sudo -u postgres createuser -SDRP dhis
    
    Enter a secure password at the prompt:

...

  • Check the logs live:

    tail -f /home/dhis/tomcat-dhis/logs/catalina.out
    
  • To stop the DHIS2 instance:

    sudo -u dhis /home/dhis/tomcat-dhis/bin/shutdown.sh
    
  • If the WAR file deployed in webapps is named ROOT.war, you can now access your DHIS2 instance at the following URL:

    🌐 Accessing DHIS2

    Once Tomcat starts, access your instance at:

    http://localhost<your-server-ip>:8080

Default Login Credentials

  • Username: admin

  • Password: district