Moving an existing Mautic install to Docker

Re-platforming a running Mautic onto the official Docker images is mostly about splitting one installation into web, worker and cron roles and reattaching the existing database and files. This page explains what maps cleanly, what does not, and where the effort goes.

On this page

Moving an existing Mautic install to Docker: what the move involves

If your team runs a self-hosted Mautic on a virtual machine or bare server and wants it on containers, the move reuses your existing database and files and changes how the processes are run. The web interface, queue consumers and cron jobs that now share one host or one set of services become separate containers, each started in a defined role. Your contacts, campaigns, segments and history stay where they are, so the work is mostly about packaging the runtime and proving that the new processes read the same data.

The effort depends on three things about your current host: how many roles it performs, how cron and queue processing are set up today, and how the file and configuration layout is organized. A single server doing web, cron and email sending is a different job from a host where workers run under a process manager and the configuration sits outside the codebase. Confirm which PHP extensions, database settings and mounted paths your install relies on, and list every scheduled job and worker. Those inventories set the scope more than the Docker work itself.

The official Mautic Docker images cover Mautic 5 and later, so an install on an older release line needs an upgrade path before containerizing. The project strongly advises the Apache variant over FPM, and the image tags follow patterns such as 6-apache or a fully pinned 6.0.6-apache. Check the current tag list in the docker-mautic repository before choosing a tag, and plan to pin a version rather than follow latest in production.

Which parts of a running Mautic map onto the Docker setup

This table compares each part of a running Mautic install with its counterpart in the official Docker setup, and notes what to check during the move. Read it as a checklist: confirm your current version first, then trace each component to the container role or volume that will hold it. The main takeaway is that the database and files move across unchanged, while the web, worker and cron processes must each be started as their own container role.

Source setupDocker platform equivalentMigration notes
DatabaseExternal database service attached to the web, worker and cron containersKeep the existing database and point all three roles at it. Take a verified backup before the first container starts.
Uploaded media and local filesPersistent volumes mounted into the Mautic application pathCopy media folders and check file ownership so the container user can read and write them.
ConfigurationEnvironment variables and the mounted local configuration fileCarry over site URL, database and mailer settings. Confirm that each value matches what the running install uses.
PHP and web serverOfficial Apache image (the project strongly advises Apache over FPM)Replace the existing PHP and web server stack with the image. Check any custom virtual host or proxy rules you rely on.
Cron jobsContainer started with DOCKER_MAUTIC_ROLE set to mautic_cronRemove the host crontab entries once the cron container runs. Keep the jobs staggered as the Mautic docs advise.
Queued email and messenger consumersContainer started with DOCKER_MAUTIC_ROLE set to mautic_workerStop any host consumer before starting the worker. Two consumers processing one queue need checking before go-live.
Web interfaceContainer started with DOCKER_MAUTIC_ROLE set to mautic_webRoute public and admin traffic to this container only. Confirm the proxy and domain settings still resolve correctly.
Installed versionImage tag such as 6-apache or a pinned tag such as 6.0.6-apacheThe official images cover Mautic 5 and later. Older installs must upgrade first. Pin an exact tag rather than relying on latest.
Plugins and custom codeCode mounted or copied into the image buildCheck every plugin and theme against the target image and version before cutover. Test each one in staging.

Choosing Apache or FPM for the new Mautic containers

The Apache variant is the path the project strongly advises. The official images for Mautic 5 and later are published with tags such as 6-apache or 6.0.6-apache, and the latest tag points to the newest stable Apache image. Because the web server and PHP runtime ship together in one image, the container can serve HTTP directly without a second container for the web server. Teams that pin a full version tag get a predictable upgrade step, and teams that use 6-apache receive patch updates within that minor line.

  • Vendor-recommended path: the docker-mautic project strongly advises the Apache variant over FPM, so it is the baseline most support questions assume.
  • Tag choice: use a version-pinned tag such as 6.0.6-apache for production, and treat latest as a convenience for test environments only.
  • Single image for the web role: the same image runs the web, worker and cron roles through DOCKER_MAUTIC_ROLE, which keeps the build and patching path simple.
  • Reverse proxy in front: a load balancer or proxy terminates TLS and forwards requests to the Apache container on its published port.
  • Upgrade discipline: a pinned tag means each Mautic release is an explicit change you schedule and test.

