OpenEMR production deployment with Docker Compose: when the container route fits
A practice or IT team that wants reproducible OpenEMR deployments inside its own infrastructure can use the official Docker image with a production Compose file, which is one supported route to that goal. The image handles much of the first-run work through auto-install variables, keeps site data in a persistent sites directory, exposes database SSL flags such as FORCE_DATABASE_SSL_CONNECT and FORCE_DATABASE_X509_CONNECT, and, from 8.4.0, runs lifecycle hook scripts mounted as run-parts-compatible volumes. The team keeps the rest: the Docker host, TLS termination, the database service, backups and every upgrade decision. Only the sites directory persists across container recreation, so the database, the sites volume and the certificates must each have a backup and restore path that the team has tested before go-live.
Recent OpenEMR releases require PHP 8.3 or later and run on a MySQL- or MariaDB-compatible database, so the team should confirm which database engine and version it will operate before choosing the container route. The Compose file pins the application to a specific image tag, and the team should pin dated tags rather than floating ones so that every rebuild uses a version it has tested. The project's OpenEMR releases page lists the version history and the security fixes in each release, which is the right place to check before choosing a tag. The project also offers other Docker deployment options, so teams should compare them against the production Compose file before committing.
The container route fits best when the organization already runs container hosts, has someone who can operate them, and wants infrastructure it can rebuild from code. It fits less well when the team has no container operations experience, expects to run several web nodes behind a load balancer, or wants a managed database and storage layer from a cloud provider. Before deciding, confirm the following in writing with whoever will own the host: who patches the operating system and the Docker engine, where the sites volume lives and how it is backed up, how TLS certificates are issued and renewed, and which team approves each image upgrade. Those answers determine whether the container route is a stable operating model or a single point of failure.
Docker configuration options and when each one fits
This table compares the main Docker Compose decisions for OpenEMR production: tag pinning, auto-install, the database container, TLS placement and the database SSL flags. Read each row for the conditions that favor it, what it commits your team to, and what to confirm in the official image documentation before you rely on it.
| Decision | When it fits | What it commits the team to | What to confirm first |
|---|---|---|---|
| Pinned dated image tag | Production systems where upgrades are planned, tested and recorded | Someone must review each release, test it in staging and change the tag deliberately | The exact tag exists on Docker Hub and matches the release notes for the version you plan to run |
| Floating tag such as a major version alias | Non-production test environments where you want the newest build automatically | Upgrades can change behavior between restarts, so recreation of containers becomes a change event | Which tags the project publishes and how each one is updated |
| Auto-install variables | Repeatable builds where the first start should create the database schema and admin account without a browser session | Secrets such as the admin password must be supplied through a secure channel and removed from the compose file afterward | Which variables the current image reads and whether the setup scripts still need to be locked down afterward |
| Manual setup wizard | Small installs where a person is present to complete setup and choose options interactively | Post-install steps such as removing setup scripts must be checked by hand each time a site is built | Whether the wizard still runs on the image version you select |
| Bundled database container | Evaluation, lab or small single-host installs where one team runs the whole stack | You own database backups, patching, storage volumes and restore testing inside the same host | Database engine version compatibility with the release you plan to run (MariaDB or MySQL per the release notes) |
| External managed or self-run database | Production systems with separate database operations, replication or a cloud database service | Network paths, credentials, TLS and backup ownership sit with the database side and must be documented | Supported engine and version, character set and privilege requirements in the OpenEMR installation notes |
| TLS terminated at a reverse proxy | Sites that already run a managed proxy or load balancer with certificate automation | Proxy configuration, certificate renewal and limiting exposure to port 443 become your responsibility | How forwarded headers are handled and which proxy settings the OpenEMR documentation expects |
| TLS terminated inside the stack | Deployments that need encryption up to the application container, or single-host setups without a separate proxy | Certificate handling, renewal such as Let's Encrypt, and container-level configuration are maintained in compose | Which certificate options the image supports and how renewal is triggered |
| FORCE_DATABASE_SSL_CONNECT set to 1 | Deployments where the database connection must be encrypted, from release 7.0.1 onward | The database server must offer TLS, and certificates must be valid for the connection | Whether your database accepts TLS for the connecting account and that the flag is supported in your release |
| FORCE_DATABASE_X509_CONNECT set to 1 | Deployments that require the database to verify client certificates as well | Client certificate issuance, distribution and rotation must be run and monitored | Certificate file locations, mounts and the exact requirements in the image documentation |
How the OpenEMR container, sites volume and database connect
The diagram starts with users reaching a TLS-terminating reverse proxy on port 443, which is the only public entry point. The proxy forwards requests to the OpenEMR container, which reads its configuration and writes site data to a persistent sites volume, and loads lifecycle hook scripts from a separate hooks volume. The container connects to an external database over an encrypted connection. Check that only the proxy is exposed, that the sites volume and database hold patient data, and that the database link is encrypted end to end.
Trust boundaries between users, the proxy, the container, volumes and the database.
Pinning dated image tags and planning upgrades
A production team should pin an exact dated image tag, not a floating tag such as latest, because a floating tag changes what runs the next time a container is pulled or recreated. Pinning makes the running version a decision you made and recorded, so a restart or a compose pull cannot quietly move a clinical system to a new release. The release history shows why this matters: OpenEMR 8.3.0 was released on August 18, 2026, 8.4.0 on September 13, 2026 and 8.4.1 on September 20, 2026, and both 8.4.0 and 8.3.0 fixed security vulnerabilities in the FHIR APIs, the patient portal, billing, the fax and SMS module and the fee sheet. A team on a floating tag may receive those fixes without a test window, and may also receive behavior changes at the same moment. Record the exact tag in the compose file's image line, in version control, and tie each change to a change ticket that names the release notes you reviewed.
Treat each new release as a managed change with a staging step before production. Deploy the candidate tag to a copy of production: restore a recent backup of the database and the sites volume into a separate stack, start it with the same environment file, and confirm that login, SSO, scheduling, billing, the patient portal and any interfaces work as they do today. Review the release notes and security advisories for the tag and check the PHP and database requirements against your current stack, since recent releases require PHP 8.3 or later and a MySQL- or MariaDB-compatible database. Confirm with your own team how long the staging run must last and who signs off, because those decisions depend on your clinical and compliance obligations and are not fixed by the project.
Only after staging passes should production move to the new tag, and the rollback plan should be written before that change starts. Keep the previous tag and a verified backup of both the database and the sites volume, since the sites directory is the state that persists across container recreation. The full upgrade path, including version-specific steps, database and PHP requirements, and how Docker and multisite installs are handled, is covered on the OpenEMR upgrades topic, so this section does not repeat those steps. Plan for security releases as a standing workflow with a defined response window, not as occasional projects, and ask your support provider to confirm how they track advisories for the tags you run.
Choosing the database connection mode
When the database container sits on the same private Docker network as the OpenEMR container and no traffic leaves that network, the simplest setup leaves the database encryption flags unset. Only the containers attached to that network can reach the database port, and you do not publish it to the host. This keeps the database off any routed path, which is the main control here. It does not by itself encrypt the traffic between the two containers, so your risk review should record that choice explicitly.
- Network scope: Attach only the OpenEMR and database services to the internal network, and do not publish the database port.
- No force flags: Leave
FORCE_DATABASE_SSL_CONNECTandFORCE_DATABASE_X509_CONNECTunset or set to 0. - Credentials: Give the application database user only the privileges it needs, and store the password in a secret rather than in the compose file.
- Host exposure: Confirm with
docker psthat no database port is mapped to the host interface. - Review trigger: Revisit this choice if the database moves to another host, another network segment or a managed service.
Confirm your own network policy and whether your compliance team accepts unencrypted intra-host traffic before you go live.
When OpenEMR reaches the database across a network boundary, such as another host, a separate VLAN or a managed database endpoint, set FORCE_DATABASE_SSL_CONNECT to 1. From 7.0.1 onward, this forces encrypted database connections, so OpenEMR will not fall back to plaintext if TLS is unavailable. The database server must already offer TLS with a valid server certificate, and the connection will fail if it does not.
- Flag behavior: Set
FORCE_DATABASE_SSL_CONNECTto 1 and treat a failed connection as a configuration fault to fix, not a reason to remove the flag. - Server TLS: Enable TLS on the MariaDB or MySQL server and confirm the certificate chain is trusted by the OpenEMR container.
- Certificate trust: Mount the CA certificate into the container and confirm the path the image expects in the official image documentation on Docker Hub.
- Version check: Confirm the database version and its TLS settings against the server documentation for your engine and version.
- Testing: After a restart, check that OpenEMR loads and that the connection is encrypted, for example by querying the session status on the database side.
Confirm the certificate paths, the database version and the server TLS settings in your own environment before you rely on this mode.
When policy requires the database to verify who is connecting, not only encrypt the channel, set FORCE_DATABASE_X509_CONNECT to 1. This requires the OpenEMR container to present a client certificate that the database trusts, in addition to validating the server certificate. Use this mode when your security team wants certificate-based identity on the database connection and can manage the certificate lifecycle.
- Client identity: Issue a client certificate for the OpenEMR application account and mount its key and certificate into the container with restricted file permissions.
- Server requirement: Configure the database user to require a valid X.509 certificate so that password-only logins are refused for that account.
- Rotation: Plan renewal and rotation before expiry, and test a rotation in a non-production copy, since an expired client certificate stops the application from connecting.
- Key storage: Keep the private key out of images and version control, and limit read access to the container user.
- Logging: Record certificate issuance and revocation in your change log so an auditor can trace access.
Confirm the certificate paths, the database version and the MariaDB or MySQL server settings for requiring X.509 in your own environment, and test the failure path before go-live.
Moving an existing XAMPP or bare-metal install into Docker
Treat the move from a XAMPP or bare-metal OpenEMR install to the official production Compose file as a planned change with a rollback path, not a simple container swap. The compose file is the target, and the key fact for the migration team is that only the sites directory persists across container recreation. Before any docker compose up that recreates containers, copy the sites directory out of the old installation, confirm the copy is complete and readable, and keep the original server intact until the new stack has been verified. If the new stack fails, the old install is the rollback.
Check three things before cutover. First, the database: export the existing OpenEMR database, import it into the database the new stack will use, and confirm the connection settings and the database user's privileges match what the compose file expects. Second, file ownership on the sites directory: the files must be owned by the user the container runs as, so that OpenEMR can read its configuration and write documents and logs. Mismatched ownership is a common cause of a container that starts but cannot save records or uploads. Third, setup scripts: remove setup.php and other admin scripts once the move is complete, as the Securing OpenEMR guide advises for any installation, and confirm that direct web access to sites/*/documents is blocked in the new front end.
The XAMPP to Docker migration wiki page is the next read and should be followed step by step against your own environment. Confirm the exact sites directory path, database version and PHP requirements for your target release with the release notes before you start, since recent releases require PHP 8.3 or later. Record the rollback steps in writing, name who approves the cutover, and test login, a patient record save and a document upload on the new stack before the old server is retired.
Setup sequence for a production compose stack
This sequence takes a host from bare Linux to a pinned OpenEMR release that runs behind HTTPS, keeps its data in a persistent sites volume, and connects to its database over an encrypted channel. Each step closes with a check so the operator knows the layer is ready before the next one depends on it.
Prepare the host and DNS
The operations team builds a Linux host in infrastructure you control, installs Docker Engine and the Compose plugin, and creates a DNS record that points the chosen hostname at the host's address. Inbound rules should allow ports 80 and 443 for the proxy and close everything else, including the database port. Confirm the record resolves from outside your network and that an external scan shows only 80 and 443 open before continuing.
Choose and pin the image tag
Pick an explicit OpenEMR release tag from the official Docker Hub listing and write it into the compose file. Avoid floating tags such as latest, so that a restart never pulls a different release. Use 8.4.0 or later if you plan to mount lifecycle hook scripts. Read the release notes for the tag you choose, including any security fixes, and confirm the tag exists on Docker Hub. The check is a compose config render that shows the exact tag and no unversioned image reference.
Provision the database and credentials
The database administrator creates a MariaDB or MySQL-compatible server, a dedicated schema, and an application account limited to that schema. Store the passwords in an environment file or a secrets store outside the repository and restrict who can read them. Enable TLS on the database server so the application has an encrypted channel to use. The check is a login from a separate client with the application account over an encrypted connection, plus a failed login with a wrong password.
Set auto-install variables and SSL flags
Set the auto-install variables listed on the image's Docker Hub page so the first start creates the database schema and the initial administrator. Set FORCE_DATABASE_SSL_CONNECT to 1 so the application refuses unencrypted database connections, which the project supports from 7.0.1 onward. If you use client certificates, use the X.509 variant instead and mount the certificate files. The check is a container log that reports a completed installation, followed by
SHOW STATUS LIKE 'Ssl_cipher';from the application session returning a non-empty cipher.Mount the sites and hooks volumes
Mount a persistent volume on the sites directory, since it holds site configuration, documents and other state that must survive container recreation. Mount the lifecycle hook directory as a read-only volume containing run-parts-compatible scripts, which the 8.4.0 image supports. Keep the hook scripts under version control so changes are reviewed. The check is to write a marker file under the sites volume, run
docker compose up -d --force-recreate, and confirm the file is still present and that a hook script's output appears in the container logs.Front the container with a TLS proxy
Place a reverse proxy in front of the OpenEMR container to terminate TLS and request Let's Encrypt certificates for the hostname. Redirect HTTP to HTTPS, publish only the proxy's ports to the outside, and configure the proxy to deny direct web requests to the sites documents path. The Securing OpenEMR guide recommends allowing only HTTPS and considering port 443 alone. The check is that a request to the HTTP address returns only a redirect, the HTTPS endpoint presents a valid certificate chain, and a request to a sites documents URL is denied.
Start the stack and run first-login checks
Run
docker compose up -dand wait for the application container to report healthy. Sign in as the initial administrator, change the password, enroll multi-factor authentication, and review the password policy in the administration settings. Confirm that the setup script and other admin scripts are no longer reachable, as the Securing OpenEMR guide advises after installation. The check is a successful login with MFA, a not-found response for setup.php, and an audit of the administrator account list that shows only named, expected users.
Security controls the container stack needs in place
The Securing OpenEMR guide sets the baseline for a production install, and the container stack adds its own exposure points. Each card below is one control the team should configure and then check from outside the stack, not assume from the compose file.
Serve only HTTPS on port 443
The Securing OpenEMR guide says to allow only HTTPS and to consider exposing only port 443. In a Compose deployment, publish only the TLS listener from the reverse proxy or web container, and confirm that plain HTTP redirects or is refused. Check the published ports with docker compose ps and scan the host from outside your network to confirm nothing else answers.
Remove setup scripts after installation
The guide says to remove setup.php and other admin scripts once installation is complete. Your image or volume mounts may expose these paths again after a container recreation, so the removal is not permanent. Request the setup and admin script paths from outside the stack after each deploy and confirm they return not found.
Block direct access to patient documents
Uploaded patient documents live under sites/*/documents on the persistent sites volume. The guide says to block direct web access to that path, so a guessed URL cannot return a file without an authenticated session. Test with an unauthenticated request for a known document path, and confirm the web server returns a denial rather than the file.
Enforce multi-factor and strong passwords
The guide recommends multi-factor authentication and a strong password policy, and OpenEMR 6.0.0 added length limits, a four-character-type rule, reuse prevention and expiration settings. Set these in the Administration Globals before users are onboarded, and test a login from a new session to confirm the second factor is requested. Record which accounts are exempt, such as break-glass accounts.
- Prior passwords blocked
- 5
Restrict the upload file white list
The guide points to the upload file white list, which limits the file types users can attach to the chart. Review the list against what the clinic actually needs, removing executable and script types, and then upload a permitted and a blocked file as a test. Keep the same list in the change record so a future image update does not silently widen it.
Encrypt stored items on drive
The guide notes an option to encrypt items stored on drive. Decide whether documents on the sites volume need this control, given that the volume also holds configuration and the encryption key location must be protected. Confirm with the vendor how keys are generated and backed up, then verify by reading a stored document from the host file system and confirming it is not readable as plain content.
Keep the database off public networks
The database should sit on an internal Docker network that the web container can reach and nothing outside the host can. Do not publish the database port in the compose file. Enable the database SSL or X.509 forcing flags so connections between containers are encrypted, then confirm from outside the stack that the database port is closed.
- SSL flag introduced
- 7.0.1
What buyers ask before running OpenEMR on Docker in production
How much effort does a production OpenEMR Docker deployment take, and who does the work?
Effort depends on how much of the stack is new to your team and how much existing data must move in. A production build covers the host and container runtime, the official image pinned to a dated tag, the persistent sites volume, TLS through Let's Encrypt, database connection settings, backups, monitoring and a tested upgrade procedure. Your team provides the infrastructure, accounts, DNS and the people who approve changes. A partner such as DeployOpen can plan, build, document and hand over the work under a written scope, while your staff keep ownership of the environment and the clinical decisions about configuration.
Can our team run the Docker stack ourselves after the first deployment?
Often yes, if someone on the team is comfortable with Linux, containers, DNS, certificates and database administration, and if that person has written runbooks to follow. The parts that most often go wrong are not the first install but the later steps: recreating containers without the sites volume, upgrading across major versions, rotating certificates and restoring from backup. Ask whether your team has tested a restore and a version upgrade in a non-production copy. If not, a handover with documented procedures and a test restore is worth scoping before you go live.
What does our organization need to provide before the work starts?
Plan to provide the following before work begins:
- A host or cloud account in an environment you control, with sizing agreed against your user count and data volume
- A database that is MySQL- or MariaDB-compatible, since recent OpenEMR releases require PHP 8.3 or later and run on that database family
- DNS records for the public hostname and access to the certificate process
- A named owner for backups, restore testing and upgrades, with authority to approve maintenance windows
Confirm the exact PHP and database versions against the release notes for the version you plan to run.
How long does a first OpenEMR Docker deployment take?
The duration depends on scope rather than on Docker itself. A clean install with no data migration and no integrations is a much smaller job than moving an existing XAMPP or legacy install into containers, reconciling data, connecting an identity provider, configuring SSL to the database and testing billing or patient portal workflows. Ask any provider for a written timeline that lists the migration volume, each integration, the test cycles and the cutover window, and that names what your team must do in each phase. No general duration can be stated without that scope.
What drives the cost of a production OpenEMR Docker engagement?
The cost follows the scope agreed in writing. The main drivers are the amount of data to migrate and validate, the number and complexity of integrations such as single sign-on, interfaces or the FHIR API, the testing you require, including security testing and restore drills, and whether you want ongoing support or upgrades under a retainer. Hosting, licenses for any paid components you choose, and your staff time are separate costs. OpenEMR itself is free and open source under the GNU GPL v3.0, so the cost lies in the people and infrastructure around it. Ask for a quote that separates one-time build work from recurring support, and that states what is excluded.
Does running OpenEMR in Docker make our deployment HIPAA compliant or certified?
No. There is no HIPAA certification, and the HHS states that no Security Rule standard requires an entity to certify compliance. The HIPAA Security Rule applies to covered entities, which are health plans, health care clearinghouses and covered health care providers, and to their business associates, for all electronic protected health information they create, receive, maintain or transmit. A Docker image is a packaging choice, not a compliance status. Your compliance depends on your risk analysis, safeguards, policies, and the business associate contract, which under 45 CFR 164.314 must require the business associate to comply with the Security Rule, flow the same terms to subcontractors that handle ePHI, and report security incidents. Independent auditors and certification bodies, not DeployOpen, issue any formal assessment results.
Limits to confirm in your environment
The Docker Compose route depends on details that change between releases, images and regulatory cycles. Each card below is an item to verify against the release notes, the Docker Hub page and your own compliance counsel before the design is signed off.
PHP and database versions per tag
Recent OpenEMR releases require PHP 8.3 or later and run on a MySQL- or MariaDB-compatible database. The exact PHP and database versions the image bundles, and the minimum server versions for the tag you pin, are what you must confirm, because they decide whether your database host can run the release at all. Check the release notes for the tag and the image description on Docker Hub, and record both in your change plan.
- Required PHP line
- 8.3+
Database engine and version support
Confirm that the MySQL or MariaDB engine and version you intend to run are on the support list for the specific OpenEMR release you pin. Database lifecycles run on their own schedule, so a version that is current for your database team may be unsupported for the application. Also confirm which SSL options the engine accepts, since the database SSL flags depend on the server configuration.
MariaDB releasesLifecycle hook behavior in your image
Lifecycle hook scripts mounted as run-parts-compatible volumes are available in production images from 8.4.0. Confirm the exact mount path, the execution order, whether a failing script stops startup, and whether hooks run on every container start or only on first install in the image you pin. Test each hook against a copy of your sites volume before relying on it in production.
Sites volume backup method
Only the sites directory persists across container recreation, so it holds the configuration, documents and site-specific state you cannot rebuild from the image. Confirm your backup method, the frequency, the restore test and the encryption of backup copies, and make sure the database is captured at the same point in time. Restore the volume into a separate container to prove it works before go-live.
Community and paid support boundaries
OpenEMR has no paid edition of the software. Support comes from a volunteer and professional community, and the project lists professional support vendors on its wiki. Confirm with each option who answers security advisories, who owns Docker image updates and what response expectations, if any, are written into the contract. Your team, a support vendor and DeployOpen each carry a different share of that work.
Pending HIPAA Security Rule revision
HHS proposed a major Security Rule revision on January 6, 2025, and no final rule had been published as of October 2026. Confirm with your compliance counsel which proposed controls, if finalized, would change your encryption, logging, MFA, backup or contingency design, and whether your current risk analysis would need to be updated. Treat the proposal as a planning input, not a current requirement.
- Proposed rule date
- Jan 6, 2025
How DeployOpen scopes and delivers an OpenEMR Docker deployment
DeployOpen plans, builds, hardens, documents and supports self-hosted OpenEMR inside your own infrastructure, including the Docker Compose setup, its persistent sites volume and database connection settings. Engagements start from a written scope so the image tag, database, TLS and handover steps are agreed before any container runs in production.
How we scope
- Confirm the target OpenEMR release line and the dated image tag to pin before any build begins.
- Record the database platform, PHP version requirements and whether SSL or X.509 database connections will be enforced.
- Agree in writing which lifecycle hooks, auto-install variables and TLS certificate methods are in scope.
How we build
- Build the Compose stack with a persistent sites volume, then verify that only the sites directory survives container recreation.
- Apply the Securing OpenEMR guidance: HTTPS only, removal of setup scripts after install, and blocked web access to sites/*/documents.
- Test backups and restores of the database and sites volume, and run the upgrade path between pinned tags in a staging copy.
How we hand over
- Deliver the Compose files, environment settings and runbooks with each value documented and its owner named.
- Provide a verification record covering TLS, database encryption, authentication settings and file access controls.
- Walk your administrators through upgrades, patching after security releases and restore procedures before handover is closed.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer, scoped separately from the build.
- Plan patch application for security releases against your change windows and retest after each upgrade.
- Confirm with your compliance team which HIPAA or other obligations sit with your organization and which sit with the platform.

