Mirth Connect

Mirth Connect Cloud Deployment 2026: AWS, Azure & Docker Production Guide

March 14, 202613 min readUpdated Nov 29, 2026
Written by
Yogesh Daga
Yogesh Daga

Founder & CEO

15+ years building healthcare technology. Founder & CEO of Nirmitee.io, whose teams deliver EHR integrations, FHIR and HL7 platforms, ABDM and NHCX connectivity, and clinical AI for health systems and healthtech companies.

Mirth Connect Cloud Deployment 2026: AWS, Azure & Docker Production Guide

For the past decade, most Mirth Connect deployments lived on a single Windows server in a hospital data center. A dedicated VM, maybe a physical server, running Mirth with an embedded Derby database or a local PostgreSQL instance. This approach works until it does not: the server fails at 2 AM, the database fills up over a holiday weekend, or the hospital merges with another health system and suddenly needs to process three times the message volume with zero downtime.

New to Mirth? Start with our Mirth Connect guide: what it is, how it works, and when it fits.

Cloud deployment solves these problems, but it introduces new ones. AWS, Azure, and containerized deployments offer scalability, high availability, and disaster recovery that on-premise installations struggle to match, but they also require different expertise, different security models, and different cost structures. According to a HIMSS survey, over 80% of healthcare organizations are now using or planning to use cloud infrastructure for clinical applications, and integration engines are a natural fit for this migration.

This guide covers the complete spectrum of cloud deployment for Mirth Connect: from a simple Docker Compose setup for development to production-grade Kubernetes clusters on AWS and Azure. Whether you are a DevOps engineer moving your first Mirth instance to the cloud or a cloud architect designing a multi-region integration platform, this guide provides the architecture patterns, configuration details, and cost analysis you need to make informed decisions.

Watch: Running Mirth Connect in Production: Daily Checks, Backups and Runbooks (1:52).

Why Move Mirth Connect to the Cloud

The business case for cloud Mirth deployment rests on four pillars:

Scalability on Demand

On-premise Mirth servers have fixed capacity. When message volume spikes, whether from a seasonal flu surge, a new integration partner, or a hospital merger, you are limited by the hardware you purchased 18 months ago. Cloud instances can be right-sized in minutes. Vertical scaling (bigger instances) handles immediate spikes. Horizontal scaling (multiple Mirth nodes behind a load balancer) handles sustained growth.

High Availability Without Complexity

Building high availability for on-premise Mirth requires redundant hardware, shared storage, database clustering, and load balancers, all managed by your team. Cloud providers offer these as managed services. AWS RDS Multi-AZ gives you automatic database failover. Application Load Balancers distribute traffic across Mirth instances. Auto Scaling Groups replace failed instances automatically. The result is better availability with less operational burden.

Disaster Recovery

On-premise disaster recovery means maintaining a second data center with replicated infrastructure. Cloud disaster recovery means cross-region database replicas and infrastructure-as-code that can rebuild your entire environment in a different region within hours. The cost difference is dramatic: maintaining a warm DR site on-premise costs $50,000-$100,000+ per year, while cross-region backups in the cloud cost a fraction of that.

Cost Optimization

Cloud deployment shifts capital expenditure (buying servers) to operational expenditure (monthly service fees). For many organizations, this is not just a financial preference but a strategic advantage: you pay for what you use, scale down during low-traffic periods, and avoid the depreciation cycle of hardware that is obsolete before it is fully amortized.

Architecture Patterns

Cloud Mirth deployments fall into three patterns, each appropriate for different use cases:

Pattern 1: Single Instance (Development / Test)

One Mirth Connect instance on a cloud VM or container, with a managed database. Simple, inexpensive, and appropriate for development environments, proof-of-concept deployments, and small organizations with low message volumes (under 1,000 messages per hour).

Pattern 2: Clustered Production

Multiple Mirth Connect instances behind a load balancer, sharing a managed database. Provides high availability and horizontal scalability. Appropriate for production deployments processing 1,000 to 50,000+ messages per hour. This is the most common production architecture.

Pattern 3: Fully Managed / Kubernetes

Mirth deployed as containerized workloads on Kubernetes (EKS, AKS, or self-managed). Provides maximum scalability, automated recovery, and infrastructure-as-code deployment. Appropriate for organizations with existing Kubernetes expertise and large-scale integration platforms.

AWS Deployment

AWS is the most common cloud platform for healthcare integration, offering a mature ecosystem of HIPAA-eligible services.

EC2 Instance Sizing

# Recommended EC2 instance types for Mirth Connect:

Development / Test:
  t3.medium (2 vCPU, 4 GB RAM)    ~$30/month
  Handles: Up to 500 msg/hour, 5-10 channels

Small Production:
  m6i.large (2 vCPU, 8 GB RAM)    ~$70/month
  Handles: Up to 2,000 msg/hour, 20-30 channels

Medium Production:
  m6i.xlarge (4 vCPU, 16 GB RAM)  ~$140/month
  Handles: Up to 10,000 msg/hour, 50-100 channels

Large Production:
  m6i.2xlarge (8 vCPU, 32 GB RAM) ~$280/month
  Handles: Up to 30,000+ msg/hour, 100+ channels

