Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

OpenShift is a PAAS by RedHat one may use for easy OpenMRS deployment with low initial cost and easy scaling. Unlike IAAS (VDS such as EC2) it does not require manual server administration - one may just deploy an app, while care of hosting management is taken by RedHat.

This guide assumes you already have an OpenShift account with domain selected and SSH keys added.

Commands specified are valid for *nix environment, adaptation to others is trivial though.

You should replace variables (such as $OPENSHIFT_APP_UUID) with their real values except while working on the server/having them declared in some other way.

Step-by-step guide

  1. Add a DIY cartridge. You should name it (e.g. 'openmrs') and provide a configuration URL (we use a custom Tomcat).
  2. Add MySQL cartridge to the previously created one (OpenShift console -> cartridge -> Databases -> Add MySQL).
  3. Prepare to change the cartridge:
    1. Clone its repository: 
      1. git clone ssh://
    2. Move to the resulting directory:

      1. cd openmrs/
  4. Deploy custom Tomcat (Custom here means not the default one for OpenShift. In fact, this variant is upstream.)

    1. git remote add tomcat-upstream -m master git://
    2. git pull -s recursive -X theirs tomcat-upstream master
    3. git push
    4. Check if Tomcat has started successfully by visiting your server via browser (URL is written on cartridge's page in console).
  5. Deploy OpenMRS to server:
    1. Download the app archive (version specified here is the most recent one by the time of writing) into tomcat webapps directory:
      1. curl -L -o diy/tomcat/webapps/openmrs.war
    2. git add diy/tomcat/webapps/openmrs.war
    3. git commit -m 'Deployed OpenMRS Platform 1.10.1'
    4. git push
    5. Check if it has started succesfully by visiting http://$OPENSHIFT_APP_DNS/openmrs (default path).

  6. Configure OpenMRS on low level:
    1. Set proper OpenMRS configuration file path (via env var):

      1. ssh to the server

      2. echo "/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs/" > .env/user_vars/OPENMRS_RUNTIME_PROPERTIES_FILE
    2. Set proper app data directory (default is ~/.OpenMRS):

      1. echo "application_data_directory=/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs" > diy/openmrs/
    3. Add MySQL configuration to OpenMRS config:

      1. echo "### Database connection properties
        connection.url=jdbc:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/$OPENSHIFT_APP_NAME?autoReconnect=true" >> diy/openmrs/
  7. Proceed to high-level OpenMRS configuration via browser. You should not select 'Simple' as type of installation as it assumes having MySQL root, etc.

  • No labels