Confirm with the image documentation which Apache version and PHP version each tag contains before you pin it, and check the Mautic requirements for the release you are moving to.

How to sequence the Docker move with a parallel run and cutover

The sequence moves a running Mautic onto the official Docker images without losing contacts, mail or tracking. Each stage ends with a check that tells you whether the next stage can start.

  1. Inventory the current install

    Record the Mautic version, PHP and database versions, web server, and every cron entry on the old host. Note which queue or messenger consumer processes run, whether emails are queued, which plugins and custom themes are installed, and where the media and file folders live. Confirm the current version against the supported release list before you choose a target image tag. The output is a written inventory that the team signs off, so nothing is found for the first time during cutover.

  2. Choose the target image and tag

    Pick an official image tag that matches a supported Mautic release line, and pin the full version rather than relying on latest for production. Select the Apache variant, since the project strongly advises it over FPM. Confirm that every plugin on the inventory supports the chosen version. The output is a pinned tag recorded in the change plan with a note on why it was chosen.

  3. Rebuild the staging environment

    Deploy the web, worker and cron containers on a staging host using the chosen tag. Attach a copy of the production database and the files folder, and point the staging configuration at the copied data without any outbound mail transport enabled. Run the upgrade or schema steps against the copy in a dry run, then confirm login, the admin dashboard and a sample contact record. The output is a staging instance that matches production behavior except for sending.

  4. Run the containers in parallel with one active sender

    Start the new web, worker and cron roles alongside the old host, but keep exactly one set of cron jobs and queue consumers allowed to send mail. Disable the cron role on the new stack until cutover, or keep the old host's cron active and the new one paused, so segment updates, campaign triggers and broadcasts never run twice. Check the queue on both sides before you move on. The output is a documented sender owner and a test send that reaches only the intended recipients.

  5. Plan the cutover window and rollback

    Agree the window with marketing and the business owners, freeze campaign edits and imports during it, and drain the old queue. Prepare the DNS or reverse proxy change, and record the exact step that reverts traffic to the old host. Confirm with the mail team which sending address and transport the new stack will use. The output is a runbook with named owners and a rollback decision point.

  6. Switch traffic and verify tracking

    Move the domain or proxy route to the new web role, then stop the old cron and queue processes and start the new cron and worker roles. Load a page with the tracking script, submit a test form and confirm the contact record updates. Send a test email and check its open and click tracking and unsubscribe link. The output is a signed checklist showing tracking, forms, email and scheduled jobs all work on the new stack.

  7. Monitor and decommission the old host

    Watch logs, queue depth and cron runs through the agreed monitoring period, and keep the old host and its database backup available for rollback until that period ends. Confirm the period with the business owner before you start it, since the right length depends on your sending volume and risk tolerance. After the agreed period, take a final backup, record the decommission, and remove the old cron entries. The output is a closed change record and an archived backup of the pre-move state.

How the web, worker and cron roles share one database and file store

The diagram starts at the reverse proxy, which routes browser traffic to the mautic_web container. Three containers, each set to one role through DOCKER_MAUTIC_ROLE, sit beside it: mautic_worker consumes messenger queues and mautic_cron runs scheduled jobs. All three attach to the same existing database and the same persistent media and configuration volumes, which were carried over from the old host. Before starting any role, confirm that every container points at the same database host and that the volumes hold the old files with matching ownership.

Three Mautic roles reading and writing one carried-over database and file store.

Documented paths for moving data and configuration into containers

The database is the most important piece of an existing Mautic installation because it holds contacts, campaigns, segments, consent records and configuration state. The migration path keeps that database and attaches the container to it, so the official image does not run a fresh installer against an empty schema. Your team exports the database from the current host using a dump taken while Mautic is quiet, then loads it into a MySQL or MariaDB server that the container can reach over the network. Confirm the server version against the Mautic requirements before you load anything, because the supported range is set per Mautic release.

  • Take a consistent dump: Stop or pause campaign and segment cron jobs before exporting so that the dump does not capture half-processed contact changes.
  • Verify the engine and version: Check that tables use InnoDB and that the server meets the minimum listed for your target Mautic release.
  • Point the container at the database: Supply the database host, name, user and password through the environment variables documented in the docker-mautic repository rather than editing configuration inside the image.
  • Keep the old database read-only: Retain the source database untouched until the new stack has passed checks, so you have a rollback target.
  • Record the table prefix: Confirm any table prefix in your existing configuration matches what the new deployment expects.

