Hi OpenMRS community,
After a few hours of headaches and frustrations, I have finally been able to install OpenMRS on my laptop for development. Not sure if there’s another guide elsewhere, but most of the guides that I found were a bit outdated or incomplete.
Here’s a step-by-step process of what I did pretty much and the prerequisites you need for OpenMRS to work.
- The latest Tomcat version seems to work, but I currently use Tomcat 8 (Not covered in this guide, since this will just be a local install using Jetty).
- The latest Java version does not seem to work according to my testing. After some time testing and reading the forums, Java 1.8 seems to work best with OpenMRS.
- The latest MYSQL version also does not seem to work. When you try to initialize the database, OpenMRS will bug you saying that it can’t connect to the database. I tried checking my MYSQL password over and over again and even changing it, but it didn’t work. Downgrading to 5.5 did the trick.
- The latest Maven version seems to work.
- Git works regardless of whichever version you have, so just download the latest one.
Alright, so here’s what worked for me and I hope works for you. I am using Windows 10.
- I installed the JDK from here.
- I then installed MYSQL from here. (When installing, you can just install the server from going to the custom installation setting. You don’t need most of the applications from there for OpenMRS. When you are installing the program and are configuring the password, make sure you use a password that you will remember - You will need this password when initializing OPENMRS )
- Next just install Maven normally from here. There’s an excellent guide for that posted here.
- Next install Git from here.
- Once you have installed Git, cd to whichever folder or directory works best for you. Once you are satisfied with the folder, type in:
It may take a while for this to happen depending on how fast your internet is. Once that’s completed. cd to that directory with the command:
Once that is completed, run this command:
mvn clean install
This may also take some time. It took around 15-20 minutes for my computer to build the entire thing.
- Now that you have installed everything. Make sure your MYSQL server is running. then cd over to webapp in your openmrs-core directory with the command:
Once that’s done, type in:
Wait for Jetty to initialize, and once you see the terminal or command prompt say that it is running head on over to http://localhost:8080/openmrs which will help you set up the database. Make sure you remember your MYSQL password from before as this step requires it. Again, make sure you are using MYSQL 5.5, other versions didn’t work for me. It kept telling me that it couldn’t connect to the database. Once the setup is completed, it’s going to tell you that no module is installed - this means you can’t use the admin interface. You can now go over to whichever directory you’d like to git clone this interface module. Here is the command for git cloning:
git clone https:
Once that’s done, cd over to that directory and then type in:
mvn clean install
This may take a while, but once that’s done, cd over to openmrs-module-legacyui/omod/target. There you will see a file with an .OMOD extension. Once you find that, copy that file over to OpenMRS’ AppData. You can do this in Windows 10 by searching for %APPDATA%. Once you are in the AppData folder, cd over to OpenMRS’ folder, then modules. Once inside that modules folder, copy that .omod file there. Once you have copied it over, restart your jetty server if it is still running. To do so, either click the X on the command prompt or hit CTRL+C. Once that’s done, cd over to wherever you installed openmrs-core then cd over to webapp. Once you are there, finally type in:
Once that’s done, your install should now be complete. For your reference, the default login credentials are username: admin and the password: Admin123.
And there you have it. You should now be in the admin menu for OpenMrs. I hope this guide helps you guys out!