My experience with setting up openMRS

Bawantha Rathnayaka
3 min readNov 4, 2020

Few days ago, I was looking for an easy way to setup openMRS server. then i found the openMRS SDK.

And then the first thing i do is installed ubuntu to my personal laptop.

you can install those application by visting the links below

After installing those applications, follow the 5 steps below

  1. Create a distribution server.
  2. Select Reference Application version.
  3. Set debug port.
  4. Connect with database.
  5. Add a module as watched in the selected server.

The first thing you need to do is start the Docker using the following command

sudo systemctl start docker

Then configure the server using the following command

mvn openmrs-sdk:setup

This will start the SDK in the wizard mode. When prompted, give a name to the server you’re creating.

Next, you will be prompted to select server type

You can setup the following servers:

1) Distribution

2) Platform

Which one do you choose? [1/2]:

Make a Distribution server by entering 1. Next you’ll be prompted to select the distribution version.

You can deploy the following versions of distribution:

1) Reference Application 2.6-SNAPSHOT

2) Reference Application 2.5

3) Reference Application 2.4

4) Reference Application 2.3.1

5) Reference Application 2.2

6) Other...

Which one do you choose? [1/2/3/4/5/6]:

Select the latest Reference Application version by entering 1.Next you’ll be prompted to select the port would you like your server to use? (default: ‘8080’):

Next you’ll be prompted to select the port would you like your server to use? (default: ‘8080’):

Select the port by entering 9000. Next you’ll be prompted to select the port would you like your server to debug?

If you want to enable remote debugging by default when running the server, 
specify the port number here (e.g. 1044). Leave blank to disable debugging.
(Do not do this on a production server) (default: 'no debugging'):

select the port by “5005”.Next you’ll be prompted to select the database would you like to use?

Which database would you like to use?:
1) MySQL 5.6 (requires pre-installed MySQL 5.6)
2) MySQL 5.6 in SDK docker container (requires pre-installed Docker)
3) Existing docker container (requires pre-installed Docker)
Which one do you choose? [1/2/3]:

select the Mysql 5.6 in SDK docker container by entering 2.Next you’ll be prompted to select the which JDK would you like to use to run this server?

Which JDK would you like to use to run this server?:
1) JAVA_HOME (currently: /usr/lib/jvm/java-11-openjdk-amd64)
2) Other...
Which one do you choose? [1/2]:

select the JAVA_HOME by entering 1. After completing these activities you will see some comands as shown below

[INFO] Server configured successfully, path: /home/bawantha/openmrs/medium2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:59 min
[INFO] Finished at: 2020-11-04T12:14:57-05:00
[INFO] ------------------------------------------------------------------------

Now we can start the server using the following command

mvn openmrs-sdk:run -DserverId="your_server_name"

After doing that, a message with the following link will appear

OpenMRS is ready for you at http://localhost:9000/openmrs/
Nov 04, 2020 12:14:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-9000"]

if you see this when you go to that link then you have configured the server correctly.

Congratulations.your Dev server is configured properly!

--

--

Bawantha Rathnayaka

I write about my experiences as a Software Engineer and the tech I use daily. portfolio - https://bawanthathilan.vercel.app/