Version: Next

Prerequisites

To easily get started with implementing the OpenHIM Core and Console and to start playing with the various features we can follow the below steps to get a local OpenHIM environment setup.

Don't have time to setup? Try our sandbox environments! See the links in the footer.

The below method of spinning up the OpenHIM makes use of Docker containers that allows for easier deployments of the OpenHIM.

We will need to install some software that will allow us to spin up the OpenHIM with ease. We will be using Docker which is a container management service to create our OpenHIM instance.

Install Docker#

Docker is the engine that will be running our entire local OpenHIM instance by using the publicly available OpenHIM core and console images. To install Docker please follow the relevant steps based on the operating system you are using as described in the below link

To install Docker please follow the relevant steps as described within the install documentation

Install Docker Compose#

Now that we have Docker installed on our machine, we will also need to install Docker Compose which is an additional service that makes use of our below docker-compose.yml file and builds the relevant containers for us to have our OpenHIM instance up and running. The OpenHIM can be setup and configured without these steps however manually creating the relevant Docker containers requires more advanced knowledge of Docker.

To install Docker Compose please follow the relevant steps as described within the install documentation.

Docker Compose file#

Before we can use Docker to build our OpenHIM instance, we need to create a docker-compose.yml that will contain our instructions for pulling the correct OpenHIM Core and Console images from Jembi's Dockerhub profile

The docker-compose.yml can be downloaded from the OpenHIM core repository, or you can copy/paste the below yaml code into a file named docker-compose.yml

version: '3'
networks:
openhim:
services:
mongo-db:
container_name: mongo-db
image: mongo:4.0
networks:
- openhim
volumes:
- "mongo-data:/data/db"
restart: unless-stopped
openhim-core:
container_name: openhim-core
image: jembi/openhim-core:latest
restart: unless-stopped
environment:
mongo_url: "mongodb://mongo-db/openhim-development"
mongo_atnaUrl: "mongodb://mongo-db/openhim-development"
NODE_ENV: "development"
api_authenticationTypes: ["token", "basic", "openid", "local"]
# Edit the following to enable SSO authentication (openid)
# api_openid_url: ${KC_FRONTEND_URL}/realms/${KC_REALM_NAME}
# api_openid_callbackUrl: ${KC_OPENHIM_ROOT_URL}
# api_openid_clientId: ${KC_OPENHIM_CLIENT_ID}
# api_openid_clientSecret: ${KC_OPENHIM_CLIENT_SECRET}
ports:
- "8080:8080"
- "5000:5000"
- "5001:5001"
networks:
- openhim
healthcheck:
test: "curl -sSk https://openhim-core:8080/heartbeat || exit 1"
interval: 30s
timeout: 30s
retries: 3
openhim-console:
container_name: openhim-console
image: jembi/openhim-console:latest
restart: unless-stopped
networks:
- openhim
ports:
- "9000:80"
healthcheck:
test: "curl -sS http://openhim-console || exit 1"
interval: 30s
timeout: 30s
retries: 3
volumes:
mongo-data: