Running Mautic with the official Docker images: when containers fit
The first decision is whether Mautic should run as one container or as several, and the answer depends on how its work is divided. The official images let a team package the same application code for different roles, but Mautic is not a single process. The web request path serves the admin interface, form submissions and tracking requests. Separately, Mautic depends on cron jobs for segment updates, campaign updates and campaign triggers, a broadcasts command for segment emails, and a messenger consumer when emails are queued. A team deciding how to split roles should plan a web container, a worker container for the queue, and a scheduled job runner, each reading the same codebase and the same configuration. Containers fit well when your organization already operates Docker or Kubernetes, has monitoring and secrets handling for those platforms, and can manage persistent storage for the Mautic files that must be shared between roles.
Containers also change where the operational risk sits, not whether it exists. The project's requirements page says Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead, so a container platform should be a dedicated, controlled environment rather than a multi-tenant one. The image does not remove the PHP version and extension requirements, the MySQL or MariaDB requirements, or the need for a web server and reverse proxy that handle HTTPS and forwarded headers correctly. Before committing, confirm with the image documentation which PHP version each image release ships, which web server flavor it bundles, and how it expects the database and environment variables to be supplied. Check those details against the release line you intend to run, because the supported PHP versions differ between Mautic releases.
If a team does not already run containers in production, a single virtual machine with the classic installer may be the simpler route, and containers can be added later once the queue and cron behavior is understood. Ask any implementation partner to show, in writing, how each container role starts, what it mounts, how cron is scheduled across replicas so jobs do not run twice, and how an upgrade moves all roles to the same release together. Those answers determine whether the container design is manageable for your team, and they should be settled before the first production deployment.
Apache or FPM: choosing the image variant
The Apache-based variant bundles a web server and PHP in one image, so a single container can serve the Mautic web interface and the tracking and form endpoints without another service in front of it. This suits a small instance, a lab, or a first deployment where the team wants the fewest moving parts to build and patch.
- Fewest moving parts: the web server, PHP runtime and application share one container, so there is one image to pull, patch and roll back.
- Web role only: the container still does not run segment updates, campaign triggers or queued email on its own, so plan separate worker and cron containers built from the same codebase.
- Proxy in front: TLS termination, trusted proxies and the site URL still belong to a proxy or load balancer, and tracking URLs depend on that configuration being correct.
- Less tuning control: PHP limits and Apache settings come from the image defaults, so confirm the upload and execution limits and change them only through the mechanism the image documents.
Confirm that the PHP version in the tag falls within the range your chosen Mautic release supports before you select this variant.
The PHP-FPM variant runs only the PHP process manager. A separate web tier, usually Nginx, handles HTTP and passes requests to PHP over FastCGI. This fits teams that already run a managed web tier, want to scale web and PHP capacity independently, or need TLS, caching and access controls at the edge.
- Separate web tier: Nginx is one of the web servers Mautic supports, so the web container becomes a configuration you own, including the virtual host and the rules that block internal paths.
- Shared code volume: Nginx must see the same Mautic files that PHP-FPM executes, so both containers need the same application tree mounted or built in.
- Configuration ownership: document root, static asset paths and request routing live in the Nginx file, so changes to the image can require matching changes there.
- More containers to run: web, FPM, worker and cron roles are separate services, which means more health checks, restarts and network rules to manage.
Before go-live, confirm that your Nginx document root and routes match the paths the FPM image expects, and test the installer and a tracking request through the full chain.
Either variant assumes a PHP version and extension set that matches the Mautic release you run. The Mautic requirements page sets the supported PHP range for each release, so the tag you pick determines which PHP runtime the application will use. Do not assume that a required extension is present because the image is official. Check it.
- PHP range per release: Mautic 7.0 requires PHP 8.2, 8.3, 8.4 or 8.5, and Mautic 7.2 supports PHP 8.2 to 8.5, so an older tag may fall outside the range for a newer release.
- Database driver: the application needs MySQL 5.7 or higher with InnoDB, or MariaDB 10.2 or higher, so confirm that the image includes the PDO driver for that database.
- Web server assumptions: the Apache variant expects its own rewrite and routing setup, while the FPM variant expects an external server to route requests correctly. Test both the admin login and a public tracking URL.
- npm for builds: npm is required from Mautic 5.0 onward, so confirm whether the image provides it or whether your build stage must.
- Extension list: take the extension list from the requirements page for your release, then verify it inside the running container.
Run the requirements check against the exact image and tag you plan to pin before you start the web installer.
Tag names are where the variant choice becomes a deployment decision. Before you pin, confirm the exact tag names on the project's Docker Hub listing or source repository, because naming, supported PHP versions and default contents can change between releases. Use the Mautic releases page to choose the support line first, since support end dates decide how long a tag stays appropriate.
- Choose the release line first: pick the Mautic release using its support dates, then select the variant tag that matches that release.
- Read the PHP version from the source: confirm the PHP version in the tag's documentation or build file, not from memory or an older guide.
- Confirm the variant naming: check which tags denote the Apache variant and which denote FPM, and whether both are published for your release.
- Pin by digest where policy requires it: record the image digest with the tag so a later rebuild cannot silently change what runs.
- Test the next tag in staging: deploy the pinned tag to a copy of your instance before any upgrade moves the tag forward.
Record the chosen tag, its PHP version and its variant in your change record so an auditor or upgrade planner can trace exactly what runs in production.
How web, worker and cron containers share one codebase
The diagram starts at the reverse proxy, which is the only component that faces the internet and terminates TLS. It forwards requests into the internal network to the web container, while the worker and cron containers run the same Mautic codebase from a shared volume without serving traffic. All three roles read and write the same MySQL or MariaDB database, so the check to make is that every container mounts the same code and points at the same database settings. Cron jobs and the messenger consumer run inside their own containers, not on the proxy.
Three roles share one codebase and one database behind the proxy.
Container role layout options and when each fits
This table compares three ways to split Mautic's web, worker and cron roles across containers, and how each one handles code, configuration and background work. Read each row against your release process and monitoring, since the failure modes depend on which roles share a container. The main takeaway is that every added role must run the same release and stay visibly healthy, or queued email and scheduled segment and campaign updates can stop without an obvious error.
| Layout | Operational complexity | Codebase and configuration | Failure modes to confirm |
|---|---|---|---|
| Single container | Lowest. One container to deploy, monitor and restart. | Codebase comes from one image or volume. All settings reach one container. | A web restart interrupts cron and queue work. Confirm whether the image runs jobs in the same container. |
| Split web and worker | Moderate. Two roles must share one database and one release. | Both containers need the same codebase, matching configuration and the same secrets. | Queued email stays unsent if no messenger consumer runs. Confirm the worker container starts and stays up. |
| Split web, worker and cron | Highest. Three roles to version, monitor and keep in step. | All three need identical code. An identical image tag or shared volume prevents drift. | Missed or duplicate triggers if schedules overlap. Confirm cron jobs are staggered and run from one scheduler. |
| Code baked into the image | Simple to roll back by changing the image tag. | Code is fixed per release. Configuration must come from environment variables or secrets. | Edits made inside a running container are lost when it is replaced. Confirm where settings persist. |
| Code mounted from a shared volume | Higher. Volume sharing and file ownership must match across roles. | Code and writable paths need a shared, persistent location for every role. | Stale code or permission errors between roles. Confirm ownership and writable directories on each container. |
Setup sequence for Mautic containers
This sequence takes a team from choosing a supported Mautic release and image variant to a running web role, worker and cron roles, and verified public URLs. Each step ends with a check so the environment is confirmed before the next layer depends on it.
Choose the release line and image variant
Start by picking a Mautic release line from the supported release table, then confirm the PHP version it needs (Mautic 7.0 accepts PHP 8.2, 8.3, 8.4 or 8.5). Decide between the Apache and FPM image variants based on whether your reverse proxy or ingress already handles static files and PHP process management. Record the exact version tag you will pin in your deployment manifests. Check: the chosen tag, PHP version and database engine appear together in one written decision record that your security and platform teams have reviewed.
Prepare the external database and proxy
Provision MySQL 5.7 or higher with InnoDB, or MariaDB 10.2 or higher, on a host outside the containers, with a dedicated Mautic database user. Set up the TLS-terminating proxy or load balancer that will front the web role, and confirm which hostname and scheme users will reach. Keep the database reachable only from the container network. Check: from a test container on the same network, you can open a database connection with the Mautic credentials and reach the public hostname through the proxy over HTTPS.
Build or pin the image and shared storage
Build a local image from the official base with your pinned tag, or reference the tag directly, and record the digest in your registry. Provision one shared volume for the Mautic codebase and configuration, so the web, worker and cron roles all read the same files. Give the web server user write access only to the directories Mautic needs to write, and keep the configuration file writable only during installation. Check: all three roles mount the same volume path and the container runs as the expected user with the expected ownership.
Start the web role and complete the installer
Start only the web role first, with the proxy headers and trusted proxy settings already known, and complete the web installer or the command-line installer against the external database. Confirm that PHP limits such as upload size and execution time meet the installer requirements before you run it. After installation, remove or lock down any installer routes that should not stay public. Check: the login page loads over HTTPS through the proxy, the installer no longer runs, and the configuration file records the expected site URL.
Start the worker and cron roles
Start the worker role running the messenger consumer, and start a separate cron role that runs the scheduled Mautic commands. Keep the worker and cron containers on the same image tag and shared volume as the web role so they load the same code and configuration. Confirm that queued email is being picked up rather than accumulating. Check: the worker container logs show the consumer running without fatal errors, and a test email queued from the web interface is processed.
Schedule cron jobs in staggered order
Configure the cron role with the segment update, campaign update and campaign trigger commands, staggering them so they do not all start at the same time, as the Mautic cron documentation recommends. Add the broadcasts command for segment emails. Confirm the schedule matches the documented command list for your release line, since command names can differ between versions. Check: each command runs on schedule in the cron logs, and a test segment or campaign change is reflected after the next run.
Verify tracking URLs and SAML callbacks
Test the tracking script endpoint and any form submission URLs through the public hostname, confirming they return the expected responses over HTTPS and are not redirected to an internal address. If you use SAML single sign-on, confirm the assertion consumer and metadata URLs use the public hostname, and that the identity provider sends email, first name and last name attributes. Check: a visitor page with the tracking script records a contact event, and a SAML login round trip completes and returns the user to the correct Mautic address.
Security and operational considerations for containerized Mautic
A containerized Mautic deployment has more moving parts than a single server: web, worker and cron containers share one codebase, one database and a set of mail and CRM credentials. The cards below cover the controls that tie those parts together and the checks to confirm against Mautic's own documentation before go-live.
Keep database and mail credentials out of images
Database passwords, SMTP or API keys for email transports, and CRM tokens should reach the containers through a secrets mechanism your platform manages, not through values baked into images or committed to a Compose file. Check which settings Mautic reads from its local configuration file and which can come from environment variables in the image you use, and rotate credentials on a schedule your team can actually run. Confirm the variable names against the image documentation before you write any secret into a manifest.
Mautic install docsRun containers as least-privilege users
Web, worker and cron containers should run as a non-root user with no more capability than the process needs. Drop unneeded Linux capabilities, set the root filesystem to read-only where the image allows it, and mount only the paths Mautic writes to. Confirm which user the official image runs as and which directories it expects to own, because changing the user can break cache or log writes and surface as errors that look unrelated to permissions.
Match writable volume permissions
Mautic writes to cache, logs, media and configuration paths, and the web, worker and cron containers must agree on who owns them. A volume created by one container as root can block another container running as a different user. Set ownership on the host or through an init step, test every role after the first deployment, and document the UID and GID so that a new node or a restored volume does not fail silently when a cron job tries to write.
Pin image tags and scan base images
Use explicit version tags for Mautic and its PHP base image rather than a floating tag, and promote the same tag through test and production. Pin to a release line that is still receiving security support, and check the support dates on the Mautic releases page before choosing a tag. Run a vulnerability scanner against the built image on every rebuild, since base image packages change even when Mautic does not. Record the digest you deployed so a rollback is exact.
- Mautic 6.0 security support ends
- 30 September 2026
Segment the database from the containers
Place the database on a network that only the application containers can reach, with no route from the public side and no published port on the host. Restrict database accounts to the Mautic schema and the hosts that need them. Keep the proxy or load balancer on a separate network segment from the database. Confirm with your network team how container networking, firewall rules and any managed database service interact, since default container bridges often allow more reach than intended.
Set log retention for operational and audit needs
Container logs are lost when a container is recreated unless they are shipped elsewhere. Forward web access logs, Mautic application logs, cron output and worker errors to a central store with a retention period set by your security and compliance policy, not by the default of the logging driver. Include the tracking and form endpoints, since they reveal request patterns. Confirm which log paths Mautic writes and whether personal data appears in them, so the retention rule matches your privacy commitments.
Questions teams ask before running Mautic in Docker
Do containers make Mautic easier to run?
Containers standardize the runtime, but they do not remove the operational work. The official images give you a consistent PHP and web server stack, which helps with repeatable builds across environments. You still own the database, the mail transport, the reverse proxy, persistent storage for the codebase and configuration, and the scheduled jobs that Mautic depends on. Containers also add orchestration work: each role needs a shared codebase volume, environment variables must be managed as secrets, and logs and health checks need a home. Teams that already run container platforms usually see the most benefit. Teams without that experience should expect a learning curve before the first stable deployment.
What drives the cost of a containerized Mautic build?
The main cost drivers are the number of environments, the size of the integration scope and the platform you run containers on. Costs break into design work (container layout, volumes, networking and secrets), build work (images, Compose or orchestration manifests, proxy and TLS), integration work (CRM, mail transport and identity) and verification (cron, queue and failover tests). Recurring costs include image rebuilds for each release, monitoring and backups. Ask any provider to split the quote by these phases, state which environments are included, and name who maintains the manifests after handover. Costs rise when the team needs high availability, multiple regions or a strict audit trail for configuration changes.
How long does a Docker-based Mautic deployment take?
No duration has been established for this work, so treat any timeline as provisional until it is written into a scope. The duration depends on how many roles you run (web, worker, cron), whether you need a separate database and mail transport, how many integrations are in scope, and how much of your container platform already exists. Access approvals, DNS and certificate work, and your internal review cycles often take longer than the technical build. Ask for a phased plan with milestones for a working staging environment, production cutover and handover, and confirm which of those dates depend on your team's responses.
What must we provide before a containerized Mautic build starts?
You need to provide the infrastructure and the details that Mautic cannot supply for itself. Expect to provide:
- A container platform or host you control, with storage for persistent volumes and enough network reach to your database and mail services.
- A MySQL or MariaDB database that meets the supported versions, with credentials and a separate host if your policy requires one.
- SMTP or API mail transport details, sender domains and DNS records for authentication.
- Identity details if you plan single sign-on, including the SAML provider's attribute mapping for email, first name and last name.
- Domain names, TLS certificates and proxy rules, plus any CRM credentials for integrations.
Confirm early who holds each secret and how it will be rotated.
Can an internal team run Mautic in Docker without a partner?
An internal team can run it if it already operates containers, reverse proxies and PHP applications, and if it has time to learn Mautic's cron, queue and upgrade model. The skill gaps usually sit in three places: separating web, worker and cron roles correctly, keeping the shared codebase consistent across containers, and handling the monthly, quarterly and two-yearly release cadence without breaking integrations. Before deciding, ask who will watch scheduled jobs, who owns image rebuilds, and who responds when a worker stops. A partner can deliver the build as a fixed-scope engagement, document it, and support it under a retainer, while your team keeps ownership of the environment.
How do upgrades differ when Mautic runs in containers?
Upgrades in containers replace images rather than patching files in place, so the process needs a new image, a new shared codebase and a controlled database migration. Each role must move to the same release together, and the worker and cron containers must not run against a mismatched codebase. Plan for a staging rehearsal, a database backup before the change and a rollback path that restores the previous image and data. Mautic's release cadence sets how often this happens, and the supported release lines are listed on the project's releases page, so confirm which line you are on before scheduling. Containers make rollback faster, but only if images and data are versioned together.
Does a Docker setup change Mautic's security and compliance work?
The container layer does not remove the application-level controls you need. You still configure authentication, consent and tracking settings, CORS restrictions, and access to the database and secrets. Containers add new items to review: image sources, base image patching, secret injection, network policies between roles and what each container can write to. Keep records of image versions, configuration changes and who can deploy. Compliance assessors will ask for evidence, and DeployOpen prepares systems and evidence for assessments but does not issue audit reports or certifications, so independent auditors and certification bodies make that determination.
Which Mautic release should a containerized build target?
Target a release line that is still in support for the whole planned operating period, not only at go-live. The Mautic releases page lists security support windows: Mautic 7.2 has active and security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Confirm the PHP version and database requirements for the chosen line before choosing a base image, because the image's PHP version must match the release. Ask your provider which tag they will pin and how they will move you to the next line.
How upgrades change when Mautic runs in containers
In a container deployment, an upgrade is a new image build and a coordinated rollout, not an in-place file update. Mautic's stated cadence is monthly patch releases, minor releases every three months and major releases every two years. Each patch or minor release means rebuilding the image from the new codebase and redeploying every role that uses it. Treat the cadence as a planning calendar: a patch can arrive with little notice, so your pipeline should be able to rebuild and redeploy on short order without a long manual procedure. Before each cycle, check the Mautic releases page to confirm the support end date of the release line you run, since a line that reaches end of support forces a move to a newer one regardless of how stable it appears.
All roles must move to the same release together. The web container, the worker that consumes queued email, and the cron container all read the same application code and the same database schema. If the web container runs the new version while the cron or messenger consumer still runs the old one, jobs can be processed by code that expects a different schema or configuration. Record the image tag for each role in your deployment manifest so one change promotes the full set, and decide in advance whether you will stop workers during the schema update or let them drain. Confirm the exact sequence for your chosen version in the Mautic documentation rather than assuming it matches a previous release.
Test every release on a staging copy before production. Restore a recent database backup into a staging environment, point it at a staging copy of the uploaded files and configuration, run the new image across all roles, and then exercise the paths that matter most: sign-in, a test campaign, a segment update, a test email through your transport, and the tracking script on a test page. Keep the staging database under the same controls as production when it holds real contact data. Schedule production upgrades in a window where you can roll back to the previous image tag and restore the database if a migration fails, and confirm with your own team how long that restore would take.
How DeployOpen scopes and delivers Mautic container deployments
DeployOpen plans and builds Mautic container deployments inside your own infrastructure, starting with a written scope that sets out the web, worker and cron roles, the image variant and the shared codebase each role needs. We then build, test and document the stack so your team can review it, run it and upgrade it on a supported release line.
How we scope
- Confirm the target Mautic release line and its PHP version against the supported range before choosing an image tag.
- Decide between the Apache and FPM image variants based on your proxy, TLS termination and existing web server standards.
- Map which cron jobs, broadcast sending and messenger consumers run in separate containers, and document the shared codebase volume each role mounts.
How we build
- Build the web, worker and cron containers from pinned image tags with environment configuration kept outside the images.
- Configure the shared codebase, file permissions and writable directories so every container runs as the expected user.
- Test installation, cron scheduling, queued email delivery and a proxy-fronted login before the stack is accepted.
How we hand over
- Deliver a written runbook covering container roles, image tags, volumes, environment variables and the upgrade steps for each role.
- Walk your platform and marketing operations teams through restarts, log locations, cron health checks and rollback.
- Document the decisions and open items so your own team can operate the deployment without us.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer, including moving between Mautic release lines.
- Ask us to confirm the scope, the support terms and any retainer details in the written quote before you commit.

