Back to articles
Security & Anti-DDoS

Building a High-Security Internal Medical Record Management System with OpenEMR on VPS Docker

A detailed guide to building a high-security internal medical record management system using OpenEMR on VPS Docker, covering Docker configuration, network security, and secure...

DPTCloud Engineering4 min read
Building a High-Security Internal Medical Record Management System with OpenEMR on VPS Docker

Image credit: vjohns1580 · Pixabay Content License

Introduction

OpenEMR is an open-source electronic medical records (EMR) system widely used in small to medium-sized clinics and hospitals. To ensure high security for sensitive patient data, deploying OpenEMR on a secure internal environment such as a VPS with Docker is an ideal choice. This guide will walk you through building a high-security internal medical record management system with OpenEMR on VPS Docker, including Docker configuration, network security, and secure storage integration.

Requirements and Preparation

To deploy the system, you will need:

  • A Linux-based VPS (Ubuntu 20.04 or 22.04 is recommended).
  • Docker and Docker Compose installed.
  • A domain name or Cloudflare Tunnels for secure access.
  • A MySQL or MariaDB database.
  • A configured firewall (UFW or iptables).

Configuring OpenEMR on Docker

OpenEMR can be easily deployed using Docker Compose. Below is a sample docker-compose.yml file:

version: '3.8'
services:
  openemr:
    image: openemr/openemr:latest
    container_name: openemr
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./data:/var/www/html
    environment:
      - MYSQL_HOST=mysql
      - MYSQL_USER=openemr
      - MYSQL_PASSWORD=openemrpass
      - MYSQL_DATABASE=openemr
    depends_on:
      - mysql
    restart: unless-stopped
  mysql:
    image: mysql:8.0
    container_name: mysql
    environment:
      - MYSQL_ROOT_PASSWORD=rootpass
      - MYSQL_DATABASE=openemr
      - MYSQL_USER=openemr
      - MYSQL_PASSWORD=openemrpass
    volumes:
      - ./mysql_data:/var/lib/mysql
    restart: unless-stopped

Run the following command to start the system:

docker-compose up -d

System Security

To ensure the system is secure, follow these steps:

  • Integrate Cloudflare Tunnels: Use Cloudflare Tunnels to access OpenEMR without opening ports 80/443 on the VPS.
  • Use Strong Passwords: Ensure MySQL and OpenEMR passwords are strong and changed regularly.
  • Integrate WireGuard: Set up a private VPN with WireGuard for secure VPS access.
  • Regular Updates: Keep OpenEMR and Docker updated to avoid security vulnerabilities.

Verification and Testing

To verify the system is operational:

  1. Open a browser and access https://your-domain.com.
  2. Ensure the OpenEMR interface appears and login is possible.
  3. Perform basic actions like creating a patient record to test stability.

Troubleshooting

  • Cannot Access: Check Cloudflare Tunnels and firewall settings.
  • MySQL Connection Error: Verify the username and password in the docker-compose.yml file.
  • OpenEMR Fails to Start: Check Docker logs using docker logs openemr.

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478