A script to set up a local Docker instance of DHIS2 seeded with the demo database and with analytics tables populated for the DHIS2 dashboard.
Quick summary:
- What it does: Installs Docker if needed, pulls DHIS2 2.43, spins up a local instance seeded with the Sierra Leone demo database, and (optionally) populates the analytics tables so the dashboard has real data to show.
- What it doesn’t do: It’s not a production deployment tool, doesn’t work with other DHIS2 versions or demo databases out of the box, and doesn’t touch any live or shared environments.
- Who it’s for: Anyone implementing, evaluating, or demoing DHIS2 who needs a disposable local instance. Consultants, implementers, trainers, etc.
- Runs on: Ubuntu (tested on Ubuntu with apt and Docker). Not built for macOS or Windows as-is.
- Available at: https://github.com/KatherineWyers/dhis2-docker-local-setup
Before you can test a DHIS2 configuration or walk someone through a dashboard, you’ve got to spin up an instance first. Install Docker if it’s not there already, pull the DHIS2 image, seed the database, and then, if you want the dashboard to display, you need to populate the analytics tables. This isn’t a DHIS2 problem. Any system with this much going on has the same setup headaches. But it’s still a lot of steps for something you can end up doing multiple times over a project, and it can eat a whole afternoon that you didn’t have.
This script handles all of this in one pass, on an Ubuntu machine. It checks for and installs Docker if it’s needed. It pulls DHIS2 version 2.43, spins up a local instance seeded with the Sierra Leone demo database, and gives you the choice of running full analytics, just the last two years, or skipping analytics altogether if you’d rather trigger it manually later. Either way, it’s meant strictly for local development, not something you’d point at production.
I built this because I wanted to quickly be able to test a change before it touches a live environment, or to quickly show a client what their org unit hierarchy or data model would actually look like without needing access to their infrastructure. Having the analytics tables populates and ready to use makes a big difference, because a dashboard is much easier to discuss when there’s real data there to demo. That all saves a lot of hassle when demoing and running training sessions.
It’s not a big script, but it’s pretty much my approach to working. If I see the same problem come up a few times, I usually just build a script to automate it because it’s a good way of explaining the system. Some goes for the bigger projects too. Civil registration linking to health data, whether it’s a DHIS2 or OpenEMIS system, whatever is needed.
The script is open source and available here: https://github.com/KatherineWyers/dhis2-docker-local-setup. If you’re mid-implementation and hitting the same setup friction, or you just want to see what the system would look like before you commit to it, just reach out and we can figure out what it’d take to adapt the script to your context.