bolt Valebyte VPS від $4/міс — NVMe, запуск за 60 секунд.

Отримати VPS arrow_forward
eco Початковий Туторіал

Deploying Mautic on

calendar_month Aug 25, 2026 schedule 21 хв. читання visibility 10 переглядів
Развёртывание Mautic на VPS для автоматизации маркетинга и email-рассылок
info

Потрібен сервер для цього гайду? Ми пропонуємо виділені сервери та VPS у 50+ країнах з миттєвим налаштуванням.

Потрібен сервер для цього гайду?

Розгорніть VPS або виділений сервер за хвилини.

Deploying Mautic on a VPS for Marketing Automation and Email Campaigns

TL;DR

In this detailed guide, we will step-by-step set up Mautic — a powerful platform for marketing automation and email campaigns — on your own Virtual Private Server (VPS). You will learn how to install all necessary components (Nginx, PHP, MySQL), configure Mautic, secure it with HTTPS, and set up a backup system. As a result, you will get a fully functional, self-controlled system for managing marketing campaigns, lead generation, and automated mailings, without being tied to third-party SaaS solutions.

  • Installation and configuration of Mautic 5.x on Ubuntu 24.04/26.04.
  • Using Nginx, PHP 8.3/8.4, and MySQL 8.0 for optimal performance.
  • Securing the server with UFW, Fail2Ban, and SSH keys.
  • Setting up HTTPS with Certbot (Let's Encrypt) for secure access.
  • Creating automated backups of the Mautic database and files.
  • Troubleshooting common issues and scaling recommendations.

What We Are Setting Up and Why

Diagram: What We Are Setting Up and Why
Diagram: What We Are Setting Up and Why

We will be deploying Mautic, a powerful Open Source marketing automation platform, on your own VPS server. Mautic allows you to automate email campaigns, manage leads, create landing pages, forms, segment your audience, and track user behavior on your website. It's a comprehensive tool for inbound marketing that can replace expensive commercial solutions like HubSpot, ActiveCampaign, or Mailchimp, especially if you need full control over data and functionality.

Ultimately, upon completion of this tutorial, you will have a ready-to-use Mautic installation, accessible via a secure HTTPS connection. You can immediately start creating your first campaigns, forms, and mailings, with full confidence that your system is optimally and securely configured.

There are two main approaches to using Mautic: cloud-managed solutions (Mautic Cloud, or third-party hosts offering Mautic as a service) and self-hosted deployment on a VPS or dedicated server. Cloud solutions are convenient for a quick start, as the provider handles all installation, updates, and maintenance. However, they often have limitations on functionality, data volume, or contact count, and can be significantly more expensive when scaling.

Self-hosting on a VPS, as we will do, gives you full control. You choose the server configuration, manage updates, install any plugins and integrations, and most importantly, you fully own your data. This is an ideal option for developers, solo SaaS project founders, or companies that require maximum flexibility, data privacy, and cost optimization in the long run.

What VPS Configuration is Needed for This Task

Diagram: What VPS Configuration is Needed for This Task
Diagram: What VPS Configuration is Needed for This Task

Choosing the right VPS configuration is critical for stable and fast Mautic operation, especially as your contact database grows and campaign activity increases. Mautic is a PHP application that heavily uses the database and requires sufficient resources to process mailing and segmentation tasks.

Minimum Requirements for Mautic (as of early 2026):

  • Processor (CPU): Minimum 2 cores. This will be sufficient for small projects (up to 10,000 contacts, a few active campaigns). For larger installations, aim for 4 cores or more.
  • Random Access Memory (RAM): Minimum 4 GB. Mautic, PHP-FPM, and MySQL can be quite resource-intensive. 4 GB will allow comfortable work with a database of up to 20,000-30,000 contacts. For more active campaigns or larger databases, 8 GB is recommended.
  • Disk (Storage): Minimum 80 GB NVMe SSD. SSD drives significantly speed up database operations and Mautic file loading. NVMe provides maximum performance. 80 GB is enough for the system itself, Mautic, and tens of thousands of contacts with their activities. If you plan to store many images, videos, or other media files, more space will be required.
  • Network: 1 Gbit/s port with unlimited traffic (or sufficient volume, e.g., 10 TB/month). Mautic actively interacts with external SMTP services for mailings and processes requests from web forms and tracking pixels, so a stable and fast network connection is essential.

Recommended VPS Plan for Starting:

For most beginner and medium projects (up to 50,000 contacts, up to 10 active campaigns), a VPS with the following characteristics will be optimal:

  • CPU: 4 cores
  • RAM: 8 GB
  • Disk: 160-200 GB NVMe SSD
  • Network: 1 Gbit/s, 10 TB traffic

You can consider VPS with the specified characteristics or similar offers from other providers.

When a dedicated server is needed, not a VPS

A dedicated server becomes necessary when your project reaches truly large scales:

  • The contact database exceeds 200,000-500,000.
  • You send millions of emails per month.
  • You simultaneously have dozens of complex campaigns active with many steps and segments.
  • Maximum database performance and PHP processing are required without the influence of "neighbors" on the VPS.
  • Strict compliance requirements arise that are best met on fully isolated hardware.

In such cases, a suitable dedicated server typically includes 8+ CPU cores, 32+ GB RAM, and several NVMe SSDs in a RAID array. You can choose a suitable dedicated server for such tasks.

Location: What it affects

The choice of VPS location affects several factors:

  • User access speed: Place the server closer to your target audience to reduce latency when loading forms, landing pages, and tracking scripts.
  • Data legislation (GDPR, CCPA): If you work with personal data, ensure that the server location complies with local data protection laws.
  • Mailing speed: Although most SMTP providers have global networks, physical proximity to them can slightly affect delivery speed.

It is generally recommended to choose a server location in the region where most of your customers reside or where your main business is located.

Server Preparation

Diagram: Server Preparation
Diagram: Server Preparation

Before installing Mautic, you need to perform basic setup of your new VPS. We will use Ubuntu Server 24.04 LTS (or 26.04 LTS, if it becomes available and stable by 2026) as the operating system. These steps will ensure the security and stability of your system.

1. SSH Connection and System Update

First, connect to your VPS as the root user, using the IP address provided by your provider. Replace your_vps_ip with your server's actual IP address.


ssh root@your_vps_ip
# Enter root password if prompted

After a successful connection, update the package list and all installed packages to the latest versions. This ensures you have the freshest security patches and new features.


sudo apt update && sudo apt upgrade -y
# Update package list and all installed packages

2. Creating a New User with Sudo Privileges

Working as the root user is unsafe. Let's create a new user with limited privileges and add them to the sudo group.


adduser mauticuser
# Create a new user 'mauticuser'
# Follow the prompts: enter a password, then you can skip user information
sudo usermod -aG sudo mauticuser
# Add 'mauticuser' to the sudo group so they can execute commands with administrator privileges

3. Setting Up SSH Keys (Recommended)

For increased security, use SSH keys instead of passwords. First, generate a key on your local machine (if you don't have one already):


# On your local machine
ssh-keygen -t ed25519 -C "[email protected]"
# Generate a new Ed25519 type SSH key

Then, copy the public key to your VPS for the mauticuser:


# On your local machine
ssh-copy-id mauticuser@your_vps_ip
# Copy the public SSH key to the server

Now you can connect to the server as mauticuser without a password:


ssh mauticuser@your_vps_ip
# Connect to the server as 'mauticuser'

4. Disabling Password Authentication for Root (after SSH key setup)

Edit the SSH daemon configuration file to disallow password login for root and disable password authentication entirely (after successfully setting up SSH keys).


sudo nano /etc/ssh/sshd_config
# Open the SSH daemon configuration file

Find and change the following lines (or add them if they don't exist):


PermitRootLogin prohibit-password
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

Save changes (Ctrl+O, Enter) and exit (Ctrl+X). Then restart the SSH service:


sudo systemctl restart sshd
# Restart SSH service to apply changes

5. Configuring UFW Firewall

Install and configure Uncomplicated Firewall (UFW) to allow only necessary connections.


sudo apt install ufw -y
# Install UFW
sudo ufw allow OpenSSH
# Allow SSH connections (port 22)
sudo ufw allow 'Nginx Full'
# Allow HTTP (port 80) and HTTPS (port 443) for the Nginx web server
sudo ufw enable
# Enable the firewall. Confirm with 'y'
sudo ufw status
# Check firewall status

6. Installing Fail2Ban

Fail2Ban protects your server from brute-force attacks by blocking IP addresses that make too many failed login attempts.


sudo apt install fail2ban -y
# Install Fail2Ban
sudo systemctl enable fail2ban
# Enable automatic startup of Fail2Ban on system boot
sudo systemctl start fail2ban
# Start the Fail2Ban service
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
# Copy the main config to create a local version
# This will allow your changes to persist when Fail2Ban is updated
sudo nano /etc/fail2ban/jail.local
# Open the file and ensure sshd is enabled (enabled = true)
# You can adjust bantime, findtime, maxretry as desired

After making changes in jail.local, restart Fail2Ban:


sudo systemctl restart fail2ban
# Restart Fail2Ban to apply new settings

Your server is now basically configured and secured. You can proceed to install the main software.

Software Installation — Step-by-Step

Software Installation — Step-by-Step

Diagram: Software Installation — Step-by-Step
Diagram: Software Installation — Step-by-Step

Mautic requires a web server (Nginx), a PHP interpreter with necessary extensions, and a database (MySQL) to function. We will install the current versions of these components, which will be stable and supported by 2026.

1. Nginx Installation

Nginx will act as the web server, handling requests to Mautic. We use it due to its high performance and low resource consumption.


sudo apt install nginx -y
# Install Nginx web server
sudo systemctl enable nginx
# Enable Nginx for automatic startup on system boot
sudo systemctl start nginx
# Start Nginx service

Verify that Nginx is running by opening your server's IP address in a browser. You should see the standard Nginx welcome page.

2. MySQL Server Installation

Mautic uses a database to store all information: contacts, campaigns, settings. MySQL 8.0+ is an excellent choice.


sudo apt install mysql-server -y
# Install MySQL server (version 8.0 or higher)
sudo mysql_secure_installation
# Run script to enhance MySQL security
# Follow the instructions:
# - Set up validate password plugin (recommended)
# - Set a strong password for the MySQL root user
# - Remove anonymous users
# - Disallow remote root login
# - Remove test database
# - Reload privilege tables

3. PHP and Required Extensions Installation

Mautic 5.x and future Mautic 6.x versions (current for 2026) require PHP 8.3 or newer. We will install PHP 8.3/8.4 and all necessary extensions.


sudo apt install php8.3-fpm php8.3-mysql php8.3-cli php8.3-gd php8.3-curl php8.3-intl php8.3-zip php8.3-mbstring php8.3-xml php8.3-soap php8.3-opcache php8.3-bcmath php8.3-gmp php8.3-imagick -y
# Install PHP-FPM (FastCGI Process Manager) and all necessary extensions
sudo systemctl enable php8.3-fpm
# Enable PHP-FPM for automatic startup
sudo systemctl start php8.3-fpm
# Start PHP-FPM service

For Mautic, it is also recommended to increase PHP memory and execution time limits. Edit the file php.ini:


sudo nano /etc/php/8.3/fpm/php.ini
# Open PHP configuration file for PHP-FPM

Find and change the following values:


memory_limit = 512M
max_execution_time = 300
date.timezone = Europe/Moscow ; Set your timezone

Save changes and exit. Then restart PHP-FPM:


sudo systemctl restart php8.3-fpm
# Restart PHP-FPM to apply new settings

4. Creating a Database for Mautic

Connect to MySQL as the root user and create a new database and user for Mautic.


sudo mysql -u root -p
# Connect to MySQL as root
# Enter the MySQL root password you set earlier

Inside the MySQL console, execute the following commands. Replace mautic_db, mautic_user, and strong_password with your own values.


CREATE DATABASE mautic_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# Create database for Mautic
CREATE USER 'mautic_user'@'localhost' IDENTIFIED BY 'strong_password';
# Create user for Mautic
GRANT ALL PRIVILEGES ON mautic_db. TO 'mautic_user'@'localhost';
# Grant all privileges to the user on the database
FLUSH PRIVILEGES;
# Reload privileges
EXIT;
# Exit MySQL console

5. Downloading and Installing Mautic

Navigate to the directory where Mautic files will be stored and download the latest stable version. By 2026, this will likely be Mautic 5.x or 6.x. We will use the official GitHub repository for download.


cd /var/www/
# Navigate to the web directory
sudo mkdir mautic
# Create directory for Mautic
sudo chown mauticuser:www-data mautic
# Set directory owner to mauticuser and group to www-data
sudo chmod 775 mautic
# Set directory permissions
cd mautic
# Navigate to Mautic directory
sudo apt install unzip -y
# Install archive extraction utility
wget https://github.com/mautic/mautic/releases/download/5.1.0/5.1.0-update.zip -O mautic.zip
# Download the latest stable version of Mautic (e.g., 5.1.0, update the link to the current one!)
# In 2026, the link will be for Mautic 5.x or 6.x, e.g., https://github.com/mautic/mautic/releases/download/6.0.0/6.0.0-update.zip
sudo unzip mautic.zip -d .
# Extract archive to current directory
sudo rm mautic.zip
# Remove archive
sudo chown -R mauticuser:www-data /var/www/mautic
# Set owner for all Mautic files
sudo find /var/www/mautic -type d -exec chmod 755 {} \;
# Set 755 permissions for all directories
sudo find /var/www/mautic -type f -exec chmod 644 {} \;
# Set 644 permissions for all files
sudo chmod -R 775 /var/www/mautic/var
# Set permissions for var directory (cache, logs)
sudo chmod -R 775 /var/www/mautic/media
# Set permissions for media directory
sudo chmod -R 775 /var/www/mautic/app/cache
# Set permissions for app/cache directory
sudo chmod -R 775 /var/www/mautic/app/logs
# Set permissions for app/logs directory

Now all components are installed, and Mautic is ready for further configuration.

Configuration

Diagram: Configuration
Diagram: Configuration

After installing all components, you need to configure Nginx to serve Mautic, ensure an HTTPS connection, and perform the initial setup of Mautic itself.

1. Nginx Configuration for Mautic

Create a new Nginx configuration file for your domain. Replace your_domain.com with your actual domain.


sudo nano /etc/nginx/sites-available/your_domain.com
# Create a new Nginx configuration file

Insert the following Nginx config:


server {
    listen 80;
    server_name your_domain.com www.your_domain.com;
    root /var/www/mautic/docroot; # Mautic 5.x+ uses the docroot subdirectory

    index index.php index.html index.htm;

    error_log /var/log/nginx/mautic_error.log;
    access_log /var/log/nginx/mautic_access.log;

    client_max_body_size 100M; # Increase the limit for uploaded file size

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /(app|bin|cache|translations|vendor|src)/ {
        deny all;
        return 404;
    }

    location ~ /(composer.json|composer.lock|nginx.conf|Dockerfile) {
        deny all;
        return 404;
    }

    # For Mautic 5.x+, using /media/images/ is recommended
    location ~ ^/media/images/(.)$ {
        try_files $uri @asset;
        expires max;
        add_header Cache-Control "public";
    }

    location @asset {
        rewrite ^/media/images/(.)$ /media/images/$1 break;
        proxy_pass http://127.0.0.1:8000; # Replace with your PHP-FPM socket if Nginx is not used
    }
}

Save the file and exit. Then activate the configuration by creating a symbolic link and check the Nginx syntax:


sudo ln -s /etc/nginx/sites-available/your_domain.com /etc/nginx/sites-enabled/
# Activate Nginx configuration
sudo nginx -t
# Check Nginx configuration syntax
sudo systemctl restart nginx
# Restart Nginx to apply changes

Now, if you enter http://your_domain.com in your browser, you should see the Mautic installation page.

2. HTTPS Configuration with Certbot (Let's Encrypt)

For a secure connection and improved SEO trust, we will configure HTTPS using free Let's Encrypt certificates via Certbot.


sudo apt install certbot python3-certbot-nginx -y
# Install Certbot and Nginx plugin
sudo certbot --nginx -d your_domain.com -d www.your_domain.com
# Run Certbot to obtain and install certificates
# Follow the instructions: enter email, agree to terms, choose HTTP to HTTPS redirection

Certbot will automatically modify your Nginx config, adding sections for HTTPS. It will also configure automatic certificate renewal. You can check the status of automatic renewal as follows:


sudo systemctl status certbot.timer
# Check Certbot timer status for automatic renewal
sudo certbot renew --dry-run
# Test run for certificate renewal

3. Completing Mautic Installation via Web Interface

Open your domain (https://your_domain.com) in your browser. You will see the Mautic installation page. Follow these steps:

  1. Step 1: Permissions. Ensure all permissions are marked green.
  2. Step 2: Database Configuration. Enter the details you created earlier:
    • Database Driver: MySQL PDO
    • Database Host: localhost
    • Database Port: 3306
    • Database Name: mautic_db
    • Database Username: mautic_user
    • Database Password: strong_password
    • Table Prefix: (can be left empty or set to mt_)
  3. Step 3: Administrator Configuration. Create a Mautic administrator account. Use a strong password.
  4. Step 4: Email Configuration. Configure an SMTP server for sending emails. It is recommended to use an external service (SendGrid, Mailgun, Amazon SES) instead of direct SMTP from a VPS to avoid deliverability issues.

Upon completion, you will be redirected to the Mautic admin panel login page.

4. Configuring Cron Jobs for Mautic

Mautic requires regular background tasks (email queue processing, segmentation, data updates). These tasks are configured via Cron.


sudo -u mauticuser crontab -e
# Open crontab for user mauticuser

Insert the following lines at the end of the file (ensure the path to PHP CLI is correct, in this case /usr/bin/php8.3):


# Mautic Cron Jobs
5,20,35,50     /usr/bin/php8.3 /var/www/mautic/bin/console mautic:segments:update > /dev/null 2>&1
# Update segments (every 15 minutes)
10,25,40,55     /usr/bin/php8.3 /var/www/mautic/bin/console mautic:campaigns:update > /dev/null 2>&1
# Update campaigns (every 15 minutes)
0,15,30,45     /usr/bin/php8.3 /var/www/mautic/bin/console mautic:campaigns:trigger > /dev/null 2>&1
# Trigger campaigns (every 15 minutes)
0,30     /usr/bin/php8.3 /var/www/mautic/bin/console mautic:emails:send > /dev/null 2>&1
# Send emails from queue (every 30 minutes)
0 0    /usr/bin/php8.3 /var/www/mautic/bin/console mautic:maintenance:cleanup --days=365 > /dev/null 2>&1
# Clean up old data (once a day, e.g., logs older than 365 days)
0 2    /usr/bin/php8.3 /var/www/mautic/bin/console mautic:webhooks:send > /dev/null 2>&1
# Send webhooks (once a day)

Save and close the file. Cron jobs will run automatically.

5. Verifying Functionality

Ensure that Mautic is accessible and functioning correctly.


curl -I https://your_domain.com
# Check HTTP headers of your domain. Should show 200 OK status and HTTPS redirection.

Log in to the Mautic admin panel. Go to "Settings" -> "System Info". Ensure all components are marked as operational and there are no critical errors.

Backups and Maintenance

Diagram: Backups and Maintenance
Diagram: Backups and Maintenance

Regular backups and timely maintenance are key to Mautic's stable and secure operation. In this section, we will cover what exactly needs to be backed up, how to automate the process, and how to keep the system up-to-date.

1. What to Back Up

For a full Mautic recovery, you will need three main data groups:

  • Mautic Database: Contains all your contacts, campaigns, segments, emails, reports, and other dynamic data. This is the most critical component.
  • Mautic Files: Include the Mautic core, plugins, themes, uploaded media files (images, documents), and configuration files. The directory is /var/www/mautic/.
  • Server Configuration Files: Nginx, PHP-FPM, Certbot, Fail2Ban, UFW settings. While these can be restored manually, a backup will speed up the process.

2. Simple Auto-Backup Script (cron + rsync + mysqldump)

Let's create a simple script that will back up the database and files, and then save them to a separate directory. For storing backups, it is recommended to use external storage, such as S3-compatible cloud storage or a separate VPS.


sudo mkdir -p /opt/backups/mautic
# Create directory for backups
sudo chown mauticuser:mauticuser /opt/backups/mautic
# Set owner for backup directory
sudo nano /opt/backups/mautic_backup.sh
# Create backup script

Insert the following code into the mautic_backup.sh file. Replace mautic_user, strong_password, mautic_db with your data. Also, specify the path to external storage if it is used.


#!/bin/bash

# Database parameters
DB_USER="mautic_user"
DB_PASS="strong_password"
DB_NAME="mautic_db"

# Paths
MAUTIC_ROOT="/var/www/mautic"
BACKUP_DIR="/opt/backups/mautic"
DATE=$(date +%Y%m%d%H%M%S)
KEEP_DAYS=7 # How many days to keep backups

# 1. Database backup
echo "Dumping database..."
mysqldump -u ${DB_USER} -p"${DB_PASS}" ${DB_NAME} | gzip > ${BACKUP_DIR}/mautic_db_${DATE}.sql.gz

if [ $? -eq 0 ]; then
    echo "Database backup created: ${BACKUP_DIR}/mautic_db_${DATE}.sql.gz"
else
    echo "Error: Database backup failed!"
    exit 1
fi

# 2. Mautic files backup (without cache and logs)
echo "Archiving Mautic files..."
tar -czf ${BACKUP_DIR}/mautic_files_${DATE}.tar.gz \
    --exclude='${MAUTIC_ROOT}/var/cache/' \
    --exclude='${MAUTIC_ROOT}/var/logs/' \
    --exclude='${MAUTIC_ROOT}/vendor/' \
    ${MAUTIC_ROOT}

if [ $? -eq 0 ]; then
    echo "Mautic files backup created: ${BACKUP_DIR}/mautic_files_${DATE}.tar.gz"
else
    echo "Error: Mautic files backup failed!"
    exit 1
fi

# 3. Clean up old backups
echo "Cleaning up old backups..."
find ${BACKUP_DIR} -type f -name "mautic_db_.sql.gz" -mtime +${KEEP_DAYS} -delete
find ${BACKUP_DIR} -type f -name "mautic_files_.tar.gz" -mtime +${KEEP_DAYS} -delete
echo "Old backups cleaned."

# 4. Synchronization with external storage (example for rsync)
# If you have an external server or S3 bucket, configure synchronization here.
# For example, for rsync:
# rsync -avz --delete ${BACKUP_DIR}/ user@remote_server:/path/to/remote/backups/
# For S3-compatible storage, use s3cmd or aws cli

echo "Backup process finished."

Make the script executable:


sudo chmod +x /opt/backups/mautic_backup.sh
# Make the script executable

Add the script to the mauticuser crontab for daily execution:


sudo -u mauticuser crontab -e
# Open crontab for mauticuser

Add the following line to the end of the file, for example, to run at 3:00 AM:


0 3    /opt/backups/mautic_backup.sh > /dev/null 2>&1
# Daily backup script run at 3:00 AM

3. Where to Store Backups

Never store backups on the same server as your live data. This negates the purpose of a backup if the server fails. Recommended options:

  • External S3-compatible storage: Cloud services (Amazon S3, DigitalOcean Spaces, Backblaze B2) offer reliable and inexpensive storage. Use utilities like s3cmd or rclone for synchronization.
  • Separate VPS or dedicated server: You can use another server exclusively for storing backups, synchronizing them via SSH using rsync.
  • Local storage with synchronization: For very small projects, backups can be temporarily stored locally, but it is essential to configure their automatic upload to a cloud drive (Google Drive, Dropbox) using scripts.

4. Updates: rolling vs maintenance window

Keeping Mautic and all system components up-to-date is critically important for security and new features. Use the following strategy:

  • OS Updates (Ubuntu): Perform sudo apt update && sudo apt upgrade -y regularly, for example, once a week. If a kernel reboot is required, plan a server reboot.
  • PHP, Nginx, MySQL Updates: These components are usually updated along with the OS. However, when upgrading to a new major version (e.g., from PHP 8.3 to 8.4), plan this as a separate maintenance window, as changes to Mautic's configuration or code may be required.
  • Mautic Updates: Mautic releases regular updates (patches, minor, and major versions).
    • Patches and minor updates (5.1.0 -> 5.1.1): Can usually be applied in a "rolling" fashion, but it is always recommended to make a backup before updating. Use the command php /var/www/mautic/bin/console mautic:update:find and then php /var/www/mautic/bin/console mautic:update:apply.
    • Major updates (5.x -> 6.x): Require planning a "maintenance window". Study the official Mautic upgrade documentation in advance, as there may be changes to PHP requirements, database structure, or the file system. Always perform a full backup before such an update.

Always test updates on a staging server, if possible, before applying them to production. If there is no staging server, carefully review the changelog and perform a backup.

Troubleshooting + FAQ

Even with the most careful setup, problems can arise. This section will help you diagnose and resolve the most common ones, as well as answer frequently asked questions.

Mautic shows a 500 Internal Server Error or a blank page

What to check:

  1. Nginx Logs: Check /var/log/nginx/mautic_error.log.
  2. PHP-FPM Logs: Check /var/log/php8.3-fpm.log (or similar path).
  3. Mautic Logs: Check /var/www/mautic/var/logs/mautic_prod.php.
  4. File Permissions: Ensure that the www-data user (or the user under which Nginx and PHP-FPM run) has read/write permissions in the Mautic directory, especially in /var/www/mautic/var. Execute sudo chown -R www-data:www-data /var/www/mautic and sudo chmod -R 775 /var/www/mautic.
  5. PHP Limits: Ensure that memory_limit and max_execution_time in php.ini are sufficient (e.g., 512M and 300).
How to fix: Based on the logs, resolve the issue. Most often, these are incorrect permissions, insufficient memory, or syntax errors in the PHP/Nginx configuration.

Emails are not being sent from Mautic

What to check:

  1. SMTP Settings in Mautic: In "Settings" -> "Configuration" -> "Email Settings". Ensure that the SMTP server details (host, port, username, password) are correct and that you are using a reliable external SMTP provider.
  2. Mautic Logs: Look for errors related to email sending in /var/www/mautic/var/logs/mautic_prod.php.
  3. Cron Jobs: Ensure that mautic:emails:send runs regularly (sudo -u mauticuser crontab -l).
  4. Spam Filters: Ensure your domain is correctly configured (SPF, DKIM, DMARC records in DNS) to avoid emails landing in spam.
How to fix: Correct SMTP data, ensure cron is working, check your domain's DNS records.

Mautic runs slowly or freezes with large data volumes

What to check:

  1. Server Resources: Use htop, free -h, df -h to monitor CPU, RAM, and disk. Are resources insufficient?
  2. MySQL Logs: Look for slow queries.
  3. Database Indexes: Ensure that MySQL correctly indexes Mautic tables.
  4. Mautic Cache: Ensure that the cache is working (Mautic uses file cache by default; Redis can be configured for large installations).
  5. Cron Jobs: Ensure they do not overlap and run in a timely manner, without creating excessive load.
How to fix: Increase VPS resources, optimize queries (database specialist assistance may be required), consider using Redis for caching if the load is very high.

What is the minimum suitable VPS configuration?

For a test installation or a very small project (up to 5000 contacts, 1-2 campaigns), you can start with 2 CPU cores, 4 GB RAM, and 80 GB NVMe SSD. However, as soon as you start actively using Mautic, it is recommended to upgrade to a configuration with 4 cores, 8 GB RAM, and 160+ GB NVMe SSD to ensure stable and fast operation.

What to choose — VPS or dedicated for this task?

For most users starting with Mautic, a VPS is the optimal choice. It offers sufficient flexibility, performance, and cost-effectiveness. A dedicated server becomes justified for very large data volumes (hundreds of thousands of contacts), high sending frequency (millions of emails per month), or if you have strict requirements for complete resource isolation and maximum performance that a VPS cannot provide due to virtualization.

How to update Mautic?

Log in to Mautic as an administrator. Go to "Settings" (gear icon in the top right corner) -> "Components" -> "Update Mautic". If an update is available, Mautic will offer to install it. You can also update via CLI using the commands php /var/www/mautic/bin/console mautic:update:find and php /var/www/mautic/bin/console mautic:update:apply. Always make a backup before updating!

How to increase the file upload limit in Mautic?

Increase the values of upload_max_filesize and post_max_size in the /etc/php/8.3/fpm/php.ini file. Also, ensure that in the Nginx configuration (/etc/nginx/sites-available/your_domain.com), the client_max_body_size parameter is set to a sufficient value (e.g., 100M). After making changes, restart PHP-FPM and Nginx.

Conclusions and Next Steps

Diagram: Conclusions and Next Steps
Diagram: Conclusions and Next Steps

Congratulations! You have successfully deployed and configured Mautic on your VPS. You now have a powerful and flexible marketing automation tool that is entirely under your control. You have gained not only a functional platform but also valuable experience in configuring server infrastructure, which will be useful for any future projects.

Here are a few steps you can take to maximize the effective use of your Mautic:

  • Integration with CRM and other services: Mautic has many plugins for integration with popular CRM systems (Salesforce, HubSpot, Zoho CRM), CMS (WordPress, Drupal), as well as external SMTP providers to improve email deliverability. Explore available plugins and configure them to your needs.
  • Performance Optimization: For large installations, consider using Redis or Memcached for caching, as well as configuring MySQL optimization. Horizontal scaling may be required if the load becomes too high.
  • Enhanced Security: Further strengthen security by setting up two-factor authentication for Mautic login, using more complex rules for Fail2Ban, and regularly conducting server security audits.

Чи був цей гайд корисним?

Ваш відгук допомагає нам покращувати гайди.

Share this post:

Надішліть гайд тому, кому він може стати в пригоді.

Telegram VKVK WhatsApp Facebook LinkedIn XX

Mautic deployment on VPS for marketing automation and email marketing
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.