OpenEMR on Ubuntu 24.04 with NGINX

OpenEMR is a certified open-source electronic medical record (EMR) and medical practice management solution. It supports medical billing, patient scheduling, electronic prescriptions, and health records — making it one of the most comprehensive free EMR systems available.

Deploying OpenEMR on Ubuntu 24.04 with NGINX as the web server provides a high-performance, secure, and modern environment for healthcare IT infrastructures.


Key Features of OpenEMR

FeatureDescription
Patient ManagementDemographics, medical history, documents, and communication tracking
EHR / EMR FunctionalityFull clinical charting, SOAP notes, and medical forms
SchedulingCalendar system for appointments and resource allocation
Medical BillingIntegrated billing and insurance module with support for X12 837/835
e-PrescribingElectronic prescriptions, drug interactions, and dosage support
Reports and AnalyticsMedical, financial, and patient reports
Multi-language SupportOver 30 language packs available
Access Control and LoggingUser roles, audit trails, HIPAA compliance-ready

Benefits of Using NGINX with OpenEMR on Ubuntu 24.04

BenefitDetails
PerformanceNGINX’s asynchronous architecture excels under high concurrent loads
TLS/SSL SupportSimple integration with Let’s Encrypt and modern HTTPS configurations
Reverse Proxy ReadyIdeal for proxying to PHP-FPM for better performance and isolation
Load BalancingBuilt-in options for scaling OpenEMR deployments across servers
Ubuntu 24.04 CompatibilitySupports PHP 8.3, MariaDB 10.11+, and modern security libraries

System Requirements (Recommended)

ComponentSpecification
OSUbuntu Server 24.04 LTS
Web ServerNGINX + PHP-FPM 8.3
DatabaseMariaDB or MySQL
PHPPHP 8.1–8.3 with required extensions (pdo, gd, mbstring, etc.)
RAMMinimum 2 GB (4 GB or more for production use)
StorageAt least 2 GB for core installation + user data

Common Use Cases

  • Independent Clinics: Use OpenEMR for patient records, billing, and reporting.
  • Medical Groups: Centralize operations for multiple physicians or departments.
  • Telemedicine Startups: Integrate with custom frontends via APIs for remote healthcare services.
  • NGOs and Global Health Programs: Take advantage of multi-language support and cost-free licensing.

Security and Compliance

  • HIPAA-ready with logging, access controls, and backup features.
  • Supports encrypted communications via NGINX + TLS (Let’s Encrypt or custom certs).
  • Audit trail logs ensure accountability and traceability of access and modifications.

Comparison with Other EMR Systems

EMR SystemOpen SourceCertificationCustomizableDeployment Type
OpenEMRYesONC-certifiedHighSelf-hosted
OpenMRSYesNoHighSelf-hosted
MediTrackerNoYesLowSaaS
Epic/AllscriptsNoYesVery LimitedEnterprise SaaS

OpenEMR on Ubuntu 24.04 with NGINX is an ideal choice for organizations looking for a powerful, customizable, and cost-effective EMR solution. NGINX enhances performance and scalability, while Ubuntu 24.04 provides long-term support and up-to-date packages for secure operation. This combination supports both small clinics and large-scale healthcare operations seeking control and efficiency in medical data management.


Create and Connect to a VPS on Shape.Host

Create a Cloud VPS Instance

Go to https://shape.host and log in.

Click “Create” → choose “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Configure:

Location: Choose any available data center

Shape.host instance form with the data center location selector highlighted.

OS: Select Ubuntu 24.04 (64-bit)

Resources: Minimum 2 CPUs, 4 GB RAM, and 20 GB SSD

Shape.host instance form with the operating system image selector highlighted.

Click “Create Instance”

Shape.host instance form with the Create Instance button highlighted.

Once created, copy your instance’s public IP address

Shape.host Resources dashboard with the server IP address highlighted.

Connect via SSH:

ssh root@your-server-ip

On Windows, use PuTTY.


Connect to the Server

Option 1: SSH (Linux/macOS/WSL)

From your terminal, run:

ssh root@YOUR_INSTANCE_IP

Replace YOUR_INSTANCE_IP with the IP of your VPS.


Option 2: Use PuTTY on Windows

  1. Download PuTTY: https://www.putty.org
  2. Open PuTTY and enter your instance IP under “Host Name”
  3. Leave port as 22, connection type as SSH
  4. Click Open
  5. When prompted, log in as:
    • Username: root
    • Password: Provided in instance details or set during deployment

You’re now ready to start installing OpenEMR.


Step 1: Update the System

apt update

Updates the local package list so you install the latest versions.

Terminal showing APT package management commands and output.

Step 2: Install Required Packages

apt install nginx mariadb-server php-fpm php-mysql php-bcmath php-xml php-zip php-curl php-mbstring php-gd php-tidy php-intl php-cli php-soap imagemagick libtiff-tools php-ldap

