Installation DHIS2 on AWS EC2 T2.large Not Loading in Browser and Then Server Goes Down

Hello DHIS2 Community,

I installed DHIS2 manually on an AWS EC2 T2 instance. The installation completed successfully, but I’m facing a strange issue.

What I did:

  • Installed DHIS2 manually on Ubuntu (T2.large).
  • Allowed port 8082 in both UFW firewall and AWS security group.
  • Started the DHIS2 server — no errors during installation.
  • PostgreSQL is running, and the Tomcat service starts correctly.

The problem:

  • When I go to http://<public-ip>:8082/dhis, the page does not open in the browser.
  • After some time, the DHIS2 server goes down automatically.
  • I have to restart the server manually each time.
  • This happens again and again — it starts, doesn’t show anything in the browser, then shuts down on its own.

What I checked:

  • Firewall status (attached screenshot) — looks fine.
  • AWS port 8082 is open.
  • Tomcat logs show some warnings/errors (attached screenshot).
  • Enough RAM — EC2 has 8 GB.

Questions:

  1. Why is DHIS2 not loading in the browser?
  2. Why does the server go down by itself after starting?
  3. Why i didnot run on server what runs on local instance??


@garima @sanjaypoudel @Santosh_Paudel

Hi @SanghArsha_PyakuRel

Your logs says that you are using Postgresql 16 but the supported version is 15? I’m wondering if could test downgrading the Postrgresql version and see if the issue persists?

Thanks!

We might need to see more of your log file.

Check the catalina.2025-04-21.log and the localhost.2025-04-21.log or equivalent log files for more info.

The screenshot you have posted does not reveal everything. Especially the logs when it crashes.

I see similar log entries in this user’s post from last year: DHIS2 patch release 41.0.1 is now available - HOTFIX - #4 by lillian1n2
Perhaps see if @lillian1n2 was able to resolve it. At a glance, it seems related to the job scheduler. Is locale / timezone all correctly set up as per install instructions?

I tried changing the PostgreSQL version but didn’t get any response. Then I searched for DHIS2 on AWS and followed the steps from a link I found. DHIS2 installation on Ubuntu 20.04 LTS – AWS – JaeTech Global
The installation was successful according to that guide, but I still don’t get any response in the browser.

I also asked the DHIS2 chatbot by sharing the logs, and it said “Congratulations, you’ve done it successfully without any errors.” However, I still don’t see anything in the browser.

Now, I’m posting the catalania logs here. Please check them.



cc:@Gassim @ejimba @Edward_Robinson

@SanghArsha_PyakuRel sorry that you are experiencing these frustrations.

From the logs you have posted, I see the server came up so you should have something in your browser (even if its just a tomcat error).

I see two posibilities:

  1. the port might not be reachable publicly (might be a policy on AWS)
  2. there might be several instances of dhis2 connected to the same database (the symptom where it goes down after some time)

To check for number 1, i would suggest to test with nginx. Please stop your tomcat service before proceeding with this.

  1. Install nginx
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
  1. Create a server block
    sudo nano /etc/nginx/sites-available/port8082

  2. Add the following configuration in the file

server {
    listen 8082;
    listen [::]:8082;

    root /usr/share/nginx/html;
    
    index index.html index.htm;
    
    location / {
        try_files $uri $uri/ =404;
    }
}
  1. Enable the server block
    sudo ln -s /etc/nginx/sites-available/port8082 /etc/nginx/sites-enabled/
  2. Reload nginx
    sudo systemctl reload nginx
  3. Verify nginx is running
    sudo systemctl status nginx
  4. Open a web browser and navigate to http://your_server_ip:8082. If you still don’t see anything on your browser, there is an issue with public access to that port.

Number 2 might be hard to check for, I would suggest creating a new database and populating it in you dhis.conf file. Might be under /home/dhis/tomcat-dhis or /var/www/mydomain.com/config. I am not sure which folder you are using. Then stop and restart tomcat. Check the logs and when you see the Server startup log entry, check browser

If all fails, I would suggest nuking the instance and starting fresh using the guide here. Make sure to follow the recommendations about versions

All the best!

1 Like

In your post you say port 8082 is open but in your catalina log file it appears port 8080 is being used by Tomcat:
image

Check your /config/server.xml file to make sure you’ve set it up to listen on 8082.

Could you please share your server.xml configuration? Also, are you utilizing a proxy in front of your Tomcat instance?