Download the latest DHIS2 WAR file from the official DHIS2 releases:
curl -L -o dhis.war https://releases.dhis2.org/2.39/dhis.warMove the WAR file to the Tomcat webapps directory:
mv dhis.war $CATALINA_HOME/webapps/Create the DHIS2 home directory:
mkdir -p ~/dhis2_homeCreate the DHIS2 configuration file:
nano ~/dhis2_home/dhis.confAdd the following configuration:
# PostgreSQL Configuration
connection.url = jdbc:postgresql://localhost:5432/dhis2
connection.username = dhis
connection.password = dhis
connection.driver_class = org.postgresql.Driver
connection.dialect = org.hibernate.dialect.PostgreSQLDialect
# Database Connection Pooling
connection.pool.max_size = 80
# Encryption Password (Change to a strong and unique password)
encryption.password = StrongUniquePassword123
# Server Configuration
server.port = 8080
# External Directory for File Storage
system.external_dir = /home/dhis/config
Start the Tomcat server to run DHIS2:
$CATALINA_HOME/bin/startup.shOpen your browser and navigate to:
http://localhost:8080/dhis
Access the DHIS2 login page and use the default credentials: - Username: admin - Password: district
This confirms that DHIS2 is successfully configured and running.