Installs the NGINX web server, MariaDB database, and all PHP extensions required by OpenEMR.

Terminal showing APT package management commands and output.

Step 3: Check MariaDB and PHP-FPM Services

systemctl is-enabled mariadb
systemctl status mariadb

Checks that MariaDB is installed and running.

Terminal showing systemd service management commands or output.
systemctl is-enabled php8.3-fpm
systemctl status php8.3-fpm

Checks PHP-FPM service is active.

Terminal showing systemd service management commands or output.

Step 4: Tune PHP Settings

nano /etc/php/8.3/fpm/php.ini

Update key settings:

max_execution_time = 60
max_input_time = -1
memory_limit = 512M
post_max_size = 30M
upload_max_filesize = 30M
max_input_vars = 3000
mysqli.allow_local_infile = On

Apply group ownership:

chgrp -R www-data /var/lib/php/sessions
systemctl restart php8.3-fpm
Terminal showing systemd service management commands or output.

Step 5: Secure MariaDB & Create Database

Run the secure installation:

mariadb-secure-installation
Terminal showing MariaDB/MySQL database security configuration prompts.

Then enter the MariaDB shell:

mariadb -u root -p

In MariaDB shell:

CREATE DATABASE openemr;
CREATE USER 'openemruser'@'localhost' IDENTIFIED BY 'Your_password2';
GRANT ALL PRIVILEGES ON openemr.* TO 'openemruser'@'localhost';
FLUSH PRIVILEGES;

This sets up the database and credentials OpenEMR will use.

Terminal showing SQL database and user configuration commands.

Step 6: Download and Prepare OpenEMR

cd /var/www/
wget https://sourceforge.net/projects/openemr/files/OpenEMR%20Current/7.0.3/openemr-7.0.3.tar.gz
tar -pxzf openemr-7.0.3.tar.gz
mv openemr-7.0.3 openemr
chown -R www-data:www-data /var/www/openemr

Downloads the OpenEMR source and prepares it for NGINX.

Terminal showing file download commands and transfer output.
Terminal showing file ownership or permission commands.

Step 7: Configure NGINX for OpenEMR

nano /etc/nginx/sites-available/openemr

Paste and adjust (especially server_name):

server {
    listen 80;
    server_name example.com;

    access_log /var/log/nginx/openemr.access.log;
    error_log /var/log/nginx/openemr.error.log;

    root /var/www/openemr;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~* \.php$ {
        try_files $uri =404;
        fastcgi_index index.php;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        include fastcgi_params;
    }

    location ~* ^/sites/*/(documents|edi|era) {
        deny all;
        return 404;
    }

    location ~* ^/(contrib|tests) {
        deny all;
        return 404;
    }

    location ~* ^/(admin|setup|acl_setup|acl_upgrade|sl_convert|sql_upgrade|gacl/setup|ippf_upgrade|sql_patch)\.php {
        deny all;
        return 404;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    location ~ /\. {
        deny all;
    }
}
Terminal showing the GNU nano editor and configuration text.

Enable the config:

ln -s /etc/nginx/sites-available/openemr /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
Terminal showing systemd service management commands or output.

Step 8: Configure Firewall with UFW

ufw allow 'Nginx Full'
ufw allow ssh
ufw enable

Allows traffic for NGINX and SSH.

Terminal showing firewall configuration commands and rules.

Step 9: Add HTTPS with Let’s Encrypt

apt install certbot python3-certbot-nginx
certbot --nginx -d ubuntu-tutorials.shape.host

Obtains and configures a free SSL cert.

Terminal showing APT package management commands and output.
Terminal showing Certbot certificate commands and messages.

Step 10: Finish Web Setup

Visit:

https://your-domain.com

Follow the OpenEMR installer to complete setup.

OpenEMR installer file and directory permission checks.

First, the installer will check the permissions of the OpenEMR source code, so make sure you have proper permission.

OpenEMR installer database setup selection.

Select the ‘I have created the database‘ option to set up your database integration.

OpenEMR installer database and initial user settings.

Enter your database details and the new administrator admin for OpenEMR.

OpenEMR installer database and first-user creation results.

The database initialization will be running and your admin user will be created.

OpenEMR installer PHP configuration recommendations.

Next, make sure your PHP configuration is met with the OpenEMR requirements.

OpenEMR installer theme selection.

Once the installation is complete, you’ll be redirected to the OpenEMR login page. Type your admin user and password, then click Login.

OpenEMR installation completion and final setup instructions.
OpenEMR sign-in form.

If successful, you’ll see the following OpenEMR dashboard.

OpenEMR interface showing the appointment calendar.

🔹 Fast Cloud VPS servers with SSD & global regions
🔹 Ubuntu 24.04 support with instant deployment
🔹 Affordable plans for medical and healthcare platforms
🔹 Full root access + firewall control

👉 Start building your OpenEMR platform today at https://shape.host