Mautic on Ubuntu 24.04
Mautic is a powerful open-source marketing automation platform designed to help businesses manage leads, automate campaigns, track user behavior, and build personalized customer journeys. It provides advanced tools such as email marketing, lead scoring, campaign builders, forms, landing pages, and detailed analytics — all without locking you into a proprietary SaaS ecosystem.
Unlike cloud-only marketing platforms, Mautic is fully self-hosted, giving you complete control over customer data, tracking logic, and integrations. This makes it especially attractive for organizations that care about data ownership, compliance (GDPR), and long-term cost control.
Running Mautic on Ubuntu 24.04 LTS (Noble Numbat) offers a modern, secure, and long-term supported operating system, combined with the flexibility of Docker containers, the performance and security of Nginx, and HTTPS (SSL) for encrypted communication. This setup is ideal for production environments, agencies, and businesses running serious marketing workloads.
Architecture Overview
| Layer | Component | Role |
|---|---|---|
| OS | Ubuntu 24.04 LTS | Secure, long-term supported Linux base |
| Container Runtime | Docker / Docker Compose | Runs Mautic and database services |
| Application | Mautic (PHP) | Marketing automation platform |
| Database | MariaDB / MySQL | Stores leads, campaigns, emails, logs |
| Reverse Proxy | Nginx | HTTPS termination, routing, performance |
| TLS | Let’s Encrypt / PKI | Encrypted web and API access |
| Mail Transport | SMTP (external or local) | Sending campaigns and notifications |
This architecture separates concerns cleanly and allows easy scaling, backups, and upgrades.
Why Use Mautic?
- Open-source marketing automation – no vendor lock-in
- Full data ownership – host leads and analytics on your own servers
- Advanced campaign builder – visual, event-driven automation
- Email marketing & segmentation – personalized messaging at scale
- Lead scoring & tracking – behavior-based engagement insights
- Landing pages & forms – built-in conversion tools
- API & integrations – connect CRM, CMS, e-commerce, and more
- GDPR-friendly – better control over consent and tracking
Mautic is ideal for teams that want enterprise-grade marketing tools without enterprise SaaS costs.
Mautic vs Other Marketing Automation Platforms
| Feature / Capability | Mautic | HubSpot | Mailchimp | ActiveCampaign |
|---|---|---|---|---|
| Hosting | Self-hosted | Cloud only | Cloud only | Cloud only |
| Open-source | ✅ Yes | ❌ No | ❌ No | ❌ No |
| Data ownership | Full control | Vendor-controlled | Vendor-controlled | Vendor-controlled |
| Automation depth | Advanced | Advanced | Limited | Advanced |
| Customization | Very high | Medium | Low | Medium |
| Cost | Free (infra only) | Paid | Free / Paid | Paid |
Mautic shines when flexibility, customization, and data control are more important than convenience.
Security & Best Practices on Ubuntu 24.04
- Run Mautic only behind Nginx with HTTPS enabled.
- Keep Mautic and the database isolated in Docker networks.
- Store database credentials, JWT secrets, and SMTP passwords as environment variables.
- Use Let’s Encrypt certificates and enable automatic renewal.
- Enable UFW and allow only ports 80 and 443.
- Schedule cron jobs (inside container or host) for campaign processing.
- Regularly update:
- Ubuntu packages
- Docker images
- Mautic core and plugins
- Back up:
- Database
- Mautic configuration
- Uploaded assets and email templates
- Restrict admin access and enforce strong passwords.
- Monitor logs for failed logins and mail delivery issues.
Typical Use Cases
- Email marketing campaigns with advanced segmentation
- Lead nurturing funnels for B2B and B2C businesses
- Marketing agencies managing multiple client projects
- Self-hosted CRM + marketing stacks
- Privacy-focused organizations avoiding SaaS trackers
- Custom integrations with WordPress, e-commerce, or internal apps
Deploying Mautic on Ubuntu 24.04 with Docker, Nginx, and SSL gives you a robust, scalable, and fully self-hosted marketing automation platform — combining enterprise-level features with full control over your data, infrastructure, and costs.
Step 1: Create a Server Instance on Shape.Host
Before installing Mautic, you need a VPS.
Log in to your Shape.Host account at https://shape.host.
From the dashboard, click Create and select Instance.

Choose a data center location close to your audience.

Select a VPS plan with at least:
2 CPU cores
4 GB RAM
40 GB SSD storage

Choose Ubuntu 24.04 (64-bit) as the operating system.
Create the instance and wait for provisioning to complete.

