Installing two DHIS2 instances on single windows server

Hi colleagues,

I am requesting for assistance on how to go about installing two instances of dhis2 on a windows server. I have seen a few instructions on how to go about it on this platform but nothing seems to be working for me.

I have tried setting the dhis2 home paths setenv.bat in two separate tomcat instances - the path being picked for the second instance is the one meant for the first one.

How best can i go about this?


Have you set any CATALINA_HOME variable somewhere? may be it points to your first tomcat?

1 Like

Hi Cynthia,

Mwuli banji ?

You have to create seperate tomcat instances each with it’s own setenv.bat. Then you can edit them to point individually to the tomcats that you want. Also, make sure the tomcat ports are not the same e.g tomcat should run on 8080 and tomcat2 on 8081. Bear in ind these are just examples, and you may want to tweak them based on your intended deployment model.

Hope this helps.

Best of luck,
Potlaki - HISP South Africa

1 Like

Bwino, Muli Bwanji?

No I did not. I initially had only one instance running, a need arose to have two instances running. So I setup a seperate tomcat instance with a different port. The first initial instance is set with ENV VAR: DHIS2_HOME with separate path for dhis.conf folder, I also setup a setenv.bat in the tomcat bin folder. For the second instance, I setup a different ENV VAR: DHIS2_TEST with it’s own dhis.conf folder path and setenv.bat file in the tomcat bin folder. When running catalina for the second instance, it doesn’t pick up the setenv.bat env var named DHIS2_TEST, instead it picks up the initial DHIS2_HOME env var.

What setting should i change to ensure tomcat picks up the second env var for the second instance that is setup in setenv.bat?

1 Like


you cannot, the Env name is hardcoded in the code.

But it is read only at boot, so you can use the same, in addition if you have 2 “users” one per instance you could define the DHIS_HOME as user ENV

in version 3.8, you will be able to use tomcat context so you could run 2 DHIS2 instances on the same TOMCAT instance.


1 Like