How to upgrade OpenEMR running in Docker without losing site data
If your team runs OpenEMR in Docker and must move to a newer release, the work is an image tag change plus database and PHP checks. Only the sites/ directory persists across container recreation in the official Docker images, so everything your installation depends on outside sites/ has to be planned for before you replace the container. Teams often need this move for certification or security reasons, and both pressures are real for a system holding patient records. The OpenEMR website told users to upgrade to version 8 by March 1, 2026 to keep their system's active certification, which makes the major-line jump a deadline rather than a preference.
Moving between major lines needs a supported path, and the Docker images follow version-specific steps rather than one jump. Patch releases such as 8.4.1 follow a different route. The automatic upgrade in the official images covers the move between versions it is designed to handle, but it does not cover every patch. Confirm with the project's release notes which tags your current version can reach directly, and check the required PHP version (recent releases require PHP 8.3 or later) and database version before you change the tag. Treat the automatic upgrade as a starting point for your checks, not as a guarantee that your installation is current.
Delay has a cost that is easy to underestimate. OpenEMR 8.3.0 and 8.4.0 fixed security vulnerabilities in the FHIR APIs, the patient portal, billing, the fax and SMS module and the fee sheet, and 8.4.1 followed on September 20, 2026. A team still on an older image is exposed to those fixes being public. Before you start, take a full backup of the database and the sites/ directory, record every module or edit you have placed outside sites/, and confirm with your vendor or the project which of those must be reinstalled after the new container starts.
What changes between OpenEMR Docker releases and what each change requires
This table lists the release changes in the supplied OpenEMR facts that affect a Docker image upgrade, with the impact of each and the action to take before or during the tag change. Read it against the release notes for your target tag, because minimum database and PHP versions must be confirmed there before you change anything.
| Change | Impact | Action needed |
|---|---|---|
| 8.x line requires PHP 8.3 or later | Upgrading to any 8.x tag moves the PHP runtime to 8.3 or later, which the container image must provide. Custom code written for older PHP may fail. | Confirm the PHP version in the target tag's release notes. Test custom modules and forms on that PHP version in staging first. |
| Recent releases run on MySQL or MariaDB compatible databases | The database server must be a compatible version for the target release. Upgrading the image alone may not be enough if the database is older than the new minimum. | Confirm the exact minimum MySQL or MariaDB version for your target tag in its release notes. Plan the database upgrade before the image change. |
| 8.4.0 and 8.3.0 fixed security issues in the FHIR API | Systems running earlier releases with FHIR enabled carry known fixed vulnerabilities. Delay extends exposure. | Move to the fixed release line, then confirm FHIR access settings and API client scopes after the change. |
| 8.4.0 and 8.3.0 fixed security issues in the patient portal | Portal exposure to patients makes unpatched flaws reachable from outside the network. | Upgrade the portal-facing deployment promptly and retest patient login and document access. |
| 8.4.0 and 8.3.0 fixed security issues in billing and the fee sheet | Billing data and claim workflows were affected, so unpatched systems may hold records that were exposed. | Upgrade, review billing user access, and test claim creation and fee sheet saves. |
| 8.4.0 and 8.3.0 fixed security issues in the fax and SMS module | Messaging features that send or receive outside the system carry data exposure risk if left unpatched. | Upgrade, then test fax and SMS sending and confirm provider credentials are stored correctly. |
| Only sites/ persists across container recreation | Modules and files installed elsewhere in the webroot are lost when the container is recreated with a new tag. | Inventory non-sites files before upgrading. Reinstall them, or move them into a custom image or bind mount, and retest. |
| Automatic Docker upgrade does not cover every patch | Changing the tag to a major or minor release does not guarantee that later patch releases are applied on the same route. | Check the release list for each patch and apply it through the documented route for your tag. Record the tag you run. |
What the Docker image upgrade covers and what it leaves to you
Changing the image tag replaces the OpenEMR application code and nothing else, and the boundary between the two is the sites/ directory. In the official Docker images, only sites/ persists when a container is recreated. The image supplies the application code, while sites/ holds each site's configuration (including sqlconf.php), uploaded documents and other per-site data. Before you change the tag, confirm that sites/ is mounted from a host path or named volume that survives container removal, because a container recreated without that mount starts from an empty site. Confirm this in your own compose file or orchestrator manifest rather than assuming the default layout matches your deployment.
Anything you installed elsewhere in the webroot is lost when the container is replaced. A custom module, a patched core file or a third-party tool copied into a path outside sites/ will not come back with the new image. You have three ways to keep it: reinstall it after each upgrade, build a custom image that layers your changes onto the official one, or bind-mount the module directory from the host. Each option carries its own maintenance cost. A custom image must be rebuilt for every new release, and a bind mount ties the module to the host's file layout. Inventory these items before the upgrade so you know which of the three applies to each one.
The image swap does not finish the upgrade. The new container still needs the database upgrade steps for the target version to be run against each site, and the site must be checked after the new container starts: login, key clinical screens, documents, scheduled jobs and any interfaces. Confirm with your vendor or the release notes which database steps the target version requires, and record who runs them and who signs off on the result. Also check the database server and PHP requirements for the target version before you pull the image, since a container upgrade does not change the database engine that backs it.
Backups and inventory to complete before changing the image tag
The built-in backup tool is no longer available, so the operator owns every backup, restore and record for this upgrade. The cards below cover what to capture and verify before the image tag changes, so that a failed upgrade can be reversed and the upgraded system can be compared with what it replaced.
Full database and sites backup
Take a backup of the database and of the sites/ volume while the container is stopped, so that the data and the files that hold configuration and documents are captured at the same point. Since only sites/ persists across container recreation, the sites/ contents are the part of the container state you must keep. Store the copy outside the host running the containers, and confirm that you can read it back. Ask your database team which dump method and retention policy applies to this system.
Inventory of modules and core edits
List every module, template, script or core file changed outside sites/, because those changes do not survive container recreation in the official images. For each item, record where it lives, who wrote it and whether a newer version exists from its developer. Compare the list with the upgrade notes for the target version. Items you cannot reinstall or rebuild should block the change until you have a plan for them.
Current image tag and runtime versions
Record the exact image tag that is running, the PHP version inside the container and the version of the database server. Note the OpenEMR version shown in the admin interface as well, since a tag alone may not match the database schema state. Use these records to confirm the upgrade path, check that the target release requires the PHP and database versions you have, and roll back to a known state if needed.
Compose file and environment copy
Save a copy of the compose file, run command, environment variables and any bind mount definitions that the container uses. Keep secrets such as database passwords in your secrets store rather than in a plain copy, and record which variables control database connection, site name and initial setup. A copy of the configuration lets you recreate the container exactly as it ran before the change, and it shows which mounts must stay in place.
Test environment built from the backup
Restore the backup into a separate environment that matches production's image tag, database version and mounts. Run the target image against the restored data before touching production, and confirm that logins, scheduling, billing and any interfaces respond. Treat this environment as the place where the upgrade is first tested, so keep it isolated from patient-facing networks and from live interfaces that could send data.
Documented restore test
Write down the restore steps and run them once before the upgrade, timing each step and noting any manual action. A restore that has been performed by someone other than the author is more likely to work during an incident. Confirm who can authorize a rollback, which backup is the rollback point and how long the practice can operate without the system. Keep the written procedure with the other records from this inventory.
The Docker upgrade sequence, with checks and rollback points
This sequence moves a containerized OpenEMR to a new feature release in an order that keeps the database, the sites volume and the running application recoverable at each stage. Each step closes with a check, and each change has a rollback point the team can return to before users are back on the system.
Confirm the target tag and its requirements
The platform lead reads the release notes for the target tag on the OpenEMR releases page and records the current tag, the target tag, and the PHP and database minimums for that exact version. Recent releases require PHP 8.3 or later and a MySQL- or MariaDB-compatible database, but the database version for each target must be confirmed in its release notes before anything changes. Patch releases use a separate route, so they are not covered by this sequence. Check: a written note of both tags and the required versions exists. Rollback point: none is needed yet because nothing has changed.
Back up and prove the restore in test
The system owner takes a database dump and a copy of the sites volume, along with the compose file and environment settings, and stores them outside the host being upgraded. The owner then restores both into a separate test stack running the prior image tag. The check is that the test stack starts, a known patient record and a recent encounter open correctly, and the restored data matches the source. Rollback point: this verified backup serves as the rollback for every later step, so no production change starts until the restore test passes.
Upgrade the database server first when required
If the target release sets a higher database minimum than the running server provides, the database administrator upgrades the server in its own change window, starting with the test stack. The check is that the existing OpenEMR container on the old image connects to the upgraded server and that the server reports the new version. Rollback point: restore the database server from the backup in the second step, because reversing a server version change may require a restore rather than a configuration change.
Stop the container and change the image tag
The operator stops the running OpenEMR container and changes the image tag in the compose file or run command from the current release to the target release. Pin an exact release tag so the upgrade can be repeated and audited. The check is that the file diff shows only the tag change and any planned changes to volumes or environment settings. Rollback point: put the prior tag back in the same file and start the container again on the existing volumes.
Start the container and check logs
The operator starts the container and follows its logs until the web service and database connection report ready. Confirm that the sites volume is mounted at the same path as before, because only sites/ persists when the container is recreated. The checks are that the logs show no fatal PHP errors and that the login page loads over HTTPS. Rollback point: if the container fails to start, stop it, restore the prior tag, and restore the backup from the second step if any data was changed.
Run the site database upgrade and ACL checks
An administrator signs in and follows the upgrade prompt for each site so the database schema and access control entries move to the target release. For multisite installs, every site is upgraded in turn. The check is that the upgrade completes without errors and that a test user's roles still grant the permissions they held before. Rollback point: a schema change is a database change, so restoring the backup from the second step is the only clean return.
Reinstall or confirm modules outside sites
The customization owner lists every module, theme or file kept in the webroot outside sites/. Official Docker images keep only sites/ across container recreation, so each item must be reinstalled, built into a custom image, or mounted from the host. The check is that each module loads and its functions run on the test checklist. Rollback point: rebuild with the prior image tag and the prior module set, which is why the module inventory must be stored with the backup.
Test workflows and open to users
The clinical, scheduling, billing and portal workflows the practice relies on, along with any interfaces, run through a written test checklist on the upgraded stack. Each workflow must complete with the expected output, and each interface must report successful exchanges with its partners. The team reopens access only after the checklist passes and the sign-off is recorded. Rollback point: until sign-off, users stay on the prior stack or the restored backup, and after reopening, the backup and prior tag are kept for the retention period set in the change plan.
How the image, sites volume and database move during an upgrade
The upgrade starts with backups of the external database and the sites/ volume, taken before anything changes. The operator then changes the image tag and recreates the container, which discards everything in the container except the mounted sites/ volume, so the mount must be reused unchanged. The container reconnects to the same external database, and the operator verifies the result or rolls back to the saved image and backups. Modules installed elsewhere in the webroot do not survive recreation and need a custom image or a bind mount.
Only the sites/ volume and the external database persist across an image tag change.
Why patch versions need a different route than the image tag
Patch releases cannot be left to chance. OpenEMR 8.3.0 was released on August 18, 2026, 8.4.0 followed on September 13, 2026, and 8.4.1 on September 20, 2026. The two later releases in that run fixed security vulnerabilities in the FHIR APIs, the patient portal, billing, the fax and SMS module and the fee sheet. Releases this close together mean a container running an older tag can fall behind several security fixes within weeks. Before each patch window, check the OpenEMR releases page yourself, read the notes for every release since your current version, and note which fixes touch the modules your organization uses. Do not assume that a Docker image update has already reached you or that it carried every fix.
Plan each patch as a scheduled change with a defined window. Before the window, take a backup of the database and of the sites/ volume, and record the exact image tag currently running so you can return to it. Deploy the new tag to a non-production copy first, then run your normal clinical and billing checks: patient search, scheduling, encounter notes, claim generation, the patient portal login and any interfaces your practice depends on. Confirm that the database migration, if one runs, completes without errors. Agree in advance who makes the rollback decision and how long you will wait before making it. The rollback path only works if the backup was taken and restored successfully at least once in a test environment, so confirm that step with whoever operates your backups.
Delaying a security patch against a system holding patient records carries real exposure. The fixes in 8.3.0 and 8.4.0 address flaws in areas that handle external access and sensitive financial data, so an unpatched instance remains open to the issues those releases closed. Treat the time between a published security release and your deployed patch as a risk you must document and accept or reduce, and ask your security and compliance leads to set the maximum acceptable interval for your environment. If you cannot meet that interval, consider restricting the affected features, such as the patient portal or external FHIR access, until the patch is in place.
What makes a Docker OpenEMR upgrade take longer
This table lists the factors that most often stretch a containerized OpenEMR upgrade and how each one changes the work. Read each row as a question to answer about your own install before asking for a quote. The main takeaway is that the number of modules outside sites/, custom code, and external integrations usually matter more than the image tag change itself.
| Driver | Effect on effort | What to confirm |
|---|---|---|
| Custom or third-party modules outside sites/ | Each module must be found, checked for a version that supports the target release, reinstalled, and tested, because only sites/ persists across container recreation. | Inventory every module in the webroot and whether each has a release for the target version. |
| Core edits | Edited core files are overwritten when the image changes, so each edit must be re-applied or moved into a custom image or bind mount and retested. | Compare the running webroot against the stock image for the current tag. |
| Database size and migration steps | Larger databases take longer to back up, restore into a test copy, and run through schema changes in the upgrade path. | Database size, the upgrade steps between your current and target versions, and a tested restore time. |
| External services such as the C-CDA Node.js service | Companion services may need their own version change, configuration and a separate test pass after the core upgrade. | Which companion services run alongside OpenEMR and whether each has a matching release. |
| Interfaces and FHIR clients | Lab, billing, portal and FHIR integrations need retesting against the new version, and each client may need its own changes. | A list of every interface and FHIR app, its owner, and its test cases. |
| Number of sites in a multisite install | Each site has its own documents, edi, era and letter_templates directories, sqlconf.php settings and database upgrade step, so effort scales with site count. | The site count, per-site configuration differences, and whether sites share a database server. |
| Database server must be upgraded first | If the target release requires a newer MariaDB or MySQL version, the database server upgrade becomes a separate change with its own backup and rollback plan. | The database server version now in use and the minimum the target OpenEMR release requires in its release notes. |
Questions teams ask before upgrading OpenEMR in Docker
How much does upgrading OpenEMR in Docker cost?
The cost comes from the work around the image tag change, which is usually the smallest step. Internal staff time is the main cost when your team does the work, and partner fees cover the same tasks when an outside firm does them: inventory, backups, a staging environment, testing, custom module checks and sign-off. The upgrade itself is one-time for each version jump, while support retainers recur. The main cost drivers are the version gap, since moving across major lines can require PHP 8.3 or later and a supported MySQL or MariaDB server, the number of sites, the size of the data, custom or third-party modules, and the number of interfaces such as billing, labs and the patient portal. DeployOpen does not publish a price list. A quote follows from a written scope, so ask for an itemized scope, the backup and restore checks, the test plan, who performs the retesting and what post-upgrade support is included.
How long does an OpenEMR Docker upgrade take?
The window is set mostly by testing and change approval, not by pulling the new image. The most useful way to plan it is to list the blockers before you pick a date. Those include the distance between your current version and the target, any database server or PHP prerequisite that must change first, custom modules that wait for a developer update, the number of clinical workflows that need regression checks, and your change freeze and approval cycle. Release timing also matters. OpenEMR 8.4.0 was released on September 13, 2026 and 8.4.1 followed on September 20, 2026, so check the release notes for the exact target before you schedule. Ask any outside team for a schedule that shows the staging rehearsal, the production window, the testing period and the rollback point, and confirm each step against the release notes and your own environment.
Can our IT team upgrade OpenEMR in Docker without outside help?
A team that already runs Docker, a MySQL or MariaDB server and Linux hosts can often do the upgrade in-house, but the skill list is longer than the container commands. The team needs to manage Docker volumes and compose or orchestration files, back up and restore the database and the sites volume, handle database upgrades inside OpenEMR, and keep TLS and web server settings intact. If you run custom images or modules, someone must also know PHP and how those modules load. Most important is knowing what lives outside sites/, because the official images persist only that directory across container recreation. Staff who have never rehearsed a restore should practice it on a copy first. A partner can take the whole project, only the risky parts such as the database and custom modules, or only the testing. Whichever route you choose, agree the scope in writing.
What testing do clinical and IT staff need to do after an upgrade?
Clinical and IT staff should test the workflows they use every day, using scripted cases that match real practice. Clinical checks usually include scheduling, patient registration, encounters and forms, document upload and retrieval, prescriptions and lab or imaging results, and the patient portal if it is enabled. Billing staff should check claim creation, the fee sheet, payment posting and any fax or SMS reminders, because OpenEMR's 8.3.0 and 8.4.0 releases fixed security vulnerabilities in the patient portal, billing, the fax and SMS module and the fee sheet, so those areas deserve regression checks. IT staff should test login (including LDAP, SSO or MFA where configured), scheduled jobs, backup jobs, FHIR endpoints if you use them, logs and outbound interfaces. Each test needs an owner, an expected result and a recorded sign-off before the production window closes.
What happens if an OpenEMR Docker upgrade fails?
Rollback means returning to the previous image tag and to the database and sites data you captured before the change, so the backup set matters more than the image. Keep the old image tag available, take a database dump and a copy of the sites volume before you start, and record both in the change record. The important caution is that once a database upgrade has run, reverting only the image can leave the application and schema out of step, so restore the database from the pre-upgrade dump as well. Modules installed outside sites/ are not kept when a container is recreated, so either reinstall them on the old image or confirm that a custom image or bind mount carries them. Test the restore on a copy before the window, and agree a decision point in advance, for example the time after which the team rolls back instead of continuing to troubleshoot.
Do patch releases need a separate plan in Docker?
Yes. Feature upgrades and security patches have different triggers and different testing needs, so they should follow separate plans. A feature upgrade changes the version line and may require PHP, database and module work. A patch release fixes specific defects or security issues, and you need to read its advisory to decide how fast it must land. OpenEMR's 8.3.0 and 8.4.0 releases both fixed security vulnerabilities, which is a reason to keep a standing patch window for systems holding patient records instead of waiting for the next major upgrade. Each patch should go through staging, the same backup steps and a short regression set. After any upgrade or patch, recheck the hardening settings in the Securing OpenEMR guide, including that setup.php and other admin scripts are removed and that direct web access to sites/*/documents is blocked. The separate patch route is covered in more detail on the patch releases page.
How DeployOpen scopes and delivers an OpenEMR Docker upgrade
DeployOpen plans, implements, backs up, upgrades, documents and supports self-hosted open-source platforms inside your own infrastructure, including your cloud accounts, data centers or air-gapped networks. For an OpenEMR Docker upgrade, that work starts with a written, fixed-scope agreement that names the target version, the inventory of what is running, the test environment, the cutover window and the rollback method before any container is changed. The inventory is where most of the scope is decided: it records the image tag in use, the database server and its version, the PHP version, whether sites/ is a persistent volume, and which modules or core edits live outside sites/. Each item in that inventory either shapes a task in the plan or becomes a question the client must answer before work begins.
Delivery follows the agreed scope in order. The upgrade is rehearsed in a test environment built from a recent copy of the production data and configuration, so that the database migration, the module reinstallation and the reports and interfaces can be checked before production is touched. The cutover and rollback steps are written down with named owners, and the rollback depends on the verified backup taken before the change. Documentation of the final configuration, the image tag and the verification results is delivered with the work so that your team can repeat the process at the next release.
Because OpenEMR security releases arrive on their own schedule, many clients choose to move the upgrade and later patching under a retainer. A retainer covers ongoing upgrades, patching and continuous testing under terms agreed in writing. DeployOpen does not publish a price list. A quote follows from the written scope, so the most useful preparation is the inventory described above, along with the list of systems that depend on OpenEMR and the maintenance windows your organization can accept.
How DeployOpen runs OpenEMR upgrades
DeployOpen plans and carries out Docker-based OpenEMR upgrades inside your own infrastructure, starting with a written scope that names the image tags, data volumes and custom modules involved. Each step is verified on a copy of your system before anything changes in production, and you receive documentation of what was done and how to repeat it.
How we scope
- Written scope names the current and target image tags and the upgrade route for each step.
- We inventory the sites volume, database, and any modules or core files placed outside sites.
- Scope confirms backup, restore testing and rollback steps before any container is recreated.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We stand up a staging copy of your Docker deployment with a restored backup of production data.
- Upgrade steps run against staging, including database and PHP requirements for the target release.
- Modules installed outside sites are reinstalled, containerized or mounted, and retested after the change.
- Login, patient portal, billing, interfaces and reports are tested against a checklist you approve.
How we hand over
- You receive a runbook with exact image tags, volume mappings, commands and the rollback procedure.
- Documentation records which patch or security releases were applied and which were deferred.
- Your team runs a rehearsal of the production cutover with our engineers observing or assisting.
- Backup and restore procedures are documented so your operations staff can repeat them.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the handover.
- A retainer can cover follow-up for later OpenEMR releases and security updates on your schedule.
- Ask any quote to state what recurring support includes and how requests and response times are handled.
- Confirm with your compliance team which upgrade evidence they need, since DeployOpen does not issue attestations.

