JBRSOFT-Logo
JBRSOFT-Logo
  • Products
    • ISPERP
      ISPERP

      Complete solution for Internet Service Providers

      Dispensary
      Dispensary

      Modern powerful pharmacy management system with foster sales

      iPCAMS
      iPCAMS

      Automate IPC & AMS assessment

      AMR STG Logo
      AMR mHealth App

      Mobile and web solution for AMR

      WHONET
      WHONET

      AMR One Health Surveillance Tool

      DHIS2
      DHIS2 Apps

      Automate your healthcare

  • Services
  • Projects
  • Research
  • Support
  • Explore
    • About Us
    • Clients
    • Latest News
    • Success stories
    • Blog
    • Documentations
    • Partners
    • Career
    • Academy
My Account
logo logo
  • Products
    • ISPERP
      ISPERP

      Complete solution for Internet Service Providers

      Dispensary
      Dispensary

      Modern powerful pharmacy management system with foster sales

      iPCAMS
      iPCAMS

      Automate IPC & AMS assessment

      AMR STG Logo
      AMR mHealth App

      Mobile and web solution for AMR

      WHONET
      WHONET

      AMR One Health Surveillance Tool

      DHIS2
      DHIS2 Apps

      Automate your healthcare

  • Services
  • Projects
  • Research
  • Support
  • Explore
    • About Us
    • Clients
    • Latest news
    • Success stories
    • Blog
    • Documentations
    • Partners
    • Career
    • Academy
  • My Account

DHIS2 installation on Ubuntu 20.04 LTS – AWS

  • JBRSOFT
  • 08 March 2023

DHIS2 installation on Ubuntu 20.04 LTS – AWS

Ubuntu 20.04 LTS within an AWS environment ensures scalability, security, and accessibility for global health initiatives.

Why Install DHIS2 on Ubuntu 20.04 LTS in AWS?

  • Cloud Scalability: AWS provides flexible infrastructure that allows DHIS2 to scale based on user demands.
  • Security & Reliability: Hosting on AWS ensures high availability, data security, and backup options.
  • Cost-Effective: Running DHIS2 on an Ubuntu server in AWS can be optimized for cost-efficient deployments.
  • Performance Optimization: Ubuntu 20.04 LTS is a stable, secure, and performance-oriented operating system suitable for DHIS2.
  • Remote Accessibility: AWS hosting allows users and organizations to access DHIS2 from anywhere in the world.

Technical Overview

DHIS2 is compatible with all major operating systems that support Java JDK, including Windows, Linux, and macOS. It utilizes the PostgreSQL database engine, which offers robust data storage, high performance, and GIS capabilities. DHIS2 is deployed as a Java Web Archive (WAR) file and can be run on Servlet containers such as Apache Tomcat and Jetty, making it highly flexible for various environments.

In this guide, we will walk through the step-by-step process of installing DHIS2 on Ubuntu 20.04 LTS within AWS, configuring the necessary dependencies, and optimizing it for production use.

Server Specification: 2 GB RAM, 1 vCPU

Target: DHIS 2.37

Tomcat: 9, PostgreSQL: 12, Java: OpenJDK 11


Step 1: Basic Configuration

1.1 Set server time zone:

sudo dpkg-reconfigure tzdata

Create a new directory:

sudo mkdir /var/www/mydomain.com

If you encounter a "cannot create directory" error, run:

cd /var
sudo mkdir www
cd ~
sudo mkdir /var/www/mydomain.com

Create a new user dhis_tl:

sudo useradd dhis_tl -s /bin/false

Set a strong password:

sudo passwd dhis_tl


Step 2: PostgreSQL Installation

Install PostgreSQL:

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo systemctl start postgresql.service

Install PostGIS:

sudo apt-get install postgis

Create a PostgreSQL user:

sudo -u postgres createuser -SDRP dhis_tl


Step 3: Database Configuration

Create and edit the DHIS2 configuration file:

sudo -u dhis_tl nano /var/www/mydomain.com/config/dhis.conf

Sample dhis.conf file:

# Hibernate SQL dialect
connection.dialect = org.hibernate.dialect.PostgreSQLDialect

# JDBC driver class
connection.driver_class = org.postgresql.Driver

# Database connection URL
connection.url = jdbc:postgresql:dhis2

# Database username
connection.username = dhis_tl

# Database password
connection.password = 123456

# Encryption password (set a strong password)
encryption.password = xxxx


Step 4: Java Installation

Install OpenJDK:

sudo apt-get install openjdk-11-jdk

Check installation directory:

ls /usr/lib/jvm


Step 5: Tomcat and DHIS2 Installation

Install Tomcat 9:

sudo apt-get install tomcat9-user

Create Tomcat instance:

cd /var/www/mydomain.com/
sudo tomcat9-instance-create tomcat-dhis

Edit setenv.sh:

sudo nano /var/www/mydomain.com/tomcat-dhis/bin/setenv.sh

Replace contents with:

#!/bin/sh
CATALINA_HOME=/usr/share/tomcat9
. /usr/libexec/tomcat9/tomcat-locate-java.sh
export JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64/'
export JAVA_OPTS='-Xmx2000m -Xms1000m'
export DHIS2_HOME='/var/www/mydomain.com/config'


Step 6: DHIS2 Download

Download and move the WAR file:

cd ~
sudo wget https://s3-eu-west-1.amazonaws.com/releases.dhis2.org/2.37/dhis.war
sudo mv dhis.war /var/www/mydomain.com/tomcat-dhis/webapps/ROOT.war


Step 7: Running DHIS2

Start DHIS2:

sudo -u dhis_tl /var/www/mydomain.com/tomcat-dhis/bin/startup.sh

Monitor logs:

sudo tail -f /var/www/mydomain.com/tomcat-dhis/logs/catalina.out

Access DHIS2 at:

https://mydomain.com_or_IP:8080/

Username: adminPassword: district

DHIS2 installation, Ubuntu 20.04 LTS, AWS cloud deployment, DHIS2 on AWS, PostgreSQL DHIS2, Tomcat DHIS2 setup, DHIS2 health data software, open-source health platform, DHIS2 performance optimization, DHIS2 best practices, DHIS2 Ubuntu setup, cloud-based DHIS2 installation.

Last updated: 2023-03-08

Recent Posts

তথ্য, প্রযুক্তি ও আইএসপি (ISP) ব্যবসা, পর্ব-১
তথ্য, প্রযুক্তি ও আইএসপি (ISP) ব্যবসা, পর্ব-১
10 Sep 2017
  • ‹
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • ›
home
  • BD Office: House # 19, Road # 20, Nikunja-2, Dhaka-1229
  • South Korea: 3, Gunja-ro 11 –gil, Gwangjin-gu, Seoul, Korea
  • General Query: connect@jbrsoft.com
  • Quotation: management@jbrsoft.com

Company

  • Home
  • About Us
  • Services
  • Clients
  • Career

Resources

  • Latest News
  • Blog
  • Support Center
  • Privacy Policy
  • Organization Structure

Products

  • ISPERP
  • Dispensary
  • iPCAMS
  • SurveyAMR
  • DHIS2 Apps
2016 - 2025 © All Rights Reserved By JBRSOFT Limited.
  • Follow Us: