You can set up an OpenMRS server on your computer for testing and debugging modules. With OpenMRS SDK and Docker, you can set up the OpenMRS server very easily with a step of installing MySQL 5.6; a separate installation of MySQL server is not needed.
This instruction applies to both Windows 10 and Ubuntu.
Before start, make sure:
- You have installed:
If you are using Windows 10, you need to use PowerShell; if you are using Ubuntu, you need to be the root user.
To enter the root user mode on Ubuntu, type the following on your terminal window:Note: Without PowerShell or root user mode, the installation will fail.
Install OpenMRS SDK
To install OpenMRS SDK on your system, type:
To test the installation, type:
When the installation is successful, the screen displays:
For more info, see SDK documentation: https://wiki.openmrs.org/display/docs/OpenMRS+SDK
Set Up OpenMRS Server
With OpenMRS SDK, You can either install OpenMRS platform or OpenMRS distribution on your system. OpenMRS platform has no user interface. If you want to see basic OpenMRS functions, choose distribution. You can also run multiple servers of different types in parallel.
Start the installation by typing the command:
- Enter your server ID at the prompt.
- To choose server type, select 1 for distribution.
- Select distribution version.
- Set the port to default i8080.
- Set the port for remote debug to 1044.
- To choose MySQL installation method, select 2.
SDK starts to install MySQL 5.6 in a docker container.Note: Make sure you have installed Docker and it is running.
- For Ubuntu, select 1. (JAVA_HOME) as the JDK for the server.
For Windows, this step is automatic.
When the process is complete, the screen displays a “Server configured successfully…” message.
Run OpenMRS Server
To run the OpenMRS server, type:
When the server starts successfully, the output at bottom of the terminal window displays:
Log In to OpenMRS Server
Now you can visit the OpenMRS server.
- Open a browser, type in the server url: http://localhost:8080/openmrs/
- Wait till the initialization process is complete then login with:
You have completed setting up OpenMRS SDK and server. To learn more about OpenMRS SDK go to: OpenMRS SDK, or OpenMRS SDK Step by Step Tutorials.