Mautic cron jobs and email queue setup

Mautic depends on scheduled cron jobs and a messenger consumer to update segments, run campaigns and deliver queued email. This page shows how to set them up so large sends stay reliable.

On this page

Why Mautic cron jobs decide whether large sends arrive on time

When a Mautic install is running but segment counts lag behind imports, campaign steps fire hours late, or a broadcast sits at a partial count, the cause is usually not the web application. Mautic depends on scheduled cron jobs for segment updates, campaign updates and campaign triggers, plus a broadcasts command that sends segment emails, and a messenger consumer that works through queued email when queueing is enabled. Each of these is a separate process that must run on a schedule or stay alive, and none of them is visible in the admin interface when it stops. The first task in any Mautic project is therefore to confirm, on the actual server, which of these processes exist, who owns them and where their logs go.

Making this harder than it looks, the jobs overlap and share one database. Segment rebuilds, campaign evaluation and email dispatch all read and write the same contact and event tables, so a long segment run can slow a campaign trigger, and two copies of the same job started by a slow scheduler can compete for the same rows. The Mautic cron jobs documentation says the scheduled commands should be staggered for this reason. Failures are also often silent: a job that exits with an error, a consumer that dies after a deploy, or a cron entry that runs under the wrong user may leave no message in the browser. Ask your implementation partner or internal team to show the log file or monitoring signal that would reveal a stalled job within a set window, and agree that window before launch.

Infrastructure choices shape all of this. The Mautic requirements page states that Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead, because shared plans rarely give you reliable cron access, long-running processes or control over PHP settings. Confirm with your hosting provider that you can create cron entries, run a persistent consumer under a process supervisor and set the PHP memory and execution limits the commands need. Check the current requirements page for supported PHP and database versions before you size the server, since those versions change between Mautic releases.

The moving parts behind Mautic scheduled work

Mautic depends on a small set of scheduled jobs and one queue consumer to keep segments, campaigns and sends current. Each part reads from and writes to the database or the queue, so a stalled component shows up as a specific symptom in the admin interface. Knowing which symptom belongs to which component is the fastest way to diagnose a stuck send.

System cron scheduler

The server's cron scheduler is the trigger for every Mautic job, and Mautic does not run its own background timer. Each job is a separate entry that must run as the web server user with the correct PHP binary and working directory. If the scheduler stops, every other part stops together, so segments freeze, campaigns pause and queued emails wait. Check the crontab for the correct user, confirm the schedule against the Mautic cron jobs documentation, and check that job output is logged somewhere someone reads.

Cron jobs docs

Segment update job

The segment update job recalculates membership for segments whose filters depend on contact fields, tags, points or activity. It reads contact data and segment filter definitions, then writes the membership table that campaigns and broadcasts use. When it stops, contacts who now match a segment are missing from it, and contacts who no longer match stay in it. Emails and campaign entries then target the wrong audience without any error appearing. Stagger this job away from the campaign jobs so the three do not compete for the same tables.

Campaign update job

The campaign update job adds contacts to campaigns based on the campaign's source segments and its entry rules. It reads segment membership and existing campaign membership, then writes new campaign membership records. If it stops, new contacts never reach the first step of a campaign, even though their segment shows them as members. Teams often blame the segment first, so compare the segment membership count with campaign membership for a recent contact before changing any filter.

Campaign trigger job

The campaign trigger job evaluates contacts whose next campaign event is due, such as a wait step ending or a decision being made. It reads event schedules and contact state, then executes actions, which includes queuing emails. Because it sets the timing of every campaign step, a stall shows up as contacts sitting at a wait step past their due time. Set its frequency and batch limit deliberately for your contact volume, and confirm it has a regular schedule, since a single long run can delay the next one.

Broadcasts command

The broadcasts command sends one-time emails to the contacts in a segment chosen for a broadcast. It reads the broadcast definition and the segment membership at send time, then writes queued messages for the batch it processes in each run. Its batch limit controls how many contacts are handled per run, so a large list finishes across several runs rather than in one. If it stops, the broadcast stays in a pending or partly sent state. Check the send count against the segment size before assuming the list is complete.

Messenger consumer

The messenger consumer is the long-running worker that takes queued email messages and hands them to the configured mail transport. It reads the queue and writes sent or failed status back to Mautic. It must be running as a managed service, because a cron entry alone does not keep it alive. When it stops, queued emails accumulate, broadcasts show as sent in some views while contacts receive nothing, and the queue backlog grows. Confirm the consumer is running under a process supervisor and that failed messages are visible to the team. The Mautic cron jobs documentation describes when it is needed.

