Mautic is an open-source marketing automation platform for email campaigns, contact tracking, lead nurturing, and analytics, a self-hosted alternative to HubSpot or Marketo with full control over your data. This guide installs Mautic on Ubuntu 24.04 with a LEMP stack (Nginx, MySQL, PHP), sets up cron jobs for background processing, and walks through campaigns, segments, forms, and landing pages.
Prerequisites: Ubuntu 24.04 instance, non-root sudo user, domain A record pointing at the instance (e.g. mautic.example.com).
Install the LEMP Stack
1. Install Nginx, MySQL, and PHP first (see a standard LEMP guide), then verify each:
$ nginx -v
$ mysql --version
$ php -v
2. Install PHP extensions Mautic needs:
$ sudo apt install php-fpm php-mysql php-imap php-curl php-json php-gd php-xml php-mbstring php-zip php-intl php-bcmath php-opcache php-cli unzip -y
3. Remove Apache if it was pulled in as a dependency (conflicts with Nginx):
$ sudo apt remove apache2 -y
4. Tune PHP-FPM. Edit /etc/php/8.3/fpm/php.ini (replace 8.3 with your version):
$ sudo nano /etc/php/8.3/fpm/php.ini
memory_limit = 512M
upload_max_filesize = 50M
post_max_size = 50M
date.timezone = UTC
cgi.fix_pathinfo=0
5. Restart PHP-FPM:
$ sudo systemctl restart php8.3-fpm
Create the Database
$ mysql -u root -p
mysql> CREATE DATABASE mauticdb;
mysql> CREATE USER 'mauticuser'@'localhost' IDENTIFIED BY 'securepassword';
mysql> GRANT ALL PRIVILEGES ON mauticdb.* TO 'mauticuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
Install Mautic
1. Download and extract the latest release:
$ wget https://github.com/mautic/mautic/archive/refs/tags/6.0.0.zip
$ unzip 6.0.0.zip
$ sudo mv mautic-6.0.0 /var/www/html/mautic
2. Fix ownership:
$ sudo chown -R www-data:www-data /var/www/html/mautic
$ sudo chown www-data:www-data /var/www
3. Install Composer and npm, then verify:
$ sudo apt install composer npm -y
$ composer --version
$ npm --version
4. Install dependencies and set permissions:
$ cd /var/www/html/mautic
$ sudo -u www-data composer install
$ sudo chmod -R 755 /var/www/html/mautic
Configure Nginx, TLS, and Cron
1. Create the vhost:
$ sudo nano /etc/nginx/conf.d/mautic.conf
server {
listen 80;
server_name mautic.example.com;
root /var/www/html/mautic;
index index.php;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
}
2. Test and reload:
$ sudo nginx -t
$ sudo systemctl reload nginx
3. Open the firewall and issue a certificate:
$ sudo ufw allow 80/tcp
$ sudo ufw allow 443/tcp
$ sudo ufw reload
$ sudo snap install certbot --classic
$ sudo certbot --nginx --redirect -d mautic.example.com -m hello@example.com --agree-tos
Verify renewal works:
$ sudo certbot renew --dry-run
4. Add cron jobs for background processing — segments, campaigns, email queue, imports, bounce fetch:
$ sudo -u www-data crontab -e
* * * * * php8.3 /var/www/html/mautic/bin/console mautic:segments:update > /dev/null
5-59/15 * * * * php8.3 /var/www/html/mautic/bin/console mautic:campaigns:update > /dev/null
10-59/15 * * * * php8.3 /var/www/html/mautic/bin/console mautic:campaigns:trigger > /dev/null
2-59/15 * * * * php8.3 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null
* * * * * php8.3 /var/www/html/mautic/bin/console mautic:import > /dev/null
@hourly php8.3 /var/www/html/mautic/bin/console mautic:email:fetch
Run the Web Installer
Visit https://mautic.example.com. You'll land on Ready to install. Click through:
-
Database Setup — driver MySQL PDO, host
localhost, the database/user/password created earlier. - Admin user — username, password, recovery email.
- Log in with the admin credentials you just set.
Core Features
The dashboard is your hub for contacts, emails, campaigns, forms, and more.
- Stages — track a contact's position in the funnel; assign via behavior, campaigns, or external events.
- Companies — group contacts under a business entity for B2B segmentation/reporting.
- Contacts — capture leads with tags, company links, owners, and stage assignment.
- Segments — dynamic, auto-updating filtered groups used for campaign targeting.
- Assets — host white papers, PDFs, or other downloadable content (local or remote storage).
- Forms — Campaign Forms (used inside campaign workflows) or Standalone Forms (embedded anywhere), built with a drag-and-drop field/action editor.
- Landing Pages — theme-based or visual-builder pages for opt-ins, webinars, gated content.
- Campaigns — drag-and-drop drip workflows driven by sources (segment/form), actions (send email, adjust points), decisions (opens/visits), and conditions (field match).
- Emails — Triggered (campaign/form/points-driven, repeatable) or Segment (one-time newsletter-style) types, built in the visual editor.
- Points — assign/subtract points on contact actions (Point Actions) and fire automated responses once a threshold is hit (Point Triggers), for lead scoring.
Next Steps
Mautic is running on Ubuntu 24.04 with a full LEMP stack, TLS, and cron-driven background processing. From here:
- Build a lead-scoring model with Points and route hot leads via a Point Trigger
- Wire a Standalone Form + Landing Page combo for a lead-gen campaign
- Segment contacts by engagement and connect a drip Campaign for nurture sequences
For the full guide with additional tips, visit the original article on Vultr Docs.
Top comments (0)