# Key: Mirth is memory-intensive. Prioritize RAM over CPU.
# The Mirth JVM heap should be set to 60-70% of available RAM.

RDS PostgreSQL for Mirth Database

AWS RDS for PostgreSQL eliminates database management overhead. For production Mirth deployments, a db.m6g.large or db.m6g.xlarge instance provides adequate performance at approximately $200-$500 per month, depending on storage and IOPS requirements.

# RDS Configuration for Mirth Connect:

Instance: db.m6g.large (2 vCPU, 8 GB RAM)
Storage: 100 GB gp3 (3,000 IOPS baseline)
Multi-AZ: Enabled (automatic failover)
Encryption: Enabled (AES-256, AWS KMS)
Backup: 7-day automated backups
Maintenance: Weekly window (Sunday 3-4 AM)

# Connection string for Mirth:
# jdbc:postgresql://mirth-db.xxxxx.us-east-1.rds.amazonaws.com:5432/mirthdb

# IMPORTANT: Enable SSL for database connections
# Set database.url parameter to include ?ssl=true&sslmode=require

VPC and Security Groups

# VPC Architecture for Mirth Connect on AWS:

VPC: 10.0.0.0/16

Public Subnets (for ALB):
  10.0.1.0/24 (us-east-1a)
  10.0.2.0/24 (us-east-1b)

Private Subnets (for Mirth EC2/ECS):
  10.0.10.0/24 (us-east-1a)
  10.0.11.0/24 (us-east-1b)

Database Subnets (for RDS):
  10.0.20.0/24 (us-east-1a)
  10.0.21.0/24 (us-east-1b)

Security Groups:
  sg-alb: Inbound 443 from hospital VPN IPs only
  sg-mirth: Inbound 8443 from sg-alb, MLLP ports from VPN
  sg-rds: Inbound 5432 from sg-mirth only

# CRITICAL: Never expose Mirth admin (8443) to the internet
# CRITICAL: MLLP ports should only be accessible via VPN or Direct Connect

ECS/Fargate for Containerized Deployment

For organizations preferring containers over VMs, AWS ECS with Fargate provides serverless container execution:

# ECS Task Definition for Mirth Connect:

{
  "family": "mirth-connect",
  "networkMode": "awsvpc",
  "requiresCompatibilities": ["FARGATE"],
  "cpu": "2048",
  "memory": "8192",
  "containerDefinitions": [
    {
      "name": "mirth",
      "image": "nextgenhealthcare/connect:4.5.2",
      "portMappings": [
        {"containerPort": 8443, "protocol": "tcp"},
        {"containerPort": 6661, "protocol": "tcp"}
      ],
      "environment": [
        {"name": "DATABASE", "value": "postgres"},
        {"name": "DATABASE_URL", "value": "jdbc:postgresql://mirth-db.xxxxx.rds.amazonaws.com:5432/mirthdb"},
        {"name": "VMOPTIONS", "value": "-Xmx5g -Xms2g"}
      ],
      "secrets": [
        {"name": "DATABASE_USERNAME", "valueFrom": "arn:aws:ssm:...:mirth-db-user"},
        {"name": "DATABASE_PASSWORD", "valueFrom": "arn:aws:ssm:...:mirth-db-pass"}
      ],
      "healthCheck": {
        "command": ["CMD-SHELL", "curl -ks https://localhost:8443/api/server/status || exit 1"],
        "interval": 30,
        "timeout": 5,
        "retries": 3
      },
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/ecs/mirth-connect",
          "awslogs-region": "us-east-1",
          "awslogs-stream-prefix": "mirth"
        }
      }
    }
  ]
}

Azure Deployment

Azure offers comparable services for Mirth Connect deployment, with strong integration into Microsoft-centric healthcare IT environments.

VM Sizing on Azure

# Recommended Azure VM sizes for Mirth Connect:

Development / Test:
  Standard_B2s (2 vCPU, 4 GB RAM)     ~$35/month

Small Production:
  Standard_D2s_v5 (2 vCPU, 8 GB RAM)  ~$75/month

Medium Production:
  Standard_D4s_v5 (4 vCPU, 16 GB RAM) ~$150/month

Large Production:
  Standard_D8s_v5 (8 vCPU, 32 GB RAM) ~$300/month

Azure Database for PostgreSQL

Azure Database for PostgreSQL Flexible Server is the managed database option for Azure deployments. Configure with zone-redundant high availability for production workloads.

Azure Kubernetes Service (AKS)

For containerized Mirth on Azure, AKS provides managed Kubernetes with integrated monitoring via Azure Monitor and Container Insights.

Docker Deployment Fundamentals

Whether you deploy on AWS, Azure, or a local development machine, Docker is the foundation for containerized Mirth. The official nextgenhealthcare/connect image on Docker Hub provides a production-ready Mirth Connect container.

Docker Compose for Development