Before cutover, confirm with your own database administrator that the restored data row counts and the most recent contact activity match the source.",

What makes the container move larger or smaller

The same Mautic install can take a short afternoon or a multi-week project depending on a handful of conditions. The cards below cover the factors that most change the work, so you can size the move before you agree on scope.

Roles running on one host

A single server that runs the web interface, queue consumers and cron jobs side by side is the most common starting point. Splitting it into the mautic_web, mautic_worker and mautic_cron roles means each container needs its own environment variables, its own logging and its own restart behavior. Check which processes actually run today, who starts them and whether any of them write to local paths that the containers will not share. Map every process before you write a single compose file.

Docker image docs

Custom plugins and themes

Plugins and themes built for the ZIP-based or older Composer layout may depend on paths, autoload behavior or PHP extensions that differ inside the official image. Each custom plugin and theme needs a rebuild check against the target image, and any Composer-managed dependencies need to resolve in the container build. Ask the team which custom code is in use, who maintains it and whether its last successful build is documented.

Cron and queue complexity

Segment updates, campaign triggers, broadcasts and queued email all depend on scheduled and background processes. If these run from a host crontab with ad hoc scripts, each job must be recreated as a mautic_cron or mautic_worker task with the same timing and no overlap. Document the current schedule, note any jobs that were added by hand, and confirm that queued messages drain correctly after the cutover.

Database size and downtime tolerance

The database is usually the longest step because it is attached rather than rebuilt, so its size drives the backup, restore and verification time. Downtime tolerance decides whether you can freeze sends and imports during the move or need a parallel stack and a short final sync. Agree the maintenance window, the rollback point and who can approve a stop before the work starts.

Current version against the supported line

The Docker tags follow Mautic 5 and later, so an older install may need an upgrade step before or after the move. Compare the running version with the release line you plan to target, and check the PHP and database versions that release requires. Confirm the exact version and tag with the current release notes at the time of the move, because support windows for each line have fixed end dates.

Existing container skills

If your team already runs production workloads in containers, with registries, image scanning, secrets management and rolling restarts, the Mautic roles fit into existing practice. If not, the move also adds a container runtime, image update routine and log handling to the support load. Ask who will patch the base image, rebuild for security updates and own the pinned tag after go-live.

Cost and duration drivers for a Docker re-platform

This table lists the cost and effort drivers for moving a running Mautic install onto the official Docker images, with who typically pays for each and what to request in a written scope. Read the one-time rows as project work and the recurring rows as the cost of staying on the containerized setup after cutover.

DriverWhy it mattersWhat to ask for in a quote
Inventory of the running installSomeone must record the Mautic version, PHP and database versions, cron entries, custom plugins, themes and file paths before any container is built. Missing items usually surface during cutover.Who performs the inventory, a written list of what is captured, and whether the output is delivered to your team before build starts.
Staging environmentA containerized copy with a restored database and files lets the team test web, worker and cron roles before users are affected. Staging needs its own infrastructure and maintenance.Whether staging is built on your infrastructure or theirs, who pays for the infrastructure, and how long it is kept after cutover.
Role split for web, worker and cronEach role runs as a separate container set with DOCKER_MAUTIC_ROLE values for mautic_web, mautic_worker and mautic_cron. More roles mean more configuration, monitoring and testing.Confirmed role layout, replica counts, and which queue and cron jobs each role runs, written into the deliverables.
Database and file attachmentThe existing database and media or file folders must be attached to containers without data loss or permission errors. This is the step most likely to need repeated trial runs.A written procedure for attaching data, a rollback point, and who signs off that the attached data matches the source.
Parallel run and cutoverRunning the old and new installs side by side, or planning a short maintenance window, affects duration and the risk of duplicate sends or missed campaign triggers.Whether a parallel run is included, how long the old install stays available, and who coordinates the cutover window with email and campaign owners.
Post-move supportIssues often appear in the first weeks, such as cron timing, worker queues or email sending from the new containers. Support may be billed separately from the migration.The support period included in the fixed scope, response expectations in writing, and what is billed after it ends.
Image version pinning and upgradesPinned tags such as 6.0.6-apache keep the install predictable. Moving to a newer tag later is a recurring task that needs testing, and the latest tag changes without notice.Whether upgrades are included or quoted separately, who tests new tags, and how the pinned version is recorded in your change process.
Recurring operationsContainer hosts, image rebuilds, backups, monitoring and cron health checks continue after go-live. Ownership after handover determines the ongoing cost.Which recurring tasks transfer to your team, the runbook delivered at handover, and whether a retainer is needed for continued support.

