Self-Hosted Open Source Email Marketing Automation with Mautic: Step-by-Step Guide

Self-Hosted Open Source Email Marketing Automation with Mautic: Step-by-Step Guide Hero Image

Are you tired of watching your email marketing budget swell like a neglected hot air balloon — slowly, helplessly, until it’s ready to burst and your CFO starts giving you the side-eye? You know the drill: you start with a “free” account on one of those shiny SaaS platforms, only to realize the “free” is just a gateway drug to a $200/month habit. By the time you hit 2,000 contacts and discover you can’t even send plaintext emails without upgrading to the Platinum Diamond Unicorn tier, you’ve already handed over your marketing soul.

Enter Mautic — the open-source, self-hosted marketing automation tool that lets you tell the Mailchimps, HubSpots, and ActiveCampaigns of the world to take a hike. (Preferably in very expensive, branded hiking boots they’ll try to upsell you.) Mautic puts you in the driver’s seat: unlimited contacts, advanced segmentation, lead scoring, dynamic content, and campaigns so automated they make a Roomba look lazy — all without a single monthly subscription fee for the software itself.

But wait, you mutter: “Self-hosted? Doesn’t that mean I need a PhD in server wizardry?” Not quite. With today’s cloud VPS providers and a sprinkle of “I can copy-paste commands,” you’ll have Mautic up and running in an afternoon. And the best part? Your total monthly cost will be less than a couple of overpriced oat milk lattes, while your competitors are still pre-authorizing their corporate credit cards for a “premium drag-and-drop editor.”

In this guide, I’ll walk you through a full Mautic install — from renting a dirt-cheap server to sending your first campaign — with just the right amount of snark, practical advice, and absolutely zero upselling to an “enterprise licensing agreement.” Let’s democratize your email marketing, one cron job at a time.

Why Ditch the SaaS Overlords? The Case for Mautic

Before we get our hands dirty with the command line, let’s pour one out for the corporate email graveyards we’re leaving behind. You know the pain points: contact-based pricing that penalises growth, feature gating so aggressive you’d think they sell castle moats, and the creeping dread that at any moment your account could lose that one integration you actually used.

Mautic flips the script:

  • Unlimited Everything: Contacts, emails, segments, campaigns. The only limit is your server’s CPU and disk, and honestly, a $6 VPS handles tens of thousands of contacts without breaking a sweat.
  • True White Label & Brand Control: You’re not forced to display “Powered by M@ilchimpanzee” anywhere. It’s yours. Slap your logo on it and tell your clients you built it from scratch (I won’t tell).
  • Data Ownership: Your contact data lives in your database, on your server, not in some ambiguous “cloud region” that happens to be in a jurisdiction you’ve never visited. GDPR lovers, rejoice.
  • Extensible & Hackable: Plugins, APIs, custom integrations. Want to trigger an email when someone’s IoT cat feeder goes empty? Go for it. The source code is available — you’re not chasing feature request #48,221 on a Trello board that hasn’t been updated since the Obama administration.

Sure, self-hosting means you’re responsible for updates and security. But honestly, that’s a small price to pay for not having a “Customer Success Manager” who only contacts you to upsell a co-branded webinar. If you can handle a WordPress site, you can handle Mautic. Even if you can’t, we’re going to make it brainlessly simple.

What You’ll Need: The Shopping List (Budget Edition)

Here’s your battle kit — no corporate procurement forms required.

  • A VPS (Virtual Private Server) – You need a Linux server with at least 1 vCPU and 2 GB RAM. Think of this as your own little digital fortress. I recommend spinning one up on either DigitalOcean (dead-simple UI, great tutorials) or Hetzner (absurdly cheap, German-engineered reliability). Both offer droplets/instances for around $5–$6/month, which is less than you pay for the electricity to run the SaaS vendor’s data centre.
  • A Domain Name – Something like mautic.yourcompany.com. If you don’t already own one, grab one from your favourite registrar (Namecheap, Cloudflare Registrar, etc.). I’m not linking those because they don’t need the SEO boost, but you know the drill.
  • An SMTP Service (optional but recommended) – Mautic sends emails. Your VPS can act as an SMTP server, but for deliverability’s sake, you’ll likely want a transactional email relay like Amazon SES (dirt cheap, $1 per 10,000 emails) or Mailgun’s free tier. Because nothing says “trustworthy” like an email coming from an IP address that Google hasn’t yet flagged as a potato farm.
  • A VPN for Secure Access – Picture this: you’re tweaking your Mautic campaign from a coffee shop’s public Wi-Fi, logging into your server via SSH. It’s basically an invitation for script kiddies to sniff your credentials. A quality VPN like NordVPN encrypts your traffic, keeping your login details safe from prying eyes and letting you pretend you’re working from a tropical island when you’re really just in your basement. Yes, it’s a paid product, but so is the dignity of not getting your server hijacked by crypto miners.
  • Patience & Coffee – Optional but highly correlated with success.