# docker-compose.yml - Development Mirth Connect
version: '3.8'
services:
  mirth:
    image: nextgenhealthcare/connect:4.5.2
    container_name: mirth-connect
    ports:
      - "8443:8443"    # Mirth Admin/API
      - "8080:8080"    # HTTP Listener
      - "6661:6661"    # MLLP Port 1
      - "6662:6662"    # MLLP Port 2
    environment:
      - DATABASE=postgres
      - DATABASE_URL=jdbc:postgresql://postgres:5432/mirthdb
      - DATABASE_USERNAME=mirth
      - DATABASE_PASSWORD=mirth
      - DATABASE_MAX_CONNECTIONS=20
      - VMOPTIONS=-Xmx4g -Xms1g
      - KEYSTORE_STOREPASS=changeme
      - KEYSTORE_KEYPASS=changeme
    volumes:
      - mirth-appdata:/opt/connect/appdata
      - mirth-custom-lib:/opt/connect/custom-lib
    depends_on:
      postgres:
        condition: service_healthy
    restart: unless-stopped

  postgres:
    image: postgres:15
    container_name: mirth-postgres
    environment:
      - POSTGRES_DB=mirthdb
      - POSTGRES_USER=mirth
      - POSTGRES_PASSWORD=mirth
    volumes:
      - mirth-pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U mirth -d mirthdb"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

volumes:
  mirth-appdata:
  mirth-custom-lib:
  mirth-pgdata:

Environment Variables Reference

# Essential environment variables for Mirth Docker container:

DATABASE              # Database type: postgres, mysql, sqlserver, oracle
DATABASE_URL          # JDBC connection string
DATABASE_USERNAME     # Database user
DATABASE_PASSWORD     # Database password
DATABASE_MAX_CONNECTIONS  # Connection pool size (default: 20)
VMOPTIONS             # JVM arguments (-Xmx, -Xms, GC options)
KEYSTORE_STOREPASS    # Keystore password for TLS
KEYSTORE_KEYPASS      # Key password for TLS
MIRTH_ADMIN_PASSWORD  # Override default admin password on first run

Kubernetes Deployment

StatefulSet Configuration

Mirth Connect should be deployed as a StatefulSet (not a Deployment) in Kubernetes because each instance maintains state in its appdata directory and requires stable network identities for channel configuration.

# mirth-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mirth-connect
  namespace: healthcare-integration
spec:
  serviceName: mirth-connect
  replicas: 2
  selector:
    matchLabels:
      app: mirth-connect
  template:
    metadata:
      labels:
        app: mirth-connect
    spec:
      containers:
      - name: mirth
        image: nextgenhealthcare/connect:4.5.2
        ports:
        - containerPort: 8443
          name: admin-api
        - containerPort: 6661
          name: mllp-1
        env:
        - name: DATABASE
          value: "postgres"
        - name: DATABASE_URL
          value: "jdbc:postgresql://mirth-db-svc:5432/mirthdb?ssl=true"
        - name: DATABASE_USERNAME
          valueFrom:
            secretKeyRef:
              name: mirth-db-credentials
              key: username
        - name: DATABASE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mirth-db-credentials
              key: password
        - name: VMOPTIONS
          value: "-Xmx5g -Xms2g -XX:+UseG1GC"
        resources:
          requests:
            memory: "6Gi"
            cpu: "1000m"
          limits:
            memory: "8Gi"
            cpu: "4000m"
        readinessProbe:
          exec:
            command:
            - /bin/sh
            - -c
            - "curl -ks https://localhost:8443/api/server/status"
          initialDelaySeconds: 60
          periodSeconds: 15
        livenessProbe:
          exec:
            command:
            - /bin/sh
            - -c
            - "curl -ks https://localhost:8443/api/server/status"
          initialDelaySeconds: 120
          periodSeconds: 30
        volumeMounts:
        - name: mirth-appdata
          mountPath: /opt/connect/appdata
  volumeClaimTemplates:
  - metadata:
      name: mirth-appdata
    spec:
      accessModes: ["ReadWriteOnce"]
      storageClassName: gp3
      resources:
        requests:
          storage: 50Gi

Health Checks and Horizontal Scaling

Configure readiness probes to ensure traffic is only sent to fully started Mirth instances (Mirth can take 60-120 seconds to start), and liveness probes to restart instances that become unresponsive. For horizontal scaling, use the Horizontal Pod Autoscaler based on CPU or custom metrics from Mirth monitoring endpoints.

Network and Security

TLS Termination

Terminate TLS at the load balancer or ingress controller, not at the Mirth instance. This simplifies certificate management (use AWS Certificate Manager or Azure Key Vault) and offloads TLS processing from the Mirth JVM. However, ensure internal traffic between the load balancer and Mirth instances is also encrypted, either via TLS or by running within a private network.

VPN and Private Connectivity

Hospital systems sending HL7 messages to the cloud via Mirth should connect via a VPN (AWS Site-to-Site VPN or Azure VPN Gateway) or dedicated connectivity (AWS Direct Connect or Azure ExpressRoute). MLLP traffic should never traverse the public internet unencrypted. For organizations transitioning from on-premises to the cloud, a hybrid architecture with VPN connectivity between on-premises and cloud Mirth instances is a common intermediate step.

No Public-Facing Mirth API

The Mirth Connect admin API (port 8443) should never be accessible from the internet. Restrict access to internal networks, VPN connections, and specific IP addresses. Use a bastion host or VPN for remote administration. This is not optional; it is a critical security requirement given recent Mirth CVEs that allowed unauthenticated remote code execution via the admin API.