How contacts move from cron jobs to delivered email

The flow starts with the system scheduler, which triggers the segment and campaign jobs. Those jobs write segment membership and campaign events to the database. Broadcasts and campaign actions then queue email, and the messenger consumer pulls those messages and hands them to the mail transport. Both the database and the mail transport are shared trust boundaries, so check that each job and worker has only the access it needs and that queued messages drain as expected.

Scheduled jobs write contacts and events, then the consumer delivers queued email.

Which scheduling and queue model fits your send volume

This table compares three ways to run Mautic cron jobs and send email, from a single host to a separate messenger worker. Read each row for the send volume it suits, the operational work it creates, and the version-specific settings to confirm before you choose. The main takeaway is that the queue model should follow send volume and failure tolerance, not the other way around.

ModelWhen it fitsOperational costConfirm in your version
All jobs on one host, synchronous sendingSmall contact lists and low, infrequent sends where a delayed or failed send can be re-run by handOne host to patch and monitor. Cron failures stop segment and campaign updates, and a long send can hold the schedulerWhich cron commands run directly and whether email is sent inline or queued by default
Cron host separate from a messenger workerCampaigns and broadcasts run on a schedule while large sends need their own processing capacityTwo services to monitor. Workers need restarts after deploys and config changes, and both hosts add load to the shared databaseHow the messenger consumer is started, its restart and time limit behavior, and the transport Mautic uses for queued mail
Queued sending through the messenger consumer, with staggered cron jobsLarge broadcasts and segment emails where delivery must continue if a web request or cron run ends earlyQueue backlog must be watched. Failed messages need a retry and review process, and staggered schedules must be documentedRecommended cron intervals and stagger offsets, batch limit settings, and where failed messages are stored and retried
Shared database for all job and queue writesAny model above, since every job reads and writes contact and segment tablesConcurrent jobs can compete for locks and slow tracking and form writes if batches are largeDatabase sizing, connection limits and whether replicas are used for reporting queries
Dedicated monitoring for job runs and queue depthAny send volume that goes out on a schedule without someone watching itAlerts and log retention must be set up and tested. Without them, missed runs often surface only as late campaign emailsWhich logs each command writes, and how to check the last successful run of each job

Setting up Mautic cron jobs and the messenger consumer step by step

This sequence sets up the scheduled jobs and the email queue that Mautic depends on, in an order that keeps segment updates, campaign triggers, broadcasts and queued sends from competing for the same resources. The result is a server where every job runs on schedule, its logs are readable, and a test message is consumed without manual intervention.

  1. Verify the install method and platform versions

    Confirm which Mautic release line you will run, then check the PHP, database and web server versions against the requirements page before anything is scheduled. The platform team should record the install method, whether that is the production package with the web or command-line installer, Composer with the recommended project template, or a development clone from GitHub. Mautic should run on a VPS or dedicated server, and the project advises against shared hosting. Done when the host passes the requirements check and the team holds a written version record for the cron host.

  2. Create the scheduler user and file ownership

    Create a dedicated system user to run Mautic's console commands so that cron jobs do not run as root or as the web server account. The sysadmin should set file ownership so this user can write to the cache, log and media directories, while the web server user can read the application files it serves. Run each Mautic console command once as the scheduler user from the install directory and confirm it exits without permission errors. Done when a manual run creates or updates a log entry owned by the scheduler user.

  3. Add segment and campaign jobs in staggered order

    Add the segment update, campaign update and campaign trigger jobs from the cron jobs documentation as separate crontab entries, and offset their start minutes so they do not begin together. A sensible order is segments first, then campaigns, then triggers, because campaign logic depends on the segment membership the segment job produces. Confirm the exact command names and recommended intervals for your installed version before adding them. Done when each job writes start and finish entries to the log and a test segment updates after its scheduled run.

  4. Schedule the broadcasts command for segment emails

    Add the broadcasts command, which sends emails to segments, as its own crontab entry on a separate offset from the segment and campaign jobs. Set its batch and time limit options using the cron jobs docs for your version, starting with conservative values so that a single run does not hold the database for long. Keep the send volume low during the first test. Done when a test broadcast to an internal segment completes and the log shows how many contacts were processed.

  5. Configure the messenger transport for queued email

    Set the email queue to use the messenger transport so that sends are handed to a queue and processed by a worker. Confirm the queue settings in the configuration file, using the key names listed in the docs for your version, and make sure the transport points to a storage location that the worker host can reach. Keep the transport settings identical on the web and worker hosts. Done when a test email is published to the queue and the transport shows one pending message.

  6. Run the messenger consumer under a supervisor

    Start the messenger consumer as the scheduler user under a process supervisor such as systemd or Supervisor so that it restarts after a crash or a reboot. Set the consumer's time and memory limits so it restarts periodically, and confirm the appropriate values in the docs for your version. Keep one consumer process per queue unless your send volume and the database capacity have been checked for concurrency. Done when the supervisor reports the process as running and a manual stop is followed by an automatic restart.

  7. Test the full path with a small send

    Build a test segment with two or three internal contacts, add it to a test campaign and a test broadcast, and let the scheduled jobs run without manual intervention. Read the job logs to confirm that each run started, finished and reported no errors. Then check that the queued messages were consumed and delivered to the test inboxes. Done when segment membership, the campaign step and the test email all match expected results and the consumer log shows the messages processed.

