Docker: DHIS2_home is not writeable

Hello to all,
I have a problem deploying dhis2 version 2.38 and 2.39 with Docker compose.
I have already done several deployments of Docker container with DHIS2 2.33 and 2.36 without difficulty. However with the last 2 versions of DHIS2 (2.38 and 2.39), I have an error “Directory /DHIS2_home is not writeable”. I tested several solution proposal but the problem (here is the screenshot).

However with the same configuration of the docker-compose.yml file I deployed the 2.36 images.


If someone can help me to make the directory /DHIS2_home of the container accessible in writing or any other track of solution to be exploited I’m interested.


Hello Cyrille,

In recent versions of DHIS2 the default home directory have changed to /opt/dhis2. If you update the environment variable DHIS2_HOME and your volume accordingly, it should work.

Best regards,

1 Like

Hi Cyrille :smile:

were you able to solve your problem?

I wanted to add some context to what Andreas said for you or others. If you fixed your problem and are not interested in the details you can skip what follows :yum:

DHIS2 lets you configure the home directory for example via environment variable DHIS2_HOME or system property dhis2.home passed to the process running DHIS2 (like Tomcat). If you do not pass any explicit configuration it will default to /opt/dhis2.

The DHIS2 Docker image did set the environment variable DHIS2_HOME to /DHIS2_home in the past. This is why you had to mount your volume, dhis.conf, … into /DHIS2_home. We made some improvements to the Docker images (smaller, caching, multi-arch with arm64 support, …). We did not see any reason to choose /DHIS2_home. We wanted to align the Docker image with DHIS2. This is why newer images will simply default to /opt/dhis2 as does DHIS2 itself. See docs

1 Like

Thank you all for your answers and solutions.
In addition to changing the environment variable directory to /opt/dhis2, I also linked the dhis.conf file directly to the /opt/dhis2 directory of the container.

Everything is working normally now

1 Like