Wiki Spaces


Get Help from Others

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


Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated MySQL section for new Ubuntu versions


            Before building and compiling OpenMRS make sure you have or install the following dependencies:



Java JRE

            Check for the JRE by going into the Terminal and typing


            If Java is installed, the result should be 1.6 or higher, and platform 2.x requires Java 1.8.



            If you don’t have Java installed, you should get a message returned that says “The program java can be found in the following packages”. Then execute the command:

                        sudo apt-get install default-jre


Java JDK

            Check for the JDK by going into the Terminal and typing


            The result should look something like this: 


            Again, OpenMRS requires at least java 1.6, and platform 2.x requires Java 1.8.


            Choose java 8 by entering the corresponding selection number.


            You must know your MySQL root password or have a database ready with a username and password. To check if you have MySQL installed, simply type mysql into the Terminal. If you don’t have it installed use the command:

                        sudo apt-get install             It is recommended to use MySQL 5.7 for OpenMRS Platform 2.3, or MySQL 5.6 for OpenMRS 2.2 and below. 

            To check if your version of MySQL, type into a terminal:

Code Block
mysql --version

            In order to install old versions of MySQL on newer versions of Ubuntu (like 20.04), follow the instructions outlined here.

            On older versions of Ubuntu, you may be able to install MySQL using:

Code Block
sudo apt-get install mysql-server-5.7


Image Removed 


            You will need to input the password of your machine. You will then get the message “Do you want to continue? [Y/n]” assuming you want to continue, type y then hit the enter key.

            You       Once installed, you will then be prompted to set a root password for MySQL. It should look like this:



You will be asked to repeat the password you typed.

You must know your MySQL root password, or have a database ready with a username and password for OpenMRS.

            Note: Make sure that your firewall accepts tcp TCP connection on port 3306 for mysqlMySQL. Also make sure that your hosts.deny file allows access to your localhost. 


            OpenMRS uses Maven to compile and generate source files. To see if you have maven, use the following command in the Terminal:


            If Maven is not installed, you should get the message “The program ‘mvn’ is currently not installed. You can install it by typing: sudo apt install maven”. Follow those instructions.


Getting the OpenMRS-core from GitHub


            Make sure you put the openmrs-core into the home directory of your machine.


Downloading a User Interface Module



            Then you’ll want to move the legacyui-(version#)-SNAPSHOT.omod into the ~/.OpenMRS/modules directory. If you want to do this manually in the Files window, go to the Home directory and Ctrl+H to find show hidden folders. There should be a “.OpenMRS” folder. Inside that folder there should be a “modules” folder – this is where you want to put the UI .omod file.


            This may take a while depending on your machine. Your Terminal should be looking something like this:




            This will compile, run tests, build all artifacts, and install them into your local repository.


Running OpenMRS

            Move into the “webapp” directory inside the “openmrs-core” and run the command:


            Wait for “[INFO] Started Jetty Server” which look like this:



            Now open a web browser and go to


            After it asks you to select a language, you should see this



Click here if choosing Advanced Installation Method


If you choose the Simple Installation method, your screen should look like this: 


The "Password" field is the password you set when you downloaded MySQL above.