By Grace Amondi, Alibaba Cloud Community Blog author
There are currently two ways of installing DHIS:
This article explains how to install DHIS2 on a Docker container in a few easy steps using Alibaba Cloud's Elastic Compute Service (ECS). For more information about DHIS2 visit the official guide: DHIS 2 User guide
If you already have docker and docker-compose installed then skip step 1 and 2. In this tutorial I will be working with Ubuntu version Xenial 16.04 (LTS). In case you are working with a different version or OS then visit the link below.
Before you install Docker Engine - Community for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
Update the apt package index:
$ sudo apt-get update
Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
Add Docker's official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Use the following command to set up the stable repository.
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
Update the apt package index.
$ sudo apt-get update
Install the latest version of Docker Engine - Community and containerd, or go to the next step to install a specific version:
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
Verify that Docker Engine - Community is installed correctly by running the hello-world image.
$ sudo docker run hello-world
Run this command to download the current stable release of Docker Compose:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
To install a different version of Compose, substitute 1.24.1 with the version of Compose you want to use.
If you have problems installing with curl, see Alternative Install Options tab above.
Apply executable permissions to the binary:
$ sudo chmod +x /usr/local/bin/docker-compose
Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Optionally, install command completion for the bash and zsh shell.
Test the installation.
$ docker-compose --version
Run the following command:
$ git clone https://github.com/pgracio/dhis2-docker.git
then change directory to the project:
$ cd dhis2-docker
execute docker-compose with the default config, Sierra Leone dataset, or use docker-compose-empty-db.yml
if you want to start with a clean state.
$ docker-compose up -d
$ docker-compose -f docker-compose-empty-db.yml up -d
Once the container is up, open url http://:8085 and connect using username admin and password district as explained in the dhis2 documentation
When running on Mac OS X or Windows pointing to localhost will fail. It fails because the Docker Host address is not the localhost but instead the address of docker host VM. Run
$ docker-machine ip default to get Docker Host address.
To access application logs run
docker-compose logs -f.
Alibaba Clouder - March 22, 2019
Alibaba Cloud MVP - February 14, 2020
Alibaba Clouder - March 5, 2019
Alibaba Clouder - August 5, 2019
Alibaba Clouder - December 24, 2018
Alibaba Clouder - April 26, 2019
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
Apsara Stack Agility Elastic Compute Service (Alibaba Cloud ZStack) is a light-weight hybrid cloud solution.Learn More
Self-driving Database Platform: Self-repair, Self-optimization, and Self-securityLearn More
Block-level data storage attached to ECS instances to achieve high performance, low latency, and high reliabilityLearn More
More Posts by Alibaba Clouder