Requirements for Dockerizing Bahmni on the latest CentOS images


We’re a team at the University of Southampton trying to implement Bahmni for a team of clinicians in Ethiopia. Because we’ve got a development team, CI, staging, and acceptance servers, and the end result will have to be deployed to a handful of production machines, we’re looking to build light-weight automated deployments.

We’re using Bahmni, but at the moment only need the EMR functionality so we’ve been trying to Dockerize just that part of the entire Bahmni platform. However, that has not been successful so far. as documentation and examples:

  • are out of date, using older CentOS versions or Bahmni releases
  • use insecure package installation sources (HTTP instead of HTTPS)
  • run partly (the Mekom Solutions Docker images, see screen shot)

I am looking for advice on where to find the latest requirements for Docker deployments, or recent examples. Once we find a configuration that works, we believe can tailor it or slim it down to what our clinicians need.

Thank you for your time,


PS: @mksrom I was asked to tag you in this post :slight_smile:

1 Like

Hi @bart, welcome to the OpenMRS community!

It is unfortunate that the Docker image you’ve tried does not work out of the box. It should.

Which tag did you pull? and which command did you use?

As you have already found out, Bahmni does not really support Docker. The images we are using are only a workaround of what should really be done. They are just a base CentOS 6.9 (or 7 for the latest ones) on which we have run the Bahmni installer. They are already making the deployment of Bahmni much easier though but we definitely start to see the limitations.

Definitely not how Docker should be used anyway plus it brings quite a number of deployment and performance issues.

The right way is to have a Docker Compose project (or other similar tool) that would start individual services, each of them isolated in its container.

For Bahmni EMR only, those service would be:

  • Reverse proxy used as an entry point to the application
  • MySQL database to host the OpenMRS database
  • Tomcat 7 to serve the OpenMRS Java app
  • An HTTP server to serve Bahmni Apps
  • An HTTP server to serve Bahmni Config
  • Tomcat 7 to serve Bahmni Reports Java app
  • maybe others?

We have started work in this direction already and we can almost start an EMR only Docker Compose project - still having issues with loading the databases. Adding Odoo brings its lot of problems but we are making progress as well. All is still WIP.

You can have a look at the Docker Compose file:

I would suggest that you rather go in this direction as it makes things cleaner and plugs nicely on a Docker Swarm or Kubernetes orchestrator.

We can also discuss that over a call.

Useful resources:

The JIRA epic we have used is:

Project is hosted here: (on branch BAH-781)

To deploy all that, we are also using the OCD3, a Dockerized custom Jenkins to deploy OpenMRS and Bahmni server:

Though it may not be usable “as is” for you as there is some assumptions that are not documented in there. The main one being that you need to package your projects as Maven distributions. Have a look at what we’ve done here for instance:

Hi @bart, did the above helped?

Hi @mksrom, thanks for taking the time to explain the current state of things. Due to severely limited resources we’ve had put aside our desire for CI pipelines and Dockerization. Instead we built custom Ansible playbooks to provision both bare metal prod machines as well as development and acceptance VMs, as this is all pretty similar to proven existing solutions.

Hi @mksrom, thank you for open sourcing your deployment scripts.

I just started exploring bahmni and openmrs and still green on configuration managements.

Would you be kind enough to guide me what I need to do to have bahmni and openmrs up and running in a dockerized environment?

I have cloned bahmni-docker and checked out BAH-781 branch and run the docker compose command. It builds and starts fine but I can’t seem to get the main screen working. I get an error message The search with the given parameters is not valid [The search with id 'byTags' for 'v1/location' resource is not recognized]. I think am missing some baseline modules and configurations for both openmrs/bahmni apps just not sure which ones.


Hi @kabangi, indeed we come across this issue as well. This is described in ticket and is due to the Bahmni Core Liquibase migrations not working on an “empty” database.

We are currently working on this issue, and hopefully will come with an answer to this soon.

Thank @mksrom seems I will have to go back to bare metal deployments until this is fixed.

I will be watching it closely. If you happen to bump to a solution kindly update here.


Well, actually you could already move to using Bahmni as a Docker container, however not in an optimized way.

That is using as a monolith image. We do use such containers ourselves for the moment.

Those images are build using the bahmni-docker project too, but on master this time. Note that since they are already built, you can simply fetch at Docker Hub