HIPAA Compliance in the Cloud

Encryption Requirements

HIPAA requires encryption for Protected Health Information (PHI) both in transit and at rest:

  • In transit: TLS 1.2 or higher for all connections. This includes load balancer to Mirth, Mirth to database, Mirth to external systems, and MLLP connections (use MLLP over TLS).
  • At rest: Enable encryption on EBS volumes (AES-256), RDS storage encryption (AWS KMS), S3 bucket encryption for backups, and Kubernetes persistent volume encryption.

Access Logging

Enable comprehensive access logging: AWS CloudTrail for API calls, VPC Flow Logs for network traffic, RDS audit logging for database access, and Mirth Connect's built-in audit logging for message-level tracking. Retain logs for a minimum of 6 years per HIPAA requirements.

Business Associate Agreement (BAA)

Both AWS and Azure offer HIPAA Business Associate Agreements (BAAs) that cover their managed services. Ensure every cloud service used in your Mirth deployment is covered by the BAA. Services not covered by the BAA should not process or store PHI.

Performance in the Cloud

Instance Sizing Guidelines

Mirth Connect is memory-bound, not CPU-bound, for most workloads. The JVM heap size determines how many messages can be processed concurrently and how large the message queues can grow. Use the following as starting points and adjust based on performance monitoring data:

# Sizing formula (approximate):
# Base memory: 2 GB (Mirth + OS)
# Per active channel: 50-100 MB
# Per 1,000 queued messages: 100-200 MB
# Buffer: 20% headroom

# Example: 50 channels, 5,000 queued messages
# 2 GB + (50 * 75 MB) + (5 * 150 MB) + 20% buffer
# = 2 GB + 3.75 GB + 0.75 GB + 1.3 GB = ~8 GB RAM minimum

Database IOPS

Mirth's database performance directly affects message throughput. Every message processed involves multiple database writes (message content, metadata, status updates). For high-throughput deployments, provision dedicated IOPS (io2 on AWS, Premium SSD on Azure) rather than relying on burstable performance (gp3 baseline).

Network Latency

For MLLP connections from on-premise systems to cloud Mirth, network latency is critical. Each HL7 message requires a TCP connection, message send, and ACK response. At 50ms round-trip latency, you can process roughly 20 synchronous messages per second per connection. Use connection pooling and multiple MLLP channels for high-throughput interfaces where latency is a factor.

Cost Comparison

# Monthly Cost Comparison (Medium Production - 50 channels, 10K msg/hour):

On-Premise:
  Server hardware (amortized)  $500/month
  Database server (amortized)  $300/month
  Network equipment            $100/month
  Power / Cooling              $200/month
  Backup infrastructure        $150/month
  Staff time (20 hrs/month)    $3,000/month
  Total:                       ~$4,250/month

AWS:
  EC2 m6i.xlarge (Reserved 1yr) $100/month
  RDS db.m6g.large (Multi-AZ)   $350/month
  ALB                            $25/month
  EBS storage (200 GB gp3)       $20/month
  Data transfer                  $50/month
  CloudWatch                     $30/month
  VPN connection                 $40/month
  Staff time (8 hrs/month)       $1,200/month
  Total:                         ~$1,815/month

Azure:
  D4s_v5 VM (Reserved 1yr)      $110/month
  Azure DB PostgreSQL (HA)       $370/month
  Load Balancer                  $30/month
  Managed Disks (200 GB)         $25/month
  Data transfer                  $50/month
  Azure Monitor                  $35/month
  VPN Gateway                    $140/month
  Staff time (8 hrs/month)       $1,200/month
  Total:                         ~$1,960/month

Managed Service (Vendor-Hosted):
  Subscription                   $3,000-5,000/month
  Staff time (4 hrs/month)       $600/month
  Total:                         ~$3,600-5,600/month

The cloud options provide 50-60% cost savings over on-premise, primarily through reduced staff time (managed services eliminate database administration, backup management, and hardware maintenance) and elimination of capital expenditure. The managed service option costs more than self-managed cloud but requires the least internal expertise.

High Availability Architecture

Multi-AZ Deployment

Deploy Mirth instances across at least two Availability Zones. The load balancer routes traffic to healthy instances in either zone. If one zone fails, traffic automatically shifts to the surviving zone. RDS Multi-AZ provides automatic database failover with a typical recovery time of 60-120 seconds.

RTO and RPO Targets

# Typical Recovery Objectives for Healthcare Integration:

Component           RTO              RPO
---------           ---              ---
Mirth Application   5 minutes        0 (stateless with shared DB)
Database            2 minutes        0 (synchronous Multi-AZ)
Message Queues      5 minutes        1 minute (journal to DB)
Configuration       15 minutes       24 hours (daily config backup)
Full Environment    1 hour           1 hour (cross-region restore)

# RTO = Recovery Time Objective (max downtime)
# RPO = Recovery Point Objective (max data loss)

Monitoring in the Cloud

CloudWatch / Azure Monitor Integration

Forward Mirth Connect logs to the cloud provider's logging service for centralized analysis. Key metrics to monitor include: JVM heap usage (alert at 80%), message queue depth (alert at configurable threshold), channel error rates (alert on any sustained errors), database connection pool utilization (alert at 80%), and CPU/memory at the instance level.