How the cron and queue layout changes by deployment model

On a single node, the web server, cron jobs and the messenger consumer all run on one VPS or dedicated server. This is the simplest layout to reason about because one host owns every scheduled task and one process list shows what is running. The main risk is contention: a long segment rebuild or a large broadcast can consume CPU and database connections while web requests from tracking and forms still need to respond.

  • Overlapping runs: A cron entry that starts before the previous run finishes can process the same contacts twice. Confirm how each command behaves when a prior instance is still active.
  • Consumer lifecycle: If the messenger consumer is started by hand or by a process that is not supervised, queued email stops silently after a reboot or a crash.
  • Resource pressure: Schedule heavy commands at different minutes so segment, campaign and broadcast jobs do not all compete for the same CPU and database.
  • Mail transport limits: Confirm the batch limits and send rate that your mail provider allows, since one host sends everything.

Before go-live, confirm the exact cron commands, staggering guidance and consumer options for your release in the Mautic cron documentation, and verify that the consumer restarts automatically after a server reboot.

What drives effort and cost in a cron and queue project

This table lists the factors that change the effort of setting up Mautic cron jobs and the email queue, with how each one raises work and how to keep it down. Use it to see which drivers a fixed-scope quote should account for and which ones the client team controls. The main takeaway is that contact volume, campaign timing and sending design set most of the work, and each one should be written into scope before work starts.

DriverWhy it changes effortHow to keep it down
Contact volumeSegment and campaign jobs scan more contacts per run, so tuning, staggering and monitoring take longer to get right.Agree the expected contact count in scope and size the server and job schedule against it.
Number of segmentsEach segment has its own update job behavior to test, and overlapping segments multiply the checks needed.Consolidate segments that serve the same purpose and document which ones campaigns depend on.
Campaigns with time-based stepsDelayed steps rely on campaign trigger jobs running on time, so each timed step needs verification across several days.Limit timed steps to what marketing needs and test a short sample campaign before the full build.
Broadcast email volumeLarge sends depend on batch limits and the messenger consumer, so the team must tune throughput and watch for backlog.Set batch sizes in a test send first and schedule large broadcasts away from other jobs.
Number of sending domainsEach domain needs its own authentication setup and queue behavior checked, which adds configuration and test work.Keep sending domains to the number the business actually uses and confirm the mail transport with the provider.
Environments (dev, staging, production)Cron and queue settings must be reproduced in each environment, and drift between them causes hard-to-trace failures.Manage the job schedule and consumer settings as configuration kept under version control.
Custom plugins that add jobsCustom code may register its own commands or queued messages, which must be staggered and monitored alongside core jobs.Inventory every custom command before scoping and confirm its run frequency and resource use.
Compliance evidence for job loggingAssessors may ask for proof that jobs run, fail and recover, which requires log retention and alert setup beyond default settings.Agree the evidence list in writing up front, such as log location, retention period and failure alerts, and confirm it with the client's compliance team.

How to test that Mautic sends reliably and fails safely

Test the scheduled work before you trust it with a live list. Start by confirming that each cron job for segments, campaigns and broadcasts runs once per interval and never overlaps with its previous run. Set the schedule in a staging copy, let it run across several intervals, and check that the timestamps in the job output and the server's cron log show one start and one finish per cycle. Overlap usually appears when a job takes longer than its interval, so watch the run times as well as the count. Confirm the staggering you configured by checking that the segment, campaign and broadcast jobs do not all start in the same minute.

