Back to blog
MauticMarketing AutomationDevOps

Self-Hosted Mautic in Production: The Checklist That Prevents 2AM Emergencies

Real lessons from running self-hosted Mautic for multiple clients: cron timing, the Mautic 5 queue change, permission traps, and a backup routine that actually restores.

MCQuare Team 5 min read
Self-Hosted Mautic in Production: The Checklist That Prevents 2AM Emergencies

Mautic is the best deal in marketing automation: the full feature set of platforms that charge four figures a month, free and self-hosted. The catch is in the second word. Self-hosted means the 2AM emergency is yours.

We run and maintain self-hosted Mautic instances for multiple clients — fresh installs, Docker deployments, and rescues of instances that were “working fine until they weren’t.” This is the checklist we wish someone had handed us before the first time a campaign silently stopped sending.

Installation: Boring on Purpose

A Mautic install that survives production is unglamorous:

If you’re containerizing, Docker Compose works well — but the cron and backup sections below still apply. Containers don’t exempt you from operations.

Cron: Where Self-Hosted Mautic Actually Lives or Dies

Mautic without correctly configured cron jobs is a contact database with a nice UI. Segments don’t update, campaigns don’t trigger, emails don’t send. The three jobs that matter:

* * * * * php /var/www/html/bin/console mautic:segments:update
*/2 * * * php /var/www/html/bin/console mautic:campaigns:trigger
*/5 * * * php /var/www/html/bin/console mautic:broadcasts:send

Two lessons learned the hard way:

Stagger the timing. If every job fires on the same minute, they overlap, lock tables, and eventually a stuck job blocks the queue. Offset them — and if a campaign must trigger quickly after a form submission, tighten campaigns:trigger to every minute rather than cranking everything.

Run them from /etc/crontab with an explicit user (www-data), not a user’s personal crontab -e. We’ve debugged “cron just stopped” cases that turned out to be jobs running as the wrong user, silently failing on file permissions. Verify with grep CRON /var/log/syslog and test manually with sudo -u www-data php bin/console ... before trusting the schedule.

The Mautic 4 → 5 Queue Trap

This one deserves its own section because it breaks real campaigns.

In Mautic 4, mautic:emails:send handled broadcast sending. In Mautic 5, that command is gone — email sending moved to Symfony Messenger queues. Every cron guide written before 2024 (which is most of them) tells you to schedule a command that no longer exists.

The consequences are nasty: emails appear to send “immediately” instead of queuing, which works at low volume and falls over exactly when a real campaign goes out. The fix:

If you migrated from Mautic 4 and emails behave strangely, this is the first thing to check.

The Maintenance Loop That Keeps Instances Alive

Self-hosted software fails silently before it fails loudly. Our standing routine for every Mautic instance we manage:

Backups: Tested or Fiction

Our backup stack for Mautic instances is simple and, more importantly, restored-from regularly:

  1. Nightly database dump via mysqldump, timestamped and rotated.
  2. Nightly file backup of the whole Mautic directory — we run rclone in a Docker container on a cron to push an encrypted archive to Google Drive. Any off-server target works; the point is off-server.
  3. Before every update or config change: a manual cp -a html html.YYYYMMDD plus a fresh dump. Five seconds, and it has saved us more than once.

The restore drill matters as much as the backup: pull the archive, unzip to a scratch directory, import the dump into a scratch database, reset permissions, and confirm the instance boots. A backup you’ve never restored is a hope, not a plan.

The Short Version

Failure we’ve cleaned upRoot causePrevention
Campaigns not triggeringCron running as wrong user / overlapping jobs/etc/crontab with explicit user, staggered timing
Emails send immediately, then collapse at volumeMautic 5 migration, old send command removedMessenger queue + supervised worker
Error 500 on forms/importsStale cache or permissions after updatecache:clear + permission reset in the update SOP
Tracking suddenly dead everywhereExpired SSL certificateExpiry monitoring with alerts
”The update broke everything”No pre-update backupCopy + dump before every change

None of this is exotic. It’s the unglamorous operations layer that decides whether self-hosted Mautic is a money-saving asset or a recurring emergency.

Running Mautic — or thinking about it — and don’t want to own the 2AM pager? Managed hosting and maintenance of marketing automation and CRM stacks is part of our DevOps & infrastructure services, and we handle the CRM side through our CRM consulting practice. Book a call — we’ll tell you honestly whether self-hosting makes sense for your volume, or whether you’re better off paying the SaaS bill.

Need help with your project?

Whether you're a startup looking for a technical partner or an established business needing DevOps and automation — we'd love to chat.