Container Metrics

For Kubernetes deployments, use container-native monitoring (Prometheus + Grafana or cloud-native tools like Container Insights) to track pod resource usage, restart counts, and scaling events. Combine with Mirth-specific metrics from the admin API for a complete operational picture.

Disaster Recovery

Cross-Region Backup Strategy

Replicate database backups to a secondary region using RDS cross-region read replicas or automated snapshot copying. Store Mirth configuration exports (channel XML, code templates, global scripts) in S3/Azure Blob Storage with cross-region replication. Maintain infrastructure-as-code (Terraform, CloudFormation, or ARM templates) that can rebuild the entire Mirth environment in a secondary region within hours.

Testing DR Plans

Quarterly DR drills are essential. Simulate a region failure and verify that the team can restore the Mirth environment in the secondary region within the target RTO. Document the procedure, time each step, and identify bottlenecks. A DR plan that has never been tested is not a DR plan; it is a hope.

GCP vs AWS vs Azure for Mirth Connect: What Actually Differs

All three major clouds run Mirth Connect. The choice usually comes down to what your team already uses. But there are real architectural differences worth knowing before you design the deployment.

AWS defaults to persistent compute. EC2 or ECS Fargate keeps a container warm at all times — simple for MLLP channels, predictable cost, no scale-to-zero surprises. ELB handles HTTP load balancing. RDS PostgreSQL handles the backend. Most Mirth-on-AWS deployments follow this pattern and it works well.

Azure fits organizations in the Microsoft ecosystem. AKS or Container Apps with Azure Database for PostgreSQL Flexible Server (zone-redundant). Azure Health Data Services provides a managed FHIR store that Mirth can write to directly. Teams already using Azure AD, Teams, and Microsoft 365 get unified identity management across their Mirth deployment.

GCP's differentiator is Cloud Run's serverless model. Pay only for compute you actually use. Variable-load environments — busy during clinic hours, quiet overnight — can see 30–40% cost reduction compared to always-on EC2 instances. The catch is the MLLP constraint described below. GCP also has the strongest managed analytics story: BigQuery integration from the Healthcare API makes GCP the natural home if your clinical data pipeline ends in population health analytics or ML models.

For a full three-way comparison with cost modeling, see the AWS vs Azure vs GCP healthcare architecture guide.

The MLLP Problem with Cloud Run (And How to Solve It)

This is the issue that burns teams who move Mirth to Cloud Run without reading the docs carefully.

Cloud Run scales to zero by default — when there's no incoming HTTP traffic, GCP terminates all running instances to save cost. For Mirth channels that receive HL7 v2 over MLLP (persistent TCP connections on port 6661), a scaled-to-zero Cloud Run service cannot accept an incoming connection. The ADT feed from the hospital's EHR tries to connect, gets a TCP reset, and the message is lost or errors.

The fix is one deployment flag:

--min-instances 1

This keeps at least one instance warm at all times and accepts persistent MLLP connections. You pay for the idle compute, but it's a small fraction of a comparable EC2 instance.

HTTP-only Mirth channels — FHIR endpoints, REST APIs, webhook receivers — are fine with scale-to-zero. Only channels with MLLP listeners need --min-instances 1.

Containerizing Mirth Connect for Cloud Run

Mirth Connect runs on Java 17. The base image should be Eclipse Temurin JRE on a minimal Linux distro — not a full JDK, and not alpine if you hit Glibc compatibility issues with JDBC drivers.

FROM eclipse-temurin:17-jre-jammy
WORKDIR /opt/connect

# Copy Mirth installation (or OIE / BridgeLink fork)
COPY connect/ /opt/connect/
COPY custom-libs/ /opt/connect/custom-lib/

# Expose admin console, HTTPS, and MLLP
EXPOSE 8080 8443 6661

# Inject credentials via environment at runtime — never bake in image
ENV DATABASE_URL="" DATABASE_USER="" DATABASE_PASSWORD=""

CMD ["./mcserver", "-console"]

Build and push to Artifact Registry — not Docker Hub, which is outside your VPC perimeter:

gcloud auth configure-docker us-central1-docker.pkg.dev

docker build -t us-central1-docker.pkg.dev/PROJECT/healthcare/mirth:latest .
docker push us-central1-docker.pkg.dev/PROJECT/healthcare/mirth:latest

Tag images with the Mirth version number, not just latest. Cloud Run's revision history lets you roll back to a prior image, but only if you can identify which revision ran which version.

Cloud SQL PostgreSQL: HA Configuration for Production

Never use Mirth's embedded Derby database in production. It corrupts under concurrent load and has no backup capability worth using. Cloud SQL PostgreSQL 15 with Regional HA is the correct backend for any GCP Mirth deployment.

Regional HA gives you a primary instance and a standby in a different zone within the same region. Automatic failover happens within 60 seconds if the primary becomes unavailable. For a healthcare integration engine where message loss equals missed clinical events, that matters.

gcloud sql instances create mirth-db   --database-version=POSTGRES_15   --tier=db-custom-2-7680   --region=us-central1   --availability-type=REGIONAL   --backup-start-time=03:00   --enable-point-in-time-recovery   --network=projects/PROJECT/global/networks/healthcare-vpc   --no-assign-ip