Next, test the outcomes with known data. Create a small segment with a fixed membership, such as five seed contacts you control, and check that the contact count after the segment job runs matches exactly. Build a campaign with a short delay and a single trigger, then confirm the contact enters the next step at the expected time and not earlier. For sending, send a test broadcast to a seed list that includes addresses on mailboxes you can inspect, and confirm each seed receives one copy. The seed list is the evidence, so record which addresses should receive mail before you start.

The failure test matters most. Stop the messenger consumer, queue a batch of emails, and confirm they remain in the queue and are not marked as sent or dropped. Then restart the consumer and confirm that the queued mail is delivered, with no duplicates and no gaps against your seed list. Review the Mautic logs and the web server and cron logs during each step. A silent failure looks like a job that reports success while the counts stay flat, a queue that keeps growing with no error, or a campaign that stops advancing contacts. Ask your implementation partner or internal owner to confirm the exact log locations and alerting for your environment before go-live.

What to monitor, back up and document after go-live

Once cron jobs and the messenger consumer run in production, the team needs to see whether they are still doing their work, back up what they depend on, and write down how to recover them. The cards below connect run health to the release cadence, so schedules get rechecked each time Mautic moves to a new release.

Job run history and last success

Track when each Mautic cron command last finished successfully, not only whether the scheduler started it. Segment updates, campaign updates, campaign triggers and the broadcasts command should each have a recorded last-success time that you check against their expected interval. A job that runs but never completes often shows up first as contacts missing from a segment or a campaign step that never fires. Review this record after every Mautic upgrade, because a new release can change how a command behaves.

Mautic cron jobs docs

Queue depth and consumer health

Watch how many queued emails are waiting and whether the messenger consumer process is alive. A growing backlog during a large send usually means the consumer stopped, is too slow for the volume, or is failing on the same message repeatedly. Confirm that your process supervisor restarts the consumer after a crash or server reboot, and that an alert fires when the backlog stops shrinking. Check this before and after each send window.

Patch release cadence
Monthly

Failed message handling

Decide in advance what happens to emails that fail delivery inside the queue. Define who reviews failures, how often, and whether a failed message is retried, dropped or reported to the sending team. Keep a record of bounce and failure counts per send so a spike is visible. Confirm with your email sending service how it reports bounces back to Mautic, since that setup determines what appears in your failure review.

Database growth from campaign and log tables

Campaign events, lead event logs and audit entries grow with every send and every campaign step. Measure table sizes on a regular schedule and set a retention policy that the team has approved, so old rows are removed deliberately rather than by accident. Growth also slows the cron jobs that scan these tables, so a rising table size can explain jobs that take longer over time. Include these tables in your database backup plan and in your restore tests.

Change control for cron schedules

Store the crontab entries, staggered start times and batch limit settings in version control, and record who changed them and why. Each Mautic upgrade can change expectations for these jobs, so schedule a recheck as part of every upgrade. The releases page sets the cadence: monthly patch releases, minor releases every three months and major releases every two years. Recheck schedules after each major release at minimum, and verify the cron commands still match the current docs.

Mautic releases

Runbook for restarting the consumer

Write a short runbook that covers how to stop, restart and verify the messenger consumer, where its logs live, and which commands confirm that cron jobs have resumed. Name the person or on-call role who can run it, and test the steps on a non-production copy at least once. Include a step to check for stuck messages before restarting, so a failing message does not cause a restart loop. Store the runbook next to the cron configuration and review it at each release recheck.

Questions teams ask before setting up Mautic cron jobs and email queues

Can an internal team set up Mautic cron jobs and email queues without a partner?

Yes, if the team has Linux administration skills, access to the server, and someone who can read application logs and mail transport settings. The work is mostly configuration: scheduling the segment, campaign and broadcast commands, staggering them so they do not overlap, setting batch limits, and running the messenger consumer as a supervised process. The harder part is proving the setup holds under a large send, which needs a staged test list and monitoring of the queue. Teams without that experience often find the first large send is when gaps show up. A partner is most useful when the team wants that verification done in writing before a live campaign.

What does the setup need from our team before work starts?

The main inputs are:

  • Shell and scheduler access to the Mautic server, plus the account that runs the web application, so cron entries and the consumer service can be created and checked.
  • Mail transport details from the sending provider or internal relay, including host, port, authentication method and any rate limits on the account.
  • Sending domains with SPF, DKIM and DMARC records already in place or in progress, because the queue will expose any gap in those records quickly.
  • A test list of internal addresses across the mail providers your audience uses, plus a few contacts who can confirm receipt.
  • Named owners for campaign changes and for alerts, so a failed job has someone to report to.

