---
title: "Deploy Mautic"
description: "[2026-11-04] Mautic 7 on MySQL 9.7.4. Auto-migrates v4/v5 DBs."
category: "Automation"
url: https://railway.com/deploy/9yIPIs
---

# Deploy Mautic

[2026-11-04] Mautic 7 on MySQL 9.7.4. Auto-migrates v4/v5 DBs.

**[Deploy Mautic on Railway](https://railway.com/template/9yIPIs)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/9yIPIs/manifest.json

- **Creator:** beuz's Projects
- **Category:** Automation
- **Total deploys:** 480

## Template content

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:9.7.4
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0`

### Mautic https://mautic.org/wp-content/uploads/2014/09/Mautic_Logo_LB.png

- **Source:** https://github.com/leonardochappuis/mautic-railway
- **Health check:** /s/login
- **Public domain:** Yes

## Documentation

# Deploy and Host Mautic on Railway

This is a template to 1click deploy Mautic (email marketing solution).

## About Hosting Mautic

It will spin a MySQL database and connect it to the Mautic docker image deployed.

Configuration should be pretty straight forward.
You can leave it as is and just follow the installation steps at the mautic ui which should be available at the address auto generated by railway after you deploy.

Please don't hesitate to make contributions if you feel the template is lacking!

### Mautic 7 highlights

Deploys [Mautic 7](https://mautic.org) (the latest major version) with a pinned MySQL 9 database.

- **Admin user created automatically**: from the `MAUTIC_ADMIN_EMAIL` you provide at deploy time (password is generated. Change it
  after first login, or check the service variables)
- **Automatic database migrations**: redeploying after a template update migrates your
  database to the new Mautic version on boot.
- **Zero-downtime deploys**: a healthcheck keeps the old version serving until the new
  one is ready

## Setup

1. Click Deploy and enter your admin email.
2. Once live, log in at `https:///s/login` with that email and the
   generated `MAUTIC_ADMIN_PASSWORD` (in the Mautic service's Variables tab).
3. Configure your sending email under Configuration → Email Settings.

## Upgrading from an older version of this template (Mautic 4/5)

Your existing variables keep working — the new image understands the old
`MAUTIC_DB_HOST` (`host:port`) and `MAUTIC_DB_NAME` formats. Before applying the update:

1. **Back up your database** (Railway volume backup or `mysqldump`). The jump to
   Mautic 7 migrates your data automatically and worked flawlessly in testing
   (including 4 → 7 directly), but major upgrades deserve a backup.
2. Add a `MAUTIC_URL` variable set to your public URL (e.g. `https://your-domain.com`)
   — older deploys don't have it, and without it Mautic shows the installer.
3. Apply the update and redeploy. Migrations run automatically on boot.
4. **Do not change your existing MySQL service's image version.** Moving an existing
   database to MySQL 9 requires a dump/restore — an in-place image bump can corrupt it.
   Your current MySQL keeps working with Mautic 7 (8.0+ required, 8.4+ recommended).

## Common Use Cases

- Email marketing campaigns, newsletters and drip sequences
- Lead tracking, scoring and segmentation for your site
- Marketing automation you own, as an alternative to HubSpot / Mailchimp

## Dependencies for Mautic Hosting

- A MySQL database (deployed by this template, pinned to an exact version)

### Deployment Dependencies

- [Mautic documentation](https://docs.mautic.org/)
- [Template source repo](https://github.com/leonardochappuis/mautic-railway)

## 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.

## Update 2026-10-27
- MySQL image pinned to 9.7.4 (floating major tags have corrupted data dirs on host migrations before - always pin your DB patch version).

## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/9yIPIs
