Deploy Mautic + MySQL - Open-Source HubSpot Alternative
Deploy and Host with Railway
mautic-cron
Just deployed
mautic-worker
Just deployed
mysql
Just deployed
/var/lib/mysql
mautic-web
Just deployed
/var/www/html/config
Deploy and Host Mautic + MySQL + Worker/Cron on Railway
Self-host Mautic, an open-source HubSpot alternative, with MySQL, a public web service, and dedicated worker/cron services.
About Hosting Mautic + MySQL + Worker/Cron on Railway
mautic-web: public Mautic UI servicemautic-worker: queue worker service for background jobsmautic-cron: scheduler service for recurring Mautic tasksmysql: private MySQL database with persistent storage- Generated database passwords and Mautic secrets
- Private networking between Mautic services and MySQL
Why Deploy Mautic + MySQL + Worker/Cron on Railway
The published template deploy test created mautic-web, mautic-worker, mautic-cron, and mysql; all services reached SUCCESS; /health returned HTTP 200; the installer completed; admin login reached /s/dashboard; worker logs showed email/hit/failed consumers running; and cron detected the installed database.
This avoids the common one-container trap where Mautic's UI starts but campaigns, segments, and queued jobs do not run correctly.
Common Use Cases
- Self-hosted marketing automation
- Contact and segment management
- Campaign and landing-page experiments
- Internal newsletter workflows
- Mautic evaluation environments
Dependencies for Mautic + MySQL + Worker/Cron Hosting
Mautic depends on MySQL for application data. The official Docker roles split web, worker, and cron behavior so background jobs and scheduled tasks run outside the public web service.
Deployment Dependencies
MYSQL_ROOT_PASSWORD: generated MySQL root passwordMYSQL_PASSWORD: generated Mautic database passwordMAUTIC_DB_*: private MySQL connection settingsMAUTIC_MESSENGER_DSN_EMAIL: queue transport for email jobsMAUTIC_MESSENGER_DSN_HIT: queue transport for hit jobs
After Deploy
- Open the Mautic public URL.
- Complete the installer and first-admin setup.
- Add SMTP before sending real campaigns.
- Keep worker and cron services running; do not treat them as optional for production usage.
Support Checklist
If a deploy fails, include all four service deployment IDs, /health output, whether the installer finished, and worker/cron logs mentioning messenger consumers or database install detection.
Template Content
mautic-cron
mautic/mautic:5-apacheMAUTIC_DB_HOST
MAUTIC_DB_PORT
MAUTIC_DB_USER
DOCKER_MAUTIC_ROLE
MAUTIC_DB_DATABASE
MAUTIC_DB_PASSWORD
MAUTIC_VOLUME_LOGS
MAUTIC_VOLUME_MEDIA
MAUTIC_VOLUME_CONFIG
MAUTIC_MESSENGER_DSN_HIT
MAUTIC_MESSENGER_DSN_EMAIL
PHP_INI_VALUE_MEMORY_LIMIT
mautic-worker
mautic/mautic:5-apacheMAUTIC_DB_HOST
MAUTIC_DB_PORT
MAUTIC_DB_USER
DOCKER_MAUTIC_ROLE
MAUTIC_DB_DATABASE
MAUTIC_DB_PASSWORD
MAUTIC_VOLUME_LOGS
MAUTIC_VOLUME_MEDIA
MAUTIC_VOLUME_CONFIG
MAUTIC_MESSENGER_DSN_HIT
MAUTIC_MESSENGER_DSN_EMAIL
PHP_INI_VALUE_MEMORY_LIMIT
mysql
mysql:ltsMYSQL_USER
MYSQL_DATABASE
MYSQL_PASSWORD
MYSQL_ROOT_PASSWORD
mautic-web
mautic/mautic:5-apachePORT
MAUTIC_DB_HOST
MAUTIC_DB_PORT
MAUTIC_DB_USER
DOCKER_MAUTIC_ROLE
MAUTIC_DB_DATABASE
MAUTIC_DB_PASSWORD
MAUTIC_VOLUME_LOGS
MAUTIC_VOLUME_MEDIA
MAUTIC_VOLUME_CONFIG
MAUTIC_MESSENGER_DSN_HIT
MAUTIC_MESSENGER_DSN_EMAIL
PHP_INI_VALUE_MEMORY_LIMIT
DOCKER_MAUTIC_LOAD_TEST_DATA