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

LayerComponentRole
OSUbuntu 24.04 LTSSecure, long-term supported Linux base
Container RuntimeDocker / Docker ComposeRuns Mautic and database services
ApplicationMautic (PHP)Marketing automation platform
DatabaseMariaDB / MySQLStores leads, campaigns, emails, logs
Reverse ProxyNginxHTTPS termination, routing, performance
TLSLet’s Encrypt / PKIEncrypted web and API access
Mail TransportSMTP (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 / CapabilityMauticHubSpotMailchimpActiveCampaign
HostingSelf-hostedCloud onlyCloud onlyCloud only
Open-source✅ Yes❌ No❌ No❌ No
Data ownershipFull controlVendor-controlledVendor-controlledVendor-controlled
Automation depthAdvancedAdvancedLimitedAdvanced
CustomizationVery highMediumLowMedium
CostFree (infra only)PaidFree / PaidPaid

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.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose a data center location close to your audience.

Shape.host instance form with the data center location selector highlighted.

Select a VPS plan with at least:

2 CPU cores

4 GB RAM

40 GB SSD storage

Shape.host instance form with the operating system image selector highlighted.

Choose Ubuntu 24.04 (64-bit) as the operating system.

Create the instance and wait for provisioning to complete.

Shape.host instance form with the Create Instance button highlighted.

Copy the public IP address of your server.

This server will host Docker, MariaDB, Mautic, Nginx, and SSL services.

Shape.host Resources dashboard with the server IP address highlighted.

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.

Terminal showing APT package management commands and output.

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
Terminal showing APT package management commands and output.

3.3 Install Docker

curl -fsSL https://get.docker.com | sh

Installs Docker using the official Docker installation script.

Terminal showing systemd service management commands or output.
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
Terminal showing systemd service management commands or output.

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
Terminal showing the GNU nano editor and configuration text.

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
Terminal showing container image download progress.

Starts the containers in detached mode.

docker compose ps

Confirms that both containers are running.

Terminal showing docker commands or output during Start Mautic.

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;
    }
}
Terminal showing web server configuration text.

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.

Terminal showing systemd service management commands or output.

Step 6: Enable SSL with Let’s Encrypt

certbot --nginx -d ubuntu-tutorials.shape.host
Terminal showing Certbot certificate commands and messages.

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

  1. Open your browser: https://mautic.example.com
  2. 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.

Mautic setup interface.

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.

Mautic setup interface.

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 installer administrator account form.

Mautic Login

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

Mautic sign-in form.

Mautic Dashboard

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

Mautic dashboard.

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.