Skip to content
DHIS2.org Community GitHub

Local installation of a DHIS2 instance with the DHIS2 Modeling app

If you want to test chap-core with the Modeling app, follow these steps to set up a local installation of DHIS2.

We have an internal database that can be used to set up a DHIS2 instance with testdata. If you are an internal developer, you will have access to this through our internal drive. Follow these steps (if you don't have access to this database, and want to set up a general instance, see steps below):

  • Download the zip-file, unzip it and run docker compose up in the unzipped directory.
  • Note: If you are on linux, you will have to edit the docker-compose.yaml file and change platform to linux/amd64.
  • Note: You may have to restart the web docker container if this started before the db container was up.
  • Run analytics by opening Data administration, go to analytics tables, uncheck all boxes and click "Start export"

To set up a DHIS2 instance without this test db, do the following:

  • Follow these instructions to install the DHIS2 cli tools
  • Spin up a DHIS2 instance by running d2 cluster up 2.41 --db-version 2.41 (More details here). Change the version number with whatever version you want.

After following any of the guides above, you should have a DHIS2 instance running at localhost:8080.

  • Go to that url in your webbrowser and log in.
  • First install the App Management app, then install the app called Modeling through the App Hub.
  • In the Modeling app, you will be told to put in an url to Chap. Since DHIS2 runs through a Docker container, it cannot reach Chap via localhost, so you need a URL that points from inside the container back to Chap running on your host machine:
  • On Mac and Windows, use http://host.docker.internal:8000/** -- Docker Desktop resolves this hostname to your host automatically.
  • On Linux, host.docker.internal is not available by default, so you need the IP of your local computer. Find it by running ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' in your terminal (you may have to install ifconfig). Put http:// before that IP and :8000/** after, e.g. http://172.18.0.1:8000/**.

Running an evaluation

Once DHIS2 and the Modeling app are up, you can run an evaluation. This requires that:

  • chap-core is up and running (see Installation).
  • The Modeling app is configured with the correct URL for chap-core (the previous step).

Then, in the Modeling app:

  • Go to Evaluate, then Overview, and click New evaluation.
  • Select weekly as the period type.
  • Set the from period to some week in 2022 and the to period to some week in 2024.
  • Select a source for precipitation and one for air temperature, and select the model you want to run.
  • Click Start dry run. This validates the configuration and data without running the full evaluation.
  • If the dry run completes without errors, click Start import to trigger the evaluation.

On the Overview page you should see the evaluation running. Once it has finished, click on it to see the details.