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.
For example:
$ 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
or
$ 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
.
GISPortal Deployment on Alibaba Cloud Ubuntu 16.04 ECS Instance
Alibaba Cloud Announces Industry Leading Availability Commitments
2,599 posts | 764 followers
FollowAlibaba Clouder - March 22, 2019
Alibaba Cloud Community - January 5, 2024
Alibaba Clouder - August 5, 2019
Alibaba Clouder - March 5, 2019
Alibaba Clouder - December 24, 2018
Alibaba Cloud Community - March 23, 2022
2,599 posts | 764 followers
FollowElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreSelf-driving Database Platform: Self-repair, Self-optimization, and Self-security
Learn MoreA convenient and secure cloud-based Desktop-as-a-Service (DaaS) solution
Learn MoreMigrating to fully managed cloud databases brings a host of benefits including scalability, reliability, and cost efficiency.
Learn MoreMore Posts by Alibaba Clouder