Kiến Thức Linux Tutorial

🏥 How to Install OpenMRS on Ubuntu 22.04

OpenMRS

OpenMRS is a robust, open-source electronic medical record (EMR) system designed to improve healthcare delivery in resource-constrained environments. This guide provides a step-by-step walkthrough to install OpenMRS on Ubuntu 22.04 using the Enterprise setup with Apache Tomcat and MySQL.


📋 Prerequisites

Before proceeding, ensure you have:

  • A server running Ubuntu 22.04.
  • A user account with sudo privileges.
  • A stable internet connection.

🔄 Step 1: Update System Packages

Begin by updating your system’s package index:

sudo apt update -y
sudo apt upgrade -y

Reboot the system if necessary:

sudo reboot

☕ Step 2: Install Java Development Kit (JDK)

OpenMRS requires Java to run. Install OpenJDK 11:

sudo apt install openjdk-11-jdk -y

Verify the installation:

java -version

🐬 Step 3: Install and Configure MySQL

Install MySQL server:

sudo apt install mysql-server -y

Secure the MySQL installation:

sudo mysql_secure_installation

During the prompt:

  • Set a strong root password.
  • Remove anonymous users.
  • Disallow root login remotely.
  • Remove test database.
  • Reload privilege tables.

Log in to MySQL to create a database and user for OpenMRS:

sudo mysql -u root -p

Within the MySQL shell, execute:

CREATE DATABASE openmrs_db;
CREATE USER 'openmrs_user'@'localhost' IDENTIFIED BY 'your-strong-password';
GRANT ALL PRIVILEGES ON openmrs_db.* TO 'openmrs_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

🐱‍🏍 Step 4: Install Apache Tomcat

Install Tomcat 9 and its admin interface:

sudo apt install tomcat9 tomcat9-admin -y

Ensure Tomcat is running:

sudo systemctl start tomcat9
sudo systemctl enable tomcat9
sudo systemctl status tomcat9

📦 Step 5: Download and Deploy OpenMRS

Create a directory for OpenMRS data:

sudo mkdir /var/lib/OpenMRS
sudo chown -R tomcat:tomcat /var/lib/OpenMRS

Download the latest OpenMRS WAR file:

wget https://sourceforge.net/projects/openmrs/files/releases/OpenMRS_Platform_2.5.7/openmrs.war

Move the WAR file to Tomcat’s webapps directory:

sudo cp openmrs.war /var/lib/tomcat9/webapps/

Set appropriate permissions:

sudo chown tomcat:tomcat /var/lib/tomcat9/webapps/openmrs.war

Restart Tomcat to deploy OpenMRS:

sudo systemctl restart tomcat9

🌐 Step 6: Access OpenMRS Web Interface

Open your web browser and navigate to:

http://your-server-ip:8080/openmrs

Replace your-server-ip with your server’s actual IP address.

You should see the OpenMRS setup wizard. Follow the on-screen instructions:

  1. Select Language: Choose your preferred language.
  2. Installation Type: Opt for “Advanced” to specify database details.
  3. Database Connection:
    • Database Driver: com.mysql.cj.jdbc.Driver
    • Database URL: jdbc:mysql://localhost:3306/openmrs_db?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
    • Username: openmrs_user
    • Password: your-strong-password
  4. Create Database: Allow OpenMRS to create the database schema.
  5. Add Demo Data: Optionally, load demo data for testing purposes.

After completion, log in using:

  • Username: admin
  • Password: Admin123

Ensure to change the default password after the first login for security reasons.


🔒 Step 7: Configure Firewall (Optional)

If you have UFW (Uncomplicated Firewall) enabled, allow traffic on port 8080:

sudo ufw allow 8080
sudo ufw reload

✅ Conclusion

You’ve successfully installed and configured OpenMRS on Ubuntu 22.04. This setup provides a robust platform for managing electronic medical records. For advanced configurations, module installations, and customization, refer to the official OpenMRS documentation:

OpenMRS Documentation


Meta Description: Step-by-step guide to install and configure OpenMRS on Ubuntu 22.04 using Apache Tomcat and MySQL. Ensure a secure and efficient EMR system setup.

SEO Keywords: OpenMRS installation Ubuntu 22.04, install OpenMRS Ubuntu, OpenMRS setup guide, electronic medical record system Ubuntu

Hướng dẫn cài đặt Cluster Kafka trên Ubuntu

https://forum.congdonglinux.com


Add Comment

Click here to post a comment