Once you’ve gathered these, you’re ready to start. I promise the hardest part is choosing a password you won’t forget five minutes later.

Step 1: Spinning Up a Server (Cheaper Than a Latte)

Head to your VPS provider of choice. For this guide, I’ll assume DigitalOcean (because their droplets and documentation are friendly to newcomers), but the commands work identically on Hetzner or any Ubuntu machine.

  1. Create a new Droplet/Instance:

    • Choose Ubuntu 22.04 LTS (or 24.04 if you’re feeling adventurous).
    • Select the “Basic” plan with 1 GB RAM / 1 vCPU for small-scale testing, or bump to 2 GB RAM if you plan to handle a few thousand contacts. Mautic officially recommends 2 GB RAM, but 1 GB works if you monitor it. Don’t try to run it on a potato — even a $4 VPS is more powerful than 90% of the shared hosting sold as “business class.”
    • Add your SSH key for passwordless login. If you’ve never done this, take five minutes now. It’s 2025 — we don’t log in with username root and password 123456 unless we want to join a botnet before we finish installing PHP.
  2. Point your domain: Once the server is alive, note its IP address and create an A record (e.g., mautic.yourdomain.com) pointing to that IP. You can do this in your DNS manager. It might take a few minutes to propagate. Go make that coffee.

  3. Secure the fort: SSH into your server (ssh root@your_ip). Update everything with a quick apt update && apt upgrade -y. This is the digital equivalent of locking your front door; skipping it is a choice, but not a smart one.

Now you’re standing in a fresh terminal, blinking cursor and all. The silence is soothing — unlike the noise of a SaaS dashboard filled with pop-up “upgrade now” modals.

Advertisement

Step 2: The LAMP Stack Dance (Mautic Needs Friends)

Mautic is a PHP application that runs on a web server with MySQL/MariaDB. We’re going to install Apache, MySQL, and PHP — the classic LAMP stack. Yes, we could use Nginx, but Apache is more “copy-paste-and-forget” for beginners, and we’re optimising for your caffeine intake, not nginx config purity.

Run the following commands sequentially. They look scary but are essentially digital assembly instructions.

# Install Apache and MySQL (MariaDB)
apt install apache2 mariadb-server unzip -y

# Secure the database (answer yes to everything, set a strong root password)
mysql_secure_installation

# Install PHP and required extensions for Mautic 5.x (check Mautic docs for latest)
apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-zip php-intl php-curl php-gd php-imagick php-bcmath php-soap -y

Once that’s done, we create a database for Mautic:

mysql -u root -p

Then inside the MySQL prompt:

CREATE DATABASE mauticdb;
CREATE USER 'mauticuser'@'localhost' IDENTIFIED BY 'YourSuperSecretPassword';
GRANT ALL PRIVILEGES ON mauticdb.* TO 'mauticuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Remember to replace that lame password with something resembling a cat walking on a keyboard.

Step 3: Downloading Mautic — The Free Stuff

I love free software that doesn’t ask for my credit card “just to verify my identity.” Let’s grab Mautic.

cd /var/www/
wget https://github.com/mautic/mautic/releases/download/5.2.0/5.2.0.zip  # Check for latest version
unzip 5.2.0.zip -d mautic
rm 5.2.0.zip
chown -R www-data:www-data /var/www/mautic/

Now we need to configure Apache to serve our Mautic directory as your domain. Create a new virtual host file:

nano /etc/apache2/sites-available/mautic.conf

Paste this (adjust ServerName and DocumentRoot):

<VirtualHost *:80>
    ServerName mautic.yourdomain.com
    DocumentRoot /var/www/mautic
    <Directory /var/www/mautic>
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/mautic_error.log
    CustomLog ${APACHE_LOG_DIR}/mautic_access.log combined
</VirtualHost>

Enable the site and rewrite module:

a2ensite mautic.conf
a2enmod rewrite
systemctl restart apache2

At this point, your domain (HTTP for now) should show the Mautic installation wizard if you visit it in a browser. Before we open the champagne — well, actually a can of LaCroix — let’s slap on an SSL certificate because nothing says “2025 amateur hour” like http://.

Step 4: Encrypt All the Things (No One Likes “Not Secure” Warnings)

We’ll use Let’s Encrypt and Certbot, the heroes who gave the world free SSL certificates and simultaneously made it embarrassing that your dentist’s website still uses self-signed certs from 2012.

apt install certbot python3-certbot-apache -y
certbot --apache -d mautic.yourdomain.com