--no-assign-ip is important — this gives the instance a private IP only. No public endpoint, no public exposure of your PHI database. Cloud Run connects via Cloud SQL Auth Proxy, which handles IAM authentication and encrypted tunneling automatically.

Sizing guidance: db-custom-2-7680 (2 vCPU, 7.5GB RAM) handles most mid-volume deployments up to a few hundred messages per second. If your channel count is high or you're processing large document payloads (MDM messages with Base64 PDFs), size up before go-live and check Cloud SQL's query insights for slow queries after the first week of production traffic.

Connection Pool Tuning

Mirth's default database connection pool is often too small for production. In mirth.properties, set:

database.max-connections=20

And on the Cloud SQL side, set max_connections to at least 2× your Mirth thread count. A Cloud Run instance with 2 vCPUs should not be hitting more than 10–15 concurrent database connections — if it is, something in your channel design is holding connections open longer than needed.

Secret Manager: Credentials Without Hardcoding

Database passwords, API keys, and keystore passwords should never be baked into a container image or stored in plain environment variables in the Cloud Run service definition. GCP Secret Manager solves this cleanly.

# Create the secret
echo -n 'your-db-password' | gcloud secrets create mirth-db-password --data-file=-

# Grant the Mirth service account access
gcloud secrets add-iam-policy-binding mirth-db-password   --member='serviceAccount:mirth-sa@PROJECT.iam.gserviceaccount.com'   --role='roles/secretmanager.secretAccessor'

Then reference secrets as environment variables in the Cloud Run deployment — GCP injects them at startup, and they never appear in deployment logs or service configurations visible to other team members.

Cloud Run Deployment: Full Production Command

gcloud run deploy mirth-connect   --image us-central1-docker.pkg.dev/PROJECT/healthcare/mirth:latest   --platform managed   --region us-central1   --min-instances 1   --max-instances 4   --memory 4Gi   --cpu 2   --concurrency 80   --timeout 300   --vpc-connector healthcare-connector   --vpc-egress all-traffic   --service-account mirth-sa@PROJECT.iam.gserviceaccount.com   --set-secrets DATABASE_PASSWORD=mirth-db-password:latest   --set-secrets DB_URL=mirth-db-url:latest   --no-allow-unauthenticated

Key flags explained:

  • --min-instances 1 — keeps one instance warm for MLLP connections
  • --max-instances 4 — caps horizontal scaling; Mirth's shared database state means aggressive scaling can cause contention
  • --memory 4Gi — Mirth needs headroom for message processing; 2Gi is the minimum, 4Gi is comfortable for most workloads
  • --vpc-connector — routes traffic through your VPC so Mirth can reach Cloud SQL private IP and on-prem systems over VPN
  • --vpc-egress all-traffic — ensures all outbound traffic (including Cloud SQL Auth Proxy) goes through the VPC
  • --no-allow-unauthenticated — blocks unauthenticated requests to the Mirth admin console

HIPAA Configuration on GCP: What's Required

GCP's HIPAA BAA covers the services this architecture uses: Cloud Run, Cloud SQL, Secret Manager, Cloud KMS, Cloud Storage, Artifact Registry, and Cloud Audit Logs. Signing the BAA is step one. Configuration is what actually makes the deployment HIPAA-eligible.

CMEK — Customer-Managed Encryption Keys

By default, GCP encrypts data at rest using Google-managed keys. HIPAA doesn't require CMEK, but it gives you control: you can revoke a key, rotate on your schedule, and provide evidence of key management to auditors. Enable CMEK for Cloud SQL and any Cloud Storage buckets used for message archiving.

VPC Service Controls

VPC Service Controls creates a security perimeter around your healthcare resources. Data can't be exfiltrated from Cloud SQL or Cloud Storage to resources outside the perimeter, even by a compromised service account. Configure the perimeter to include Cloud Run, Cloud SQL, Secret Manager, and Cloud Healthcare API if you're using it. This is the GCP equivalent of a network-level data loss prevention layer.

Cloud Audit Logs

Enable Admin Activity logs and Data Access logs on every service that touches PHI. Cloud Audit Logs are how you answer the HIPAA question "who accessed what, when" during an audit or breach investigation. Ship logs to a Cloud Logging sink with a long-term retention bucket in Cloud Storage — default log retention in Cloud Logging is 30 days, which is insufficient for HIPAA's 6-year retention requirement.

TLS on Every Channel

Cloud Run enforces HTTPS on its public endpoint. For MLLP channels connecting to on-prem systems via VPN, configure TLS 1.2+ in Mirth's TCP listener settings. No unencrypted HL7 in transit — this is a HIPAA Security Rule requirement, not a recommendation. See the Mirth Connect security hardening guide for the full configuration checklist.

Where GCP Healthcare API Fits Alongside Mirth Connect

A common misconception: GCP Healthcare API and Mirth Connect are alternatives. They're not. They cover different parts of the integration stack.

