Mautic is the leading open-source marketing automation platform: contact tracking on your website, segments, email campaigns, landing pages and forms, lead scoring and multi-step automation workflows. Think HubSpot or ActiveCampaign, self-hosted, with your contact data on your own server and no per-contact pricing.
For plain newsletters, Listmonk is simpler. Choose Mautic when you need tracking, scoring and automated journeys.
Requirements
- 2 vCPU and 4 GB RAM for small to medium contact databases (tens of thousands of contacts). More for large ones.
- PHP 8.1+ (check the requirements of your Mautic version), MySQL 8 or MariaDB 10.x, and a web server.
- Reliable cron jobs. Mautic does almost everything in the background.
- An email sending service with good deliverability. See transactional email services.
Option 1: Docker
The official mautic/mautic images run separate containers for the web app, cron and the worker (message queue), plus MySQL. Use the example Compose files from the Mautic Docker repository, and set:
MAUTIC_DB_*database credentials;- the site URL (
https://marketing.example.com); - a persistent volume for
config,mediaandvar/logs.
Put Nginx with HTTPS in front. See Nginx reverse proxy.
Option 2: LAMP/LEMP install (Composer)
cd /var/www
composer create-project mautic/recommended-project mautic --no-interaction
sudo chown -R www-data:www-data /var/www/mautic
Point the web server root at /var/www/mautic/docroot, configure PHP-FPM (raise memory_limit to 512M, and set max_execution_time appropriately), create a MySQL database and user, then run the web installer at your domain. See Composer, Nginx with PHP-FPM and php.ini settings.
Add HTTPS with Certbot. See Let’s Encrypt.
Cron jobs: required
Without them, segments don’t update, campaigns don’t run and emails don’t send. Typical schedule (as the web user):
*/5 * * * * php /var/www/mautic/bin/console mautic:segments:update > /dev/null 2>&1
*/5 * * * * php /var/www/mautic/bin/console mautic:campaigns:update > /dev/null 2>&1
*/5 * * * * php /var/www/mautic/bin/console mautic:campaigns:trigger > /dev/null 2>&1
*/5 * * * * php /var/www/mautic/bin/console messenger:consume email --time-limit=280 > /dev/null 2>&1
0 3 * * * php /var/www/mautic/bin/console mautic:maintenance:cleanup --days-old=365 > /dev/null 2>&1
Command names vary slightly between Mautic versions. Check the documentation for yours. Stagger the jobs on busy instances. See crontab.
Email sending
Settings → Configuration → Email settings: use a DSN for an SMTP or API transport (Amazon SES, SendGrid, Mailgun, Postmark and others via plugins), and queue emails rather than sending them immediately. Authenticate your domain with SPF, DKIM and DMARC. See SPF, DKIM and DMARC and email deliverability.
Configure bounce and complaint handling (webhooks or a monitored mailbox), so bad addresses are marked as do-not-contact automatically.
Tracking and forms
- Add the Mautic tracking script (Settings → Tracking settings) to your website. Page visits become part of each contact’s timeline.
- Forms embed on your site (JavaScript or iframe), and create or update contacts.
- Landing pages can be hosted by Mautic itself.
Segments, campaigns and scoring
- Segments: dynamic lists by filters (country, visited pricing page, form submitted, tag).
- Campaigns: visual workflows, e.g. “if a contact downloads the whitepaper → wait 2 days → send email → if opened → add points and notify sales”.
- Points and stages: lead scoring and lifecycle stages.
Privacy and compliance
Marketing automation processes personal data, and tracks behaviour:
- get consent for tracking cookies and marketing emails, as your jurisdiction requires (GDPR and others);
- use double opt-in for email subscriptions;
- respect do-not-contact and unsubscribe status everywhere;
- set data retention (cleanup jobs), and handle deletion requests.
Operations
- Backups: the MySQL database plus
config/andmedia/. See mysqldump and backup strategy. - Performance: a large contact base needs MySQL tuning, and enough PHP workers. See MySQL performance tuning.
- Updates: via Composer (
composer updateplusbin/console doctrine:migrations:migrate), after a backup. See updating self-hosted apps.
Quick reference
| Task | Command / place |
|---|---|
| Update segments | bin/console mautic:segments:update |
| Run campaigns | mautic:campaigns:update + mautic:campaigns:trigger |
| Send queued email | messenger:consume email |
| Email transport | Settings → Configuration → Email settings |
| Tracking script | Settings → Tracking settings |
Related: Matomo analytics and PHP-FPM tuning.