Step by Step Guide: From an Empty Laptop to DHIS2 Running in Your Browser
Every other topic needs a DHIS2 to work in. Follow the steps below in order, and at the end you will have your own DHIS2 running on your laptop, ready for Topic 3.
Install these two programs first. Accept the default options, and restart your computer if the installer asks you to.
Why Docker? DHIS2 needs Java, a web server and a PostgreSQL database to run. Docker runs all of these for you inside ready made containers, so you do not install or configure any of them yourself, and everyone in the hackathon gets exactly the same working setup.
Why Git? The setup files are kept on GitHub. Git copies them onto your laptop with one command, so everyone starts from the same files. On Windows, Git also gives you Git Bash, the window where you type the commands.
| Program | Download it here |
|---|---|
| Docker Desktop (Windows and Mac) | https://www.docker.com/products/docker-desktop/ |
| Git Bash (Windows) | https://git-scm.com/download/win |
| Git (Mac) | https://git-scm.com/download/mac |
Open Docker Desktop and wait until it says Running. Leave it open while you do every step below. If Docker Desktop is not running, none of the commands will work.
Type each command in the steps below into this window, then press Enter.
Copy the setup folder onto your laptop.
git clone https://github.com/mohamedsillahkanu/dhis2-local-set-up.git
Move into the folder you just downloaded. Run every command after this from inside it.
cd dhis2-local-set-up
This downloads about 1 GB, so it takes five to fifteen minutes depending on your internet. You only do it once on this laptop.
docker compose pull
Start DHIS2 and its database, then check that both are running.
docker compose up -d
docker compose ps
You can also see them in Docker Desktop. Open Containers, and both should show a green dot.
The first start takes three to ten minutes. Watch it with this command, and wait for the line Server startup. Then press Ctrl + C to stop watching. DHIS2 keeps running.
docker compose logs -f dhis2
Open this address in your browser, and sign in with username admin and password district.
http://localhost:8010
You now have your own empty DHIS2. Change the admin password before anyone else uses it, then go on to Topic 3 to build the organisation units.