Copy the public IP address of your server.
This server will host Docker, MariaDB, Mautic, Nginx, and SSL services.

Step 2: Connect to the Ubuntu 24.04 Server
Linux / macOS
ssh root@YOUR_SERVER_IP
Windows
Use PowerShell, Windows Terminal, or PuTTY:
ssh root@YOUR_SERVER_IP
After connecting, you should be logged in as root.
Step 3: Prepare the System and Install Docker
3.1 Update the System
apt update
apt upgrade -y
These commands update the package index and upgrade installed packages.

3.2 Install Required Packages
apt install ca-certificates curl gnupg lsb-release nginx certbot python3-certbot-nginx
This installs:
- Required system utilities
- Nginx web server
- Certbot for SSL certificate management

3.3 Install Docker
curl -fsSL https://get.docker.com | sh
Installs Docker using the official Docker installation script.

docker --version
Verifies that Docker is installed correctly.
systemctl enable docker
systemctl start docker
Ensures Docker starts automatically and is running.
Step 4: Deploy Mautic with Docker Compose
4.1 Create Project Directory
mkdir -p /opt/mautic
cd /opt/mautic

4.2 Create Docker Compose Configuration
nano docker-compose.yml
Paste the following content:
services:
db:
image: mariadb:11
container_name: mautic-db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: mautic
MYSQL_USER: mautic
MYSQL_PASSWORD: mautic_password
volumes:
- ./db:/var/lib/mysql
mautic:
image: mautic/mautic:5.0-apache
container_name: mautic
restart: unless-stopped
depends_on:
- db
ports:
- "127.0.0.1:8080:80"
environment:
MAUTIC_DB_HOST: db
MAUTIC_DB_USER: mautic
MAUTIC_DB_PASSWORD: mautic_password
MAUTIC_DB_NAME: mautic
DOCKER_MAUTIC_ROLE: mautic_web
MAUTIC_RUN_MIGRATIONS: "true"
This setup:
- Uses MariaDB 11 as the database
- Runs Mautic 5 (Apache-based image)
- Binds Mautic only to localhost for security

4.3 Prepare Database Volume
rm -rf /opt/mautic/db
mkdir -p /opt/mautic/db
Ensures a clean database directory for MariaDB.
4.4 Start Mautic
docker compose pull
Downloads the latest images.
docker compose up -d

Starts the containers in detached mode.
docker compose ps
Confirms that both containers are running.

4.5 Verify Mautic Container
curl -I http://127.0.0.1:8080
A 302 Found or similar response confirms Mautic is accessible locally.
Step 5: Configure Nginx Reverse Proxy
5.1 Create Nginx Virtual Host
nano /etc/nginx/sites-available/mautic
Paste:
server {
listen 80;
server_name mautic.example.com;
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

5.2 Enable the Site
ln -s /etc/nginx/sites-available/mautic /etc/nginx/sites-enabled/
rm /etc/nginx/sites-enabled/default
nginx -t
systemctl reload nginx
This activates the Nginx configuration.

Step 6: Enable SSL with Let’s Encrypt
certbot --nginx -d ubuntu-tutorials.shape.host

Replace the domain if needed:
yourdomain.com
Certbot will:
- Issue a free SSL certificate
- Automatically configure Nginx for HTTPS
- Enable certificate auto-renewal
Step 7: Complete Mautic Installation
- Open your browser:
https://mautic.example.com - Follow the Mautic web installer:
- Confirm database settings (already preconfigured)
- Create the admin user
- Finalize the installation
Environment Check
This screen confirms that the server environment meets all Mautic requirements. Once all checks pass, click Next Step to continue the installation.

Database Configuration
Enter the database connection details created earlier in Docker. Use the database service name as the host (db), keep port 3306, and fill in the database name, username, and password, then proceed.

Create Administrative User
Create the main administrator account for Mautic by setting a username, secure password, and valid email address. This account will be used to access the Mautic dashboard.

Mautic Login
After installation is complete, log in using the administrator credentials created in the previous step.

Mautic Dashboard
The Mautic dashboard confirms a successful installation. From here, you can start managing contacts, campaigns, emails, and marketing automation features.

You installed Mautic on Ubuntu 24.04 using Docker, exposed it through Nginx, and secured it with Let’s Encrypt SSL. This setup provides a scalable, secure, and fully self-hosted marketing automation platform suitable for production use.
For hosting marketing platforms, CRMs, and other business-critical applications with high performance and full control, Shape.Host Linux SSD VPS offers a reliable infrastructure built for modern server workloads.