Step-by-Step Installation for Developers


Operating System Specific:

STEP 1 - Prerequisites for Installing OpenMRS

  1. Download and install the latest stable release of the following software

STEP 2 - Retrieve a Copy of the Source Code

  1. With Subversion installed:
    1. Create a new directory for the code. Our example will call it OPENMRS.
    2. At a command line prompt in the OPENMRS directory, run %SVN_HOME%/bin/svn checkout http://svn.openmrs.org/openmrs/trunk
  2. With TortoiseSVN installed:
    1. Right-click within explorer and select SVN Checkout...
    2. Enter URL as http://svn.openmrs.org/openmrs/trunk, specify a new directory for your working copy, then click OK
  3. With Subclipse installed (in eclipse):
    1. File-->New-->Project...-->SVN-->Checkout project from SVN
    2. Use Repository - http://svn.openmrs.org/
    3. Browse in new tree to /openmrs/trunk
    4. Go through various prompts with Next>

STEP 3 - Create your OpenMRS-build.properties file =

  1. Open a text editor (i.e. Notepad - click Start > Programs > Accessories > Notepad)
  2. Copy-and-paste Build Properties section from Overriding OpenMRS Default Properties into Notepad
  3. Save file to
  4. %USER_HOME%\Application Data\OpenMRS\OpenMRS-build.properties (for windows) or ~/.OpenMRS/OPENMRS-build.properties (for unix) or %USER_HOME%\AppData\Roaming\OpenMRS\OpenMRS-build.properties (for Windows Vista)
  5. Modify the Build Properties to match the location for your installation of Tomcat.
    for windows
    tomcat.home=C:/Program Files/Apache Software Foundation/Tomcat 6.0/
    for unix
    tomcat.home=/usr/local/apache-tomcat-6.0.16
  6. If you are using unix, change your properties.xml file so that:
    <property name="tomcat.home" value="/usr/local/apache-tomcat-6.0.16"/>
    <property name="catalina.home" value="/usr/local/apache-tomcat-6.0.16"/>

NOTE: Make sure the file does not save with a .txt file extension behind the scenes (Turn on 'show extensions for known filetypes' in windows).

STEP 4 - Deploy OpenMRS

Assumptions and Dependencies:

  • Ensure that Tomcat is running
  • Once you are up and running, the default OpenMRS user/password is admin/test

Eclipse (in Windows, Linux, Unix, Mac)

  1. Run Eclipse.exe
  2. Download the OpenMRS trunk code using the subclipse plugin and the SVN Repository perspective.
  3. In the project explorer, right click on your OpenMRS project folder root and select "properties", left click on "Java Compiler" and ensure that the Java Compiler is set to Compiler compliance level 5.0
  4. Click Window > Show View > Ant
  5. Drag and Drop build.xml from the 'openmrs' project into the Ant view
  6. In the Ant view (left pane), expand the 'openmrs-trunk' build file
  7. Double click on the install ant task (this may take a few minutes)
    • NOTE: Subsequent re-installs can be done using the update Ant task.
  8. Make sure your tomcat user has the roles manager,admin,tomcat
    • More specifically, add these lines inside your Tomcat installation conf/tomcat-users.xml file:
    • <role rolename="manager"/>
    • <role rolename="tomcat"/>
    • <role rolename="admin"/>
    • <user username="test" password="test" roles="admin,manager,tomcat"/>
    • You will want to restart Tomcat (stop service and start service) after you save these changes
  9. View your installation at http://localhost:${tomcat.port}/${webapp.name}/ (Default is http://localhost:8080/openmrs)
  10. For support on Windows XP/Vista/Eclipse integration, contact jim@manico.net

Command Line (Windows XP)

  1. Open a Windows command line prompt
    1. Click Start Menu > Run
    2. Type 'cmd' at the Open prompt
    3. Press Ok
  2. Change directories to the openmrs project directory where you checked out the OpenMRS trunk code using Tortoise
  3. Type 'ant install'
    • Assumes that Ant has been added to your PATH (provide link to instructions)
    • Future compilations can run %ANT_HOME%/bin/ant -k clean remove install or %ANT_HOME%/bin/ant update

Command Line (Unix / Linux)

  1. Log into server
  2. Open a bash shell
  3. Change directories to the openmrs project directory where you checked out the OpenMRS trunk code using svn.
  4. Type 'ant install'
    • Future compilations can run %ANT_HOME%/bin/ant -k clean remove install or %ANT_HOME%/bin/ant update

STEP 5 - Database and Runtime Properties Created

  1. Go to http://localhost:8080/openmrs in your web browser
  2. Walk through the initial setup wizard and it will create your database for you, put in demo data, and create your runtime properties file.