Follow the prompts. Let Certbot redirect HTTP to HTTPS automatically. Now your Mautic instance is served over a lovely green padlock. Refresh and breathe deeply.

Step 5: The Web Installer — Five Minutes to Marketing Glory

Navigate to https://mautic.yourdomain.com and you’ll see Mautic’s step-by-step installation wizard. It’s as friendly as a golden retriever that’s been trained in PHP configuration.

  1. Environment Check: Mautic will tell you if any PHP extensions are missing. Hopefully, you installed them all. If not, go back and apt install the culprit. (Don’t worry, I’ll wait. Go ahead and install php-fileinfo while you’re at it — Mautic loves it.)
  2. Database Setup: Enter the details: Database mauticdb, user mauticuser, password you invented earlier. Host localhost. It’ll connect faster than a startup founder pivoting to AI.
  3. Admin User: Create your super-admin account. Use a real email address because Mautic will need to send you a password reset thing eventually.
  4. Mailer Settings: This is critical. Choose “Other SMTP Server” and plug in your SMTP relay credentials (Amazon SES, Mailgun, etc.). If you’re feeling bold, you can install Postfix locally and have Mautic use localhost port 25, but then you’d better become an email deliverability ninja because getting it right is a sport. I won’t judge if you just use an external SMTP service and pay those 10 cents per thousand emails. That’s not “selling out,” that’s “strategic outsourcing.”
  5. Finish Installation: Once done, Mautic will load the dashboard. Take a moment to appreciate the clean interface, free of “UPGRADE TO PRO” banners that follow your cursor.

Step 6: CRON Jobs — The Secret Sauce of Automation

Mautic needs scheduled tasks to process campaign actions, update segments, send queued emails. Without cron jobs, your automation is about as automated as a paper plane.

Edit your system’s crontab (crontab -u www-data -e) and add these lines (adjust paths if needed):

* * * * * /usr/bin/php /var/www/mautic/bin/console mautic:broadcasts:send --limit=100
* * * * * /usr/bin/php /var/www/mautic/bin/console mautic:campaigns:rebuild --batch-limit=100
* * * * * /usr/bin/php /var/www/mautic/bin/console mautic:campaigns:trigger
* * * * * /usr/bin/php /var/www/mautic/bin/console mautic:emails:send
*/5 * * * * /usr/bin/php /var/www/mautic/bin/console mautic:segment:update
0 1 * * * /usr/bin/php /var/www/mautic/bin/console mautic:maintenance:cleanup --days-old=365 --no-interaction

Yes, that * * * * * is five asterisks, not a typo. Mautic expects to be pestered every minute like a caffeinated intern “just checking in.” These commands ensure emails flow, campaigns execute, and your database doesn’t swell into a digital hoarder’s paradise.

One more thing: tweak your php.ini file (/etc/php/8.X/apache2/php.ini or via cli) to set memory_limit = 256M and max_execution_time = 300. Mautic can be a bit of a memory glutton, especially when processing large batches, and you don’t want it to crash halfway through a launch announcement.

Step 7: Sending Your First Campaign — The “Ah-ha!” Moment

Log into your Mautic dashboard, and you’ll feel like a kid who just unlocked the biggest sandbox on the playground.

  • Create a Segment: You can start with a simple filter like “Email is not empty.” Even one test contact works.
  • Craft an Email: Use the drag-and-drop builder — which is, ironically, often easier to use than the ones behind a paywall. No branding, no “unlock this template for just $99/month.” Just pure email creation.
  • Build a Campaign: Drag a “Send email” action, link it to a decision like “Opened email,” and watch the magic. You can even add lead scoring so that prospects who click your cat meme receive a “Serious Business” follow-up five minutes later. It’s both terrifying and exhilarating.

You now have a fully functional marketing automation system hosted on your own metal. The sense of empowerment is intoxicating. You might even start to question why anyone pays for bloated SaaS when a few config files and a $5 VPS can do the same — plus you get to keep your data and your dignity.

Conclusion: Welcome to the Self-Hosted Club (No Membership Fees)

You did it. You sidestepped the subscription-industrial complex and set up a robust email marketing engine that scales with you, not your credit card limit. Mautic’s learning curve is real, but it’s the good kind — the kind that rewards you with deeper understanding and genuine control. Besides, the money you’ll save on software can now be redirected toward that espresso machine you’ve been eyeing (or, you know, a decent SMTP relay and a backup VPN).

With great self-hosting power comes great responsibility: keep your Mautic instance updated, watch those security patches, and for the love of all that is holy, back up your database. Automate the backups, too — you’ve got cron jobs now, you magnificent automation wizard.

Now go forth, build those drip campaigns, and remember: the only “unlimited” in the SaaS world is the endless stream of upselling emails. You’ve officially opted out.