Getting Started Quickly with Bahmni on Docker

Installing Docker and Docker Compose

You can install Docker from here. Choose the appropriate installers for your host machine and follow the instructions mentioned for the host platform.  MacOS: You can get the dmg file for Docker here

Once you have Docker installed, ensure that you are running the daemon. You can verify that by running docker ps.

If you want to tune and configure docker, please find detailed information here.

 

While it is not mandatory that you have working knowledge of docker (although desirable), at the least you should know the following commands and usages

  1. docker ps -a   - shows all containers

  2. docker rm <container id> - remove a given container 

  3. docker container COMMAND - different commands like start/stop/prune for container(s)

  4. docker images - lists all images

  5. docker rmi <image id> - remove a given image 

  6. docker volume COMMAND - different commands for managing volumes. 

A good link: The Ultimate Docker cheatsheet

With latest versions of docker-engine, compose-plugin has been introduced which installs docker compose. So first check if you have docker compose by running docker compose version. For Ubuntu machines, this is great documentation on installing docker & docker-compose: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-22-04

You can install docker compose from here.

Currently Bahmni has been tested on docker compose version 2.12.0. If you are using older versions of docker-compose, please upgrade to the latest version. You can check docker compose version by running docker compose version

 

System Memory Requirements

If you are using Docker Desktop for Mac / Docker Desktop for Windows , it is recommended to increase the Memory resource to at-least 8GB. Please find the reference for Mac / Windows.

For Linux based distributions, docker consumes the memory available at the Docker host.

Bahmni Docker training for the community has been conducted on 15-Feb-2023 (2 days). All the training content is now publicly available in Bahmni Community YouTube channel. Please check this playlist on YouTube: https://www.youtube.com/watch?v=f7ikNL2j3Mg&list=PLzknGpbejfSzEB2dT87mexJaBUsXNuZkD&index=1

Prerequisites:

  • Install stable version of Git

  • Install latest stable versions of docker & docker compose in your machine (based on your respective OS).

  • Clone the bahmni-docker repository (Github Link).

 

Running Bahmni Lite v1.0.0

Bahmni-lite is a lightweight open-source version of Bahmni targeted towards clinics & small hospitals, which don’t need a heavy-weight HIMS, but are looking for an easy-to-use EMR & Billing software. Read more about Bahmni-lite v1.0.0 here. This version runs with Bahmni EMR UI, OpenMRS and Crater.

# Clone the Bahmni docker repo using SSH keys git clone git@github.com:Bahmni/bahmni-docker.git # If the above command gives error, use the HTTPs version of the command as follows: git clone https://github.com/Bahmni/bahmni-docker.git cd bahmni-docker/bahmni-lite # Edit the .env file, and make the following changes # 1. Change `COMPOSE_PROFILES=bahmni-lite` (or run with default which is `emr`) # 2. Change `TZ` to your desired timezone (or run with the default which is `UTC`). # 3. For remote server (if not running on localhost) for crater: # write the IP address or domain name in the following properties (instead of localhost): # CRATER_APP_URL, CRATER_SANCTUM_STATEFUL_DOMAINS and CRATER_SESSION_DOMAIN # Pull latest images docker compose pull # Now start docker (detached mode) docker compose up -d


Bahmni LITE should now be accessible (open browser at URL: https://localhost/). Bahmni docker is packaged with a self-signed certificate. Hence the browser may show a warning/error. This is a standard warning that browsers show when a certificate is signed by a root authority that is not already in the browsers trust store. You can bypass it for now (Add an Exception) and continue. See how you can achieve this with Chrome by typing thisisunsafe (This is unsafe - no spaces) with your keyboard (Read more here).

Running Bahmni Standard

Bahmni Standard is the full version of Bahmni for hospitals which includes EMR (Bahmni UI + OpenMRS), OpenELIS, Odoo and PACS. Read more about differences between Bahmni Lite and Bahmni Standard here.

git clone git@github.com:Bahmni/bahmni-docker.git cd bahmni-docker/bahmni-standard # Change `COMPOSE_PROFILES=bahmni-standard` in the .env file (or run with default which is just `emr`) # Pull latest images docker compose pull # Now start docker (detached mode) docker compose up -d # File Permissions Issue with Odoo In some hosts Odoo 16 might fail to start throwing a permission denied error when using DB backup image. Run this command the first time. docker compose exec -it --user root odoo chown -R odoo:odoo /var/lib/odoo/filestore && docker compose restart odoo

Bahmni should now be accessible (open browser at URL: https://localhost/)

  • Bahmni and OpenMRS (username: superman password: Admin123 )

  • OpenELIS (username: admin password: adminADMIN! )

  • Odoo ERP (username: admin password: admin )

  • DCM4Chee PACS (username: admin password: admin )

First-time setup steps

Running Bahmni with the LATEST images

The .env.dev file contains references to the `latest` images (ones which are under development and hence could be a bit unstable). To run Bahmni Lite with the latest docker images, specify the file path as .env.dev when executing the docker compose commands (or rename the .env.dev to .env). It is a good idea to perform a `docker pull` before starting. This will check if any image on your machine is out-of-date, and bring the latest version from Docker hub.

cd bahmni-docker/bahmni-lite (or) cd bahmni-docker/bahmni-standard # Pull latest images docker compose --env-file .env.dev pull # Now start docker (run in detached mode) docker compose --env-file .env.dev up -d # You can also write this in one command as: docker compose --env-file .env.dev pull && docker-compose --env-file .env.dev up -d

Running Bahmni EMR (minimal setup)

By default, the Bahmni docker compose has been configured to start the Bahmni EMR components (profile=`emr`) which is a minimal specification to try and explore Bahmni. This is configured in both: bahmni-standard and bahmni-lite.

Running a specific application

Apart from bahmni-standard and bahmni-lite profiles, there are individual application profiles which allows to run single applications like OpenELIS, Odoo, PACS, Crater, Metabase Analytics, etc. Read more about different profiles in Docker Compose Profiles sub-page.

 

Running Bahmni Analytics with Metabase & Bahmni-Mart

Bahmni now ships with Opensource metabase BI tool (Analytics), that can be used to connect to any SQL database and create reports and visualizations. By default, metabase is configured to connect with OpenMRS DB and MART DB. Mart basically is an analytics service that pulls data from OpenMRS and stores it in a postgres DB (called martDB) in a format that is easier to create reports in. Read more about Bahmni MART here: .

Metabase is accessible at: https://localhost/metabase (for credentials check the settings stored in METABASE_ADMIN_EMAIL and METABASE_ADMIN_PASSWORD in .env file).

 

The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)