Confirm these items with your mail and DNS owners early, since they often take the longest to obtain.

How long does it take to set up Mautic cron jobs and email queues?

The duration depends on a few drivers rather than a fixed figure. The main ones are how many segments and campaigns run on schedules, how many sending channels and domains are involved, whether the mail provider needs new authentication records, how complex the existing server and process manager setup is, and how much load testing the team wants before go-live. A single sending domain with a small contact base is a much shorter job than several brands sending high volumes through shared infrastructure. Ask any partner to break the estimate into configuration, testing and go-live steps so you can see which driver dominates.

What recurs after the cron jobs and email queue are live?

Several things need ongoing attention. Cron jobs and the messenger consumer must keep running, so process health, restarts after server maintenance and log review are routine. Queue backlogs need watching, especially before large campaigns. Mail provider limits, bounce rates and sending reputation change over time and affect how fast the queue can drain. Campaign and segment changes often add new scheduled work that must be staggered against existing jobs. Each Mautic upgrade can change command options or runtime requirements, so the configuration should be rechecked after every upgrade. Ask for these items to be listed as an operations runbook with named owners.

Does Mautic cron and email queue setup work on shared hosting?

No. The Mautic requirements page states that Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead. Cron jobs and a long-running messenger consumer need control over the process environment that shared hosting usually does not provide. A shared plan may run scheduled tasks with strict time limits, kill background processes, or block the outbound connections the mail transport needs. Teams on shared hosting should plan a move to a VPS or dedicated server before they design their sending process. Confirm the exact server specification against the current requirements page for your Mautic version.

How do cron and queue changes interact with Mautic upgrades?

Mautic upgrades can change the command names, options, PHP requirements and the way background processing runs, so cron and consumer configuration should be treated as part of the upgrade scope. Mautic's release cadence includes monthly patch releases, quarterly minor releases and major releases every two years, so the setup will be revisited more often than many teams expect. Before an upgrade, record the current cron entries, consumer service definition and batch settings. After the upgrade, run the scheduled commands manually, confirm the consumer restarts, and send a small test broadcast. Keeping a copy of the working configuration in version control makes rollback much faster.

What are the risks if large sends run without a tested queue?

The main risks are delayed or missed emails, duplicate sends when jobs overlap, sending bursts that trigger provider throttling or spam filtering, and campaigns that stall because a consumer stopped without an alert. Overlapping segment and campaign jobs can also slow the database and affect tracking. These risks are reduced by staggering schedules, setting conservative batch limits, monitoring the queue, and testing with a realistic but controlled list before any large send. Ask for the test results and alerting setup in writing before approving a production campaign.

Does the setup need a separate security review?

The cron and queue setup touches credentials, mail transport settings and server processes, so it should be included in the broader hardening review. Store mail credentials in protected configuration rather than in scripts, restrict who can edit cron entries and the consumer service, and make sure logs do not expose recipient data or secrets. Where personal data is processed in queued messages, confirm retention and consent handling with your compliance owner. DeployOpen can review this part as part of a security assessment, but it does not issue audit reports or certifications; independent auditors and certification bodies do that work.

How DeployOpen scopes, builds and hands over Mautic scheduled work

DeployOpen treats Mautic cron jobs and the email queue as one scheduled workload that must be scoped, built, tested and documented before a large send. We set up the schedules, batch limits and queue consumer inside your own infrastructure, then verify them against your real send volumes.

How we scope

  • The written scope lists every cron job, broadcast command and messenger consumer that will run on your servers.
  • Scope records your expected segment sizes, campaign count and send frequency so batch limits can be set against them.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We stagger segment, campaign and trigger jobs in the crontab and document the order each one runs in.
  • We configure batch limits and the messenger consumer, then test queued sends at increasing volumes in a non-production copy.
  • We check the process supervisor, logging and failure alerts so a stopped consumer is noticed before a campaign misses its window.

How we hand over

  • You receive a runbook covering each scheduled job, its purpose, its frequency and the command used to run it manually.
  • The runbook includes the steps to restart the consumer, clear a stuck queue and confirm that the broadcast and campaign jobs completed.
  • We walk your platform or marketing operations team through the runbook and the checks they should run after each large send.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including review of cron and queue settings after each Mautic upgrade.
  • We can retest queue behavior when contact volumes, sending infrastructure or Mautic versions change.
  • Confirm with us which monitoring and paging tools your team uses so alerts for failed jobs reach the right people.

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.