GCP Healthcare API provides managed storage for FHIR R4, DICOM, and HL7 v2 data — with built-in HIPAA controls, Pub/Sub notifications for event-driven architectures, and direct BigQuery export for analytics. What it doesn't do is transform data. It won't parse a non-standard HL7 message from a legacy lab system, apply business routing rules, or handle the kind of conditional logic that real-world EHR integrations require.

Mirth Connect handles the transformation layer. A typical GCP architecture looks like this:

  • Hospital ADT feed → MLLP → Mirth (Cloud Run) → transform HL7 v2 to FHIR R4 → write to GCP Healthcare API FHIR store
  • GCP Healthcare API fires Pub/Sub notification on new Patient resource → Cloud Function → downstream analytics pipeline → BigQuery
  • FHIR store → SMART on FHIR app → patient-facing portal

Mirth does the heavy transformation. GCP Healthcare API does managed storage, search, and event emission. Both earn their place in the architecture.

Frequently Asked Questions

Can I use the free tier of AWS or Azure to run Mirth Connect?

For development and learning, yes. The AWS free tier includes a t2.micro instance (1 vCPU, 1 GB RAM) and a db.t3.micro RDS instance, which can run Mirth Connect with 2-3 channels and low message volume. This is suitable for training new engineers or prototyping integrations. It is not suitable for any production workload. Production Mirth requires at least 4 GB of RAM for the JVM, and the database needs adequate IOPS for message persistence.

How do I migrate existing channels from on-premise Mirth to cloud Mirth?

Export channels from the source Mirth instance via the admin API or Mirth Administrator (Channels > Export All Channels). Import into the cloud Mirth instance. Update connection parameters (database URLs, MLLP hostnames, file paths) to reflect the cloud environment. Test thoroughly in a staging environment before cutting over. For the database, use pg_dump/pg_restore to migrate the Mirth database if you need message history. For a clean start, deploy to a fresh database and re-import channels.

Is Docker or VM deployment better for production Mirth?

Both are viable for production. VM deployment is simpler, requires less specialized knowledge, and is a natural migration from on-premise. Docker/Kubernetes deployment provides better resource utilization, faster scaling, and infrastructure-as-code benefits but requires container orchestration expertise. If your team already operates Kubernetes, deploy Mirth on Kubernetes. If your team is new to containers, start with VMs and migrate to containers when the team is ready. The Mirth application itself runs identically in both environments.

What about Mirth Connect licensing in the cloud?

Mirth Connect is open source (MPL 2.0 license) and can be deployed in any cloud environment without licensing fees from NextGen Healthcare. The nextgenhealthcare/connect Docker image on Docker Hub is the official distribution. If you need commercial support, NextGen offers support contracts that cover cloud deployments. The license does not change based on deployment target: on-premise, cloud VM, and containerized deployments all use the same open-source license.

How do I handle MLLP connections from on-premise systems to cloud Mirth?

MLLP traffic must be secured in transit. The recommended approaches are: 

(1) AWS Site-to-Site VPN or Azure VPN Gateway, establishing an encrypted tunnel between your on-premises network and the cloud VPC. MLLP traffic flows through the tunnel without modification. 

(2) MLLP over TLS (also called Secure MLLP), where the Mirth source connector is configured for TLS, and the sending system supports TLS-wrapped MLLP. 

(3) AWS Direct Connect or Azure ExpressRoute for dedicated, private connectivity. Never send unencrypted MLLP traffic over the public internet, as this violates HIPAA transmission security requirements.

The Bottom Line

Moving Mirth Connect to the cloud is not just an infrastructure decision; it is a reliability and scalability decision. Cloud deployment reduces the operational burden of maintaining high availability, simplifies disaster recovery, and provides the elasticity to handle growing message volumes without hardware procurement cycles.

Start with Docker Compose for development and testing. Graduate to a managed VM or ECS/AKS deployment for production. Use managed databases (RDS, Azure Database for PostgreSQL) to eliminate database administration overhead. Implement proper network security with VPN connectivity and never expose the Mirth admin API to the internet.

The cloud does not eliminate the need for monitoring, performance tuning, or operational expertise. But it does let your team focus on what matters most: building and maintaining the integrations that move patient data reliably between systems, rather than managing the infrastructure underneath.

Related guides

This article is part of our complete guide to Mirth Connect: what Mirth Connect actually does. Related deep-dives:

  • automated testing for Mirth channels
  • running Mirth Connect locally
  • calling HTTP APIs from Mirth Connect

Need production-grade Mirth Connect help? See our Mirth Connect integration services.

Ready to scale?

Talk to our healthcare engineering team about building, integrating, and shipping faster.

Frequently Asked Questions

Can I use the free tier of AWS or Azure to run Mirth Connect?

For development and learning, yes. The AWS free tier includes a t2.micro instance (1 vCPU, 1 GB RAM) and a db.t3.micro RDS instance, which can run Mirth Connect with 2-3 channels and low message volume. This is suitable for training new engineers or prototyping integrations. It is not suitable for any production workload. Production Mirth requires at least 4 GB of RAM for the JVM, and the database needs adequate IOPS for message persistence.

How do I migrate existing channels from on-premise Mirth to cloud Mirth?