What usually goes wrong when Mautic moves to containers

Most problems in a containerized Mautic move come from three places: how processes are split across containers, where state and secrets live, and how versions are pinned. Each card below names one failure, the symptom it causes, and the prevention step to build into the plan before cutover.

Duplicated cron and worker processes

If the old host cron jobs stay active while a new mautic_cron container also runs, segment updates, campaign triggers and broadcasts can execute twice. Contacts may receive the same campaign email more than once. Before cutover, disable every host cron entry for Mautic and confirm that exactly one container runs each role. Stagger cron schedules as the Mautic cron documentation recommends.

Mautic cron docs

State left on the host

Files such as local configuration, media uploads and custom plugins that exist only in the old host directory disappear when a container is rebuilt. The application may start with missing assets or a fresh configuration. Inventory every writable path before the move, decide which paths are mounted as persistent volumes, and test a container rebuild on a copy of the data before going live.

Unpinned latest tags

Using the latest tag without a version means a future image pull can move the instance across a minor or major release line without a planned upgrade. The official images use version-specific tags such as 6-apache or 6.0.6-apache. Pin an exact tag in your deployment definition, record it in change management, and treat each tag change as a tested upgrade with a database backup.

Secrets baked into images

Database passwords, mailer credentials, API keys and the application secret written into a Dockerfile or a custom image get copied into every registry and build cache that holds it. Rotating them then requires a new image. Pass secrets through your platform's secret store or environment injection at runtime, and confirm with the image documentation which variables the container reads before writing the deployment manifest.

Installations below Mautic 5

The official Docker images cover Mautic 5 and later. A site on an older release cannot be moved straight onto a current container tag, so the move must include a staged upgrade on the existing host first. Confirm the running version, check PHP and database compatibility for each step, and take a full backup before each stage. Plan this as its own phase rather than folding it into the container cutover.

Tracking and domain changes at cutover

The tracking script, form embeds and landing page URLs point at the domain and path Mautic was installed with. If the new container sits behind a different hostname, proxy or path prefix, tracking can silently stop and links in sent emails can break. Before switching DNS, update the site URL setting, check the tracking script on a live page, and send a test email to confirm links and the unsubscribe flow resolve to the new address.

Questions buyers ask before moving Mautic to Docker

What does it cost to move an existing Mautic install to Docker?

The cost depends on how many running parts you have and how much of the move is your team's time versus a partner's. Expect the work to split into discovery (inventorying the codebase, database, files, cron entries and web server settings), building the container roles, a staging rehearsal, and the production cutover with rollback. Recurring costs are your own hosting and the time to keep images on a supported release line. Ask any quote to itemize discovery, the staging rehearsal, cutover support and a post-cutover window, and to state which items are one-time and which are retainers. The Mautic project does not charge for the software itself, so licensing is not a cost driver. Ask for the written scope before work starts.

How long does a Mautic Docker migration take?

Duration is set mainly by how many environments you must rebuild and how well the current install is documented. A single instance with one database, one codebase and a short cron list moves faster than an install with several queue workers, custom plugins, a reverse proxy in front and a large contact table that must be validated after the switch. Staging rehearsals add time but reduce the risk of surprises at cutover. Ask for a timeline that lists discovery, build, rehearsal, cutover window and stabilization as separate phases, with the dependencies between them stated in writing. No duration is given here because the timing depends on your environment.

What must our team provide before the Docker move starts?

Your team should provide administrative access to the current server, a verified database backup taken before any change, and an inventory of the files that sit outside the codebase, such as the local configuration, media and uploaded assets. You should also provide the full cron list, including the entries for segment updates, campaign updates, campaign triggers and the broadcasts command, plus any messenger consumer that runs for queued email. Include the PHP and web server versions, DNS and TLS details, and the list of plugins in use. Missing items usually surface during the staging rehearsal, so collecting them first shortens the project. Confirm the exact list in writing with your provider.

