
Deploy Mautic
Mautic 7 marketing automation with MySQL, cron and queue workers built in
Just deployed
/data
MySQL
Just deployed
/var/lib/mysql
Deploy and Host Mautic on Railway
Mautic is an open-source marketing automation platform. It tracks contacts and their activity on your website, groups them into segments, and runs email campaigns, forms, landing pages and lead scoring. You own the data and the install, as a self-hosted alternative to tools like HubSpot or Mailchimp.
About Hosting Mautic
Upstream runs Mautic as three containers from one image (web, cron and queue workers) that share config and media folders. Railway volumes can't be shared between services, so this template runs all three roles in one service. The official image starts through a short script that keeps config, media and logs on one volume at /data. On first boot it installs Mautic with your Railway domain as the site URL and creates the admin account. It then runs migrations, upstream's cron schedule and the queue workers next to Apache. The data lives in MySQL. Email sending needs an SMTP or API transport that you add.
Common Use Cases
- Email newsletters and drip campaigns to your own contact lists
- Lead capture with forms and landing pages, with scoring and segments
- Website visitor tracking tied to contact records and campaign triggers
Dependencies for Mautic Hosting
- Mautic 7.2.2 (official
mautic/mautic:7.2.2-apacheimage, pinned by digest) - MySQL 8.4 (
mysql:8.4.13, pinned by digest) with a volume
Deployment Dependencies
- Mautic source code and 7.2.2 release notes
- Official Docker image and Mautic documentation
- Start script used by this template
Implementation Details
- Sign in: open your Railway domain and sign in as
adminwith the password in the Mautic service'sMAUTIC_ADMIN_PASSWORDvariable.MAUTIC_ADMIN_EMAILis the admin's email. Both are read only on the first install, so change the password in Mautic afterwards. - Email: Mautic can't send email until you add a transport. Set
MAILER_DSN(for examplesmtp://user:pass@smtp.example.com:587) plusMAILER_FROM_EMAILandMAILER_FROM_NAME, or leave them empty and set it up under Settings > Configuration > Email Settings. WhenMAILER_DSNis set, it overrides the UI setting. - Cron and queues: segments update every 15 minutes, with campaign updates and triggers 5 and 10 minutes later. Email and tracking-hit queues run in MySQL, with two workers each. To change the schedule, edit
/data/cron/mautic. - Custom domain: after adding one, change the Site URL under Settings > Configuration.
- Upgrades: change the image tag. Migrations run on every start.
Why Deploy Mautic on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Mautic on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
MAUTIC_ADMIN_EMAIL
MySQL
mysql:8.4.13