Getting Started Quickly with Bahmni on Docker
Installing Docker and Docker Compose
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: [DAY 1] 1.1 Introduction to Bahmni & Introduction to Docker and Docker Compose
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).
There are two different distributions of Bahmni: LITE and STANDARD. More details about the differences are here.
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
run-bahmni.sh: You can also use the ./run-bahmni.sh
helper script in bahmni-docker/bahmni-lite
that relies on the .env
file, which points to the 1.0.0
tag to run Bahmni Lite. It execute the docker compose commands for you. This script provides various options such as start, stop, view logs, pull updates, reset, etc. Use the command chmod +x run-bahmni.sh
to give it execute permission. Set the appropriate COMPOSE_PROFILE in .env
file before running this script.
Bahmni LITE docker-compose is configured with a pre-loaded CIEL database, for faster startup. This database is tagged: clinic-config-mysql5.6
, and already configured in the .env file. Since CIEL dictionary concepts (50k medical terms) are a large number of terms, this pre-loaded DB reduces startup time from multiple hours to now just 5 mins. This should be good for you to demo/evaluate Bahmni before making custom changes to it. If you wish to instead start bahmni-lite with a fresh db and trigger a load of CIEL concepts via the initialiser module, then follow the steps here. In case, you need to start bahmni-lite in docker with a live database backup from cloud, then follow the steps here.
When changing the TZ value, you need to specify the timezone in the TZ database format. For example, if you want to set the timezone for India, you would set TZ to "Asia/Kolkata", and for Kenya it would be "Africa/Nairobi". You can find a list of valid timezone values in the TZ database under the TZ identifier column. To read further about Docker Timezone Configuration refer here.
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.
Note: With Bahmni releases on Docker, Odoo 16 will be the default version of Odoo shipped out of the box. You can still run Odoo 10 variant by following the steps 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
run-bahmni.sh: You can also use the ./run-bahmni.sh
helper script in bahmni-docker/bahmni-standard
to run Bahmni Standard. It execute the docker compose commands for you. This script provides various options such as start, stop, view logs, pull updates, reset, etc. Use the command chmod +x run-bahmni.sh
to give it execute permission. Set the appropriate COMPOSE_PROFILE
in the .env
file before running this script.
Bahmni STANDARD will boot up in 5-10 mins.
Bahmni should now be accessible (open browser at URL: https://localhost/)
First-time setup steps
NOTE: There are a few simple one time setup steps to be followed for Odoo docker configuration and PACS Docker Configuration. See the documentation. If you run into issues, take a look here (or) feel free to ask questions on Bahmni Slack #community channel.
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
run-bahmni.sh: You can also use the ./run-bahmni.sh
helper script.
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
.
git clone git@github.com:Bahmni/bahmni-docker.git
# to run bahmni-lite (for clinics/small hospitals)
cd bahmni-docker/bahmni-lite
docker compose up -d
# to go to standard bahmni (full hospital system with EMR, Lab, Odoo, Dcm4chee)
cd bahmni-docker/bahmni-standard
docker compose up -d
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: Bahmni Mart .
# From bahmni-lite/ or bahmni-standard/ subfolder,
# execute this command to bring up metabase, mart service and mart DB
docker compose --profile bahmni-mart up -d
Metabase is accessible at: https://localhost/metabase (for credentials check the settings stored in METABASE_ADMIN_EMAIL
and METABASE_ADMIN_PASSWORD
in .env
file).
Running Bahmni On Docker
Related content
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)