Can our internal team move Mautic to Docker without a partner?

Yes, a team with Linux, PHP, database and container experience can do the move internally, provided it has a staging copy, a tested backup and a rollback plan. The hard parts are rarely the containers themselves. They are the cron schedule, the worker process that handles queued email, the file ownership and the configuration carried over from the old install. If your team has run Mautic in production but has not run containers in production, a partner can handle the build while your staff keep the knowledge. Decide based on who will operate the result after cutover, and ask any partner to hand over the runbooks.

Do we have to use Apache for Mautic in Docker?

No, Apache is not strictly required, but the official images guidance strongly advises the Apache variant over FPM. The Apache image bundles the web server and PHP together, which keeps the number of moving parts lower for most installs. Choosing FPM means you must also run and tune a separate web server in front of it, and that adds configuration you must test. If your existing setup relies on a specific Nginx or proxy arrangement, document it so the choice can be made deliberately. Confirm the image variant during discovery and record the reason in the runbook.

How do we pin Mautic versions safely in Docker?

Pin an exact image tag, such as a full version tag with the Apache suffix, rather than relying on the floating tag that follows the newest stable Apache image. The official images use tags such as 6-apache or 6.0.6-apache, and latest tracks the newest stable Apache release. Use the exact tag in your deployment files, upgrade one release line at a time, and rehearse each upgrade in staging before production. Mautic's release cadence includes monthly patch releases, minor releases every three months and major releases every two years, so plan a recurring review. Check the Mautic releases page for current support dates before choosing a release line.

Does the move keep our existing Mautic database?

Yes, the usual approach is to attach your existing database to the new containers rather than rebuild it, so contacts, segments, campaigns and history stay in place. The container layer changes how the application runs, not the data it reads. Before cutover, take a verified backup, confirm the database version meets the Mautic 7.0 requirement of MySQL 5.7 or higher with InnoDB, or MariaDB 10.2 or higher, and check character set and collation settings. Test a restored copy in staging and run a sample of campaigns and segments before you switch traffic.

What does support look like after the Docker cutover?

Support after cutover covers watching the first cron and queue cycles, confirming that email still sends, reviewing logs, and making sure the rollback path still works until you are satisfied. Longer-term support covers image upgrades, backups of the database and files, and checking that the release line stays within its support window. These are normally handled through a written support scope or a retainer rather than an open-ended promise. Ask what response windows, backup verification and upgrade testing are included, and what is excluded, before you sign.

How DeployOpen scopes and delivers a Mautic container move

DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside the client's own infrastructure, so a Mautic container move runs in your cloud account, data center or private network rather than on infrastructure DeployOpen controls. Most engagements are fixed-scope, which means the scope, deliverables and timeline are agreed in writing before any work starts. For a container move, that written scope should name the current install (Mautic version, PHP version, web server, database engine and where the files live), the target image tags, the role layout for web, worker and cron containers, the backup and rollback steps, and who signs off the cutover. Your team should confirm those details against the live system before the scope is drafted, because they determine how much of the work is discovery and how much is build.

DeployOpen does not publish a price list. A quote follows from the written scope, so the useful way to compare options is to ask every bidder for the same scope document. Ask each provider to state what is included in the discovery phase, what evidence they will produce for the cutover (for example, a record of the tested rollback and the post-move checks on cron, queues and tracking), what is handed over at the end, and what is excluded, such as application changes, new plugins or hosting upgrades. Ongoing support, upgrades and continuous testing are available as retainers, and those recur after the project closes. Ask for the retainer terms separately from the one-time migration fee so that you can see which costs continue after the move and which end when the work is accepted.

DeployOpen does not hold vendor partner, reseller or certified provider status for Mautic or for the Docker project, and this page makes no such claim. When you evaluate any implementation partner, ask them to state their Mautic and container experience in their own words and to name the documentation they will follow, including the official docker-mautic repository and the Mautic release and requirements pages. Confirm the current release line you are targeting with the Mautic project before you agree the scope, since the supported versions and their end dates change over time.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.