Export channels from the source Mirth instance via the admin API or Mirth Administrator (Channels > Export All Channels). Import into the cloud Mirth instance. Update connection parameters (database URLs, MLLP hostnames, file paths) to reflect the cloud environment. Test thoroughly in a staging environment before cutting over. For the database, use pg_dump/pg_restore to migrate the Mirth database if you need message history. For a clean start, deploy to a fresh database and re-import channels.

Is Docker or VM deployment better for production Mirth?

Both are viable for production. VM deployment is simpler, requires less specialized knowledge, and is a natural migration from on-premise. Docker/Kubernetes deployment provides better resource utilization, faster scaling, and infrastructure-as-code benefits but requires container orchestration expertise. If your team already operates Kubernetes, deploy Mirth on Kubernetes. If your team is new to containers, start with VMs and migrate to containers when the team is ready. The Mirth application itself runs identically in both environments.

What about Mirth Connect licensing in the cloud?

Mirth Connect is open source (MPL 2.0 license) and can be deployed in any cloud environment without licensing fees from NextGen Healthcare. The nextgenhealthcare/connect Docker image on Docker Hub is the official distribution. If you need commercial support, NextGen offers support contracts that cover cloud deployments. The license does not change based on deployment target: on-premise, cloud VM, and containerized deployments all use the same open-source license.

How do I handle MLLP connections from on-premise systems to cloud Mirth?

MLLP traffic must be secured in transit. The recommended approaches are:  (1) AWS Site-to-Site VPN or Azure VPN Gateway, establishing an encrypted tunnel between your on-premises network and the cloud VPC. MLLP traffic flows through the tunnel without modification.  (2) MLLP over TLS (also called Secure MLLP), where the Mirth source connector is configured for TLS, and the sending system supports TLS-wrapped MLLP.  (3) AWS Direct Connect or Azure ExpressRoute for dedicated, private connectivity. Never send unencrypted MLLP traffic over the public internet, as this violates HIPAA transmission security requirements.

How does Nirmitee.io approach healthcare software development?

Nirmitee.io follows a healthcare-first engineering approach — every solution is built with HIPAA compliance, HL7/FHIR interoperability standards, and clinical workflow requirements at the core. We combine domain expertise with modern engineering practices to deliver production-ready systems.

Why does Cloud Run need --min-instances 1 for Mirth Connect MLLP channels?

Cloud Run scales to zero by default — instances terminate when there's no incoming HTTP traffic. For Mirth channels that use MLLP (persistent TCP connections on port 6661), a scaled-to-zero service cannot accept incoming connections from hospital ADT systems. Setting --min-instances 1 keeps one instance warm at all times. HTTP-only Mirth channels can safely scale to zero, reducing cost during low-traffic periods.

How do I connect Cloud Run to Cloud SQL without a public database IP?

Use Cloud SQL Auth Proxy as a sidecar container or the built-in Cloud Run integration. Configure Cloud SQL with --no-assign-ip to give it a private IP only. In the Cloud Run service, add the Cloud SQL connection using --add-cloudsql-instances, which automatically starts the Auth Proxy. The proxy handles IAM authentication and encrypted tunneling. Your Mirth mirth.properties points to 127.0.0.1:5432 (the local proxy socket) rather than the database IP directly.

What GCP services must be included in the HIPAA BAA for a Mirth Connect deployment?

GCP's HIPAA BAA covers: Cloud Run, Cloud SQL, Secret Manager, Cloud KMS, Cloud Storage, Artifact Registry, Cloud Logging, Cloud Monitoring, and the Healthcare API. To be HIPAA-eligible you must also: enable Cloud Audit Logs (Admin Activity and Data Access) on every service touching PHI, configure CMEK via Cloud KMS for Cloud SQL and storage, and set up VPC Service Controls to create a security perimeter. Signing the BAA alone does not make the deployment compliant — the configuration does.

Does GCP Healthcare API replace Mirth Connect?

No — they serve different functions. GCP Healthcare API provides managed FHIR R4, DICOM, and HL7 v2 storage with Pub/Sub event notifications and BigQuery export. It does not transform data or apply business routing rules. Mirth Connect handles the transformation layer: parsing non-standard HL7, applying conditional routing logic, and writing results to Healthcare API FHIR stores. In a well-designed GCP architecture, Mirth and Healthcare API are used together, not as alternatives.

How much memory should a Cloud Run Mirth Connect instance have?

Minimum 2Gi, recommended 4Gi for production workloads. Mirth runs on the JVM and processes messages in heap memory. Channels handling large payloads like MDM Base64 PDFs or C-CDA documents need more headroom. Set the JVM heap in mcserver.vmoptions to about 75% of the Cloud Run memory allocation: for a 4Gi instance, -Xms2g -Xmx3g is a good starting point. Monitor heap utilization via Cloud Monitoring and adjust before OOM restarts happen in production.

What is the recommended Cloud SQL tier for Mirth Connect on GCP?

db-custom-2-7680 (2 vCPU, 7.5GB RAM) handles most mid-volume deployments up to a few hundred HL7 messages per second. For deployments with more than 50 active channels or large document payloads, move to db-custom-4-15360. Always use Regional HA (--availability-type=REGIONAL) for production — this places a standby in a different zone with automatic failover in under 60 seconds. Check Cloud SQL Query Insights in the first week of production to identify slow queries early.
Share