Install Mautic Self-Hosted Email Marketing Platform on Ubuntu 18.04 Server

This tutorial will be showing you how to set up Mautic email marketing platform on Ubuntu 18.04 with Apache or Nginx web server. Mautic is a free open source alternative to commercial email service providers like MailChimp. Key features of Mautic includes:

  • Lead nurturing and tracking
  • Marketing campaigns
  • Dripflow programs
  • Create Landing pages
  • Social media monitoring
  • Install free plugins to extend the functionality of Mautic.
  • Mautic can be easily integrated with third-party SMTP relay services like Gmail, Mandrill, Sendgrid, Amazon SES. You can also use your own mail server.
  • and much more

Benefits of Self Hosting Email Marketing Platform

Why do you want to self-host email marketing platform instead of using third-party ESPs (Email Service Provider) like MailChimp?

For starters, self-hosting can save you a lot of money. Mautic is free and open-source software. You only need to pay $8.99/month for the VPS (virtual private server), which can run a full-featured mail server and the Mautic email marketing platform. It can easily handle millions of subscribers. So your total cost is always $8.99/month no matter how many subscribers you have. If you own millions of subscribers on MailChimp, the cost would be thousands of dollars per month.

Another reason is that Firefox browser blocks third-party trackers by default, so the MailChimp signup widget on your website doesn’t work properly and the MailChimp pop-up won’t shown to your visitors. By hosting the email marketing platform under your own domain name, Firefox doesn’t block the tracker, so your signup widget or popup can work properly. This is also true if users of other web browsers decide to block third-party trackers.

In addition, you can manipulate subscribers’ information from the database and even automate it with a Cron job. For example, I often see there are typos when a visitor enters information on the sign-up form. I use a cron job to automatically correct some common typos.

Last but not least, self-hosting can protect your freedom of speech. You never need to worry about an email service provider shutting down your account like Mailchimp did.

Challenges of Self Hosting Email Marketing Platform

The first problem you face is find a good self-hostable email marketing platform. Previously we have discussed how to set up Mailtrain, which is an open-source alternative to MailChimp, on Ubuntu 18.04 server. However, Mailtrain is missing several features a typical site owner would like to have.

  • Mailtrain doesn’t provide users with an easy way to insert signup widget or popup on website.
  • Users can’t set time schedule for RSS campaigns.
  • No contact rating.

After all, Mailtrain is just a project of a handful of software developers.

Mautic, on the other hand, is a project of a team of developers and has developed more and more features over the years. You do have an easy way to insert signup widget and popup on your website with Mautic. There’s also a vibrant and very active community around it. Furthermore, Mautic is more than just a newsletter/email marketing platform. It’s a full-blown digital experience platform, as they call it. With Acquia (which is a company offering paid service for the Drupal open source content management system) acquiring Mautic in May 2019, the future for Mautic has never been brighter. So I feel it’s time to switch from Mailtrain to Mautic.

The second challenge is have the technical expertise to set up the email marketing platform on your own server. Don’t worry, I will show you how in just a few moments.

The third challenge is that you need to have good reputation for the IP address of your mail server and your domain name as well. Otherwise, your emails will land in the spam folder. Gmail Postmaster Tools can show you if you have good reputation for your domain name and IP address. As you can see from the screenshot below, I always have high domain reputation with Gmail, because I always follow best practices to send emails to my subscribers. None of my subscribers reported my email as spam.

gmail postmaster tools domain reputation

To send out bulk emails, you need to follow these rules or practices.

  1.  Make sure the recipient gave you permission to send email. Use double opt-in to verify subscriber’s email address.
  2.  Don’t send cold emails to thousands of people who have never received emails from you before. Instead, you need to warm up your IP address. For example, send 500 emails on day 1, then send 1000 emails on day 2, send 2000 emails on day 3.
  3.  Include your contact information and your mailing address at the bottom of the email message.
  4.  Personalize the email message as much as possible. For example, include the recipient’s name in the email.
  5.  Conform to CAN-SPAM Act
  6.  Avoid large attachments.
  7.  Clean your email list. For example, delete email subscribers that haven’t opened your email in the last 30 days.
  8.  Get approved as Return Path Certified Sender.
  9.  Test your email placement with GlockApps.

I also recommend you to check out Gmail, Yahoo, Hotmail’s bulk email best practices. Now let’s look at how to install Mautic on Ubuntu 18.04 server.

Prerequisites of installing Mautic on Ubuntu 18.04 Server

If you don’t have your own mail server yet, I recommend using the free iRedMail program to quickly set up your own mail server before installing Mautic, so you don’t have to spend money on commercial SMTP relay service.

Mautic is written in PHP and relies on MySQL/MariaDB database server. So you need to set up a LAMP stack or LEMP stack. If you prefer Apache web server, then set up LAMP stack.

If you prefer Nginx web server, then set up LEMP stack.

Note that iRedMail will automatically set up a LEMP stack for you, so if you are going to install Mautic on your iRedMail server, you don’t need to set up LEMP stack again.

You also need a domain name. I registered my domain name from NameCheap because the price is low and they give whois privacy protection for free. Without further ado, let’s install Mautic on Ubuntu 18.04 server.

Step 1: Download Mautic onto Your Ubuntu 18.04 Server

If you go to the official website to download Mautic, you are required to enter your name and email address. If that’s not what you like, then download the latest stable version by executing the following command on your server.


The file will be saved as latest. Use unzip command to unzip it to /var/www/mautic/ directory.

sudo apt install unzip

sudo unzip latest -d /var/www/mautic/

Then make the web server user (www-data) as the owner of this directory.

sudo chown -R www-data:www-data /var/www/mautic/

Step 2: Create a MariaDB Database and User for Mautic

Now we need to log in to MariaDB console and create a database and user for Mautic. By default, the MaraiDB package on Ubuntu uses unix_socket to authenticate user login, which basically means you can use username and password of the OS to log into MariaDB console. So you can run the following command to login without providing MariaDB root password.

sudo mysql -u root

Next,create a new database for Mautic using the following command. This tutorial names it mautic, you can use whatever name you like for the database.


The following command will create a database user and password, and at the same time grant all permission of the new database to the new user so later on Mautic can write to the database. Replace red texts with your preferred database name, username and password.

GRANT ALL ON mautic.* TO 'mauticuser'@'localhost' IDENTIFIED BY 'password';

Flush privileges table and exit MariaDB console.



Step 3: Install Required and Recommended PHP Modules.

Run the following command to install PHP modules required or recommended by Mautic

sudo apt install php-imagick php7.2-common php7.2-gd php7.2-imap php7.2-json php7.2-curl php7.2-zip php7.2-xml php7.2-mbstring php7.2-bz2 php7.2-intl php7.2-gmp

Then restart Apache. (If you use Nginx, you don’t need to restart Nginx.)

sudo systemctl restart apache2

Step 4: Create Apache Virtual Host or Nginx Config File for Mautic


If you use Apache web server, create a virtual host for Mautic.

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

Put the following text into the file. Replace with your real domain name and don’t forget to set DNS A record for it.

<VirtualHost *:80>
  DocumentRoot /var/www/mautic/

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  <Directory />
    Options FollowSymLinks
    AllowOverride All

  <Directory /var/www/mautic/>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all


Save and close the file. Then enable this virtual host with:

sudo a2ensite mautic.conf

Reload Apache for the changes to take effect.

sudo systemctl reload apache2

Now you should be able to see the Mautic web-based install wizard at


If you use Nginx web server, create a virtual host for Mautic.

sudo nano /etc/nginx/conf.d/mautic.conf

Note: If you install Mautic on iRedMail server, you should create the virtual host under /etc/nginx/sites-enabled/ directory.

sudo nano /etc/nginx/sites-enabled/mautic.conf

Put the following text into the file. Replace with your real domain name and don’t forget to set DNS A record for it. Also note that if you install Mautic on iRedMail server, you should use the TCP socket ( instead of the Unix socket (unix:/run/php/php7.2-fpm.sock).

server {
   listen 80;
   listen [::]:80;

   root /var/www/mautic;
   error_log /var/log/nginx/mautic.error;
   access_log /var/log/nginx/mautic.access;
   client_max_body_size 20M;

   index index.php index.html index.htm index.nginx-debian.html;

   location / {
     # try to serve file directly, fallback to app.php
     try_files $uri /index.php$is_args$args;

   location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";
       try_files $uri /index.php$is_args$args;

   # redirect some entire folders
     rewrite ^/(vendor|translations|build)/.* /index.php break;

   location ~ \.php$ {
     include snippets/fastcgi-php.conf;
     fastcgi_pass unix:/run/php/php7.2-fpm.sock;
     #Note: If you install Mautic on iRedMail server, you should use the TCP socket instead.

   location ~* ^/index.php {
     # try_files $uri =404;
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
     # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

     fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
     #Note: If you install Mautic on iRedMail server, you should use the TCP socket instead.
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;

     fastcgi_buffer_size 128k;
     fastcgi_buffers 256 16k;
     fastcgi_busy_buffers_size 256k;
     fastcgi_temp_file_write_size 256k;

    # Deny everything else in /app folder except Assets folder in bundles
    location ~ /app/bundles/.*/Assets/ {
        allow all;
        access_log off;
    location ~ /app/ { deny all; }

    # Deny everything else in /addons or /plugins folder except Assets folder in bundles
    location ~ /(addons|plugins)/.*/Assets/ {
        allow all;
        access_log off;
    # location ~ /(addons|plugins)/ { deny all; }

    # Deny all php files in themes folder
      location ~* ^/themes/(.*)\.php {
        deny all;

    # Don't log favicon
    location = /favicon.ico {
        log_not_found off;
        access_log off;

    # Don't log robots
    location = /robots.txt  {
        access_log off;
        log_not_found off;

    # Deny yml, twig, markdown, init file access
    location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
        deny all;
        access_log off;
        log_not_found off;

    # Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc...
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;

    # Deny all grunt, composer files
    location ~* (Gruntfile|package|composer)\.(js|json)$ {
        deny all;
        access_log off;
        log_not_found off;

    # Deny access to any files with a .php extension in the uploads directory
        location ~* /(?:uploads|files)/.*\.php$ {
                deny all;

     # A long browser cache lifetime can speed up repeat visits to your page
  location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
       access_log        off;
       log_not_found     off;
       expires           360d;

Save and close the file. Then test Nginx configuration.

sudo nginx -t

If the test is successful, reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Now you should be able to see the Mautic web-based install wizard at

Step 5: Enabling HTTPS

To encrypt the HTTP traffic, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Ubuntu 18.04 server.

sudo apt install certbot

If you use Nginx, then you also need to install the Certbot Nginx plugin.

sudo apt install python3-certbot-nginx

Next, run the following command to obtain and install TLS certificate.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email -d

If you use Apache, install the Certbot Apache plugin.

sudo apt install python3-certbot-apache

And run this command to obtain and install TLS certificate.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email -d


  • --nginx: Use the nginx plugin.
  • --apache: Use the Apache plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

The certificate should now be obtained and automatically installed.

mautic https certbot

Step 6: Finish Mautic Installation in Web Browser

Now in your browser address bar, type in your domain name for Mautic to access the web install wizard.


click Next Step.

install mautic ubuntu 18.04

In step 1, enter the MariaDB/MySQL database details.

mautic mariadb database

In step 2, create an admin account.

install mautic on ubuntu 18.04 server

In step 3, configure email settings. Note that you have many options in mailer transport. You can use PHP Mail, sendmail, or Gmail or integrate Mautic with third-party email services like Mandrill, Sendgrid, Amazon SES. These settings can always be changed after installation in Mautic configurations page. If Mautic is installed on your mail server, then you need to choose Sendmail as the mailer transport, so Mautic will use your mail server to send email.

mautic email server configuration sendmail

If Mautic and your mail server are running on different machines and you want Mautic to send emails via your mail server, then you need to choose Other SMTP server as mailer transport.

  • Enter the hostname of your mail server
  • Choose port 587
  • Choose TLS or SSL encryption.
  • Choose Plain the authentication mode
  • Enter the login credential of an email address on your mail server.

mautic other smtp service

After step 3 is done, you can log into Mautic dashboard.

mautic php7.2

If you see the 500 internal server error, please check Mautic logs, which can be found in /var/www/mautic/app/logs/ directory.

Step 7: Enable HTTP2 to Improve Performance

You can enable HTTP2 protocol to improve page loading performance for Mautic.


First, you need to enable the HTTP2 module.

sudo a2enmod http2

Then open the SSL virtual host file.

sudo nano /etc/apache2/sites-enabled/mautic-le-ssl.conf

Put the following directive after the opening <VirtualHost *:443> tag.

Protocols h2 http/1.1

Save and close the file. Then restart Apache for the changes to take effect.

sudo systemctl restart apache2


To enable HTTP2 protocol in Nginx virtual host, find the following line.

listen 443 ssl; # managed by Certbot

Simply add http2 after ssl.

listen 443 ssl http2; # managed by Certbot

Save and close the file. Then reload Nginx.

sudo systemctl reload nginx

Step 8: Install the RSS To Email Plugin

For many site owners, the ability to automatically fetch content from RSS feed and send it to subscribers is a must. Mautic doesn’t support this feature natively, but you can install a plugin to implement this feature. Go to the Mautic plugins directory.

cd /var/www/mautic/plugins/

Clone the Mautic RSS to Email plugin from Github.

sudo apt install git
sudo -u www-data git clone

Rename the folder to MauticRssToEmailBundle.

sudo mv mautic-rss-to-email-bundle MauticRssToEmailBundle

Clear the Mautic cache.

sudo rm /var/www/mautic/app/cache/* -rf

In the Mautic dashboard, click the gear icon on the upper-right corner and select plugins. Click the Install/Upgrade plugins button and the Mautic RSS to Email plugin will show up in the plugin list.

mautic rss to email

Step 9: Add Cron Jobs

Mautic relies on Cron jobs to update mailing list segments, email marketing campaigns, campaign events and process email queues. Edit the www-data user’s crontab file. (You should not add Mautic commands in root user’s crontab file.)

sudo -u www-data crontab -e

And add Mautic Cron jobs like below.

######  Mautic Cron Jobs #######

# update segments every 15 minutes
* * * * * php7.2 /var/www/mautic/app/console mautic:segments:update  > /dev/null 

# update campaigns every 15 minutes starting with an offset of 5 minutes at the beginning of each hour
5-59/15 * * * * php7.2 /var/www/mautic/app/console mautic:campaigns:update  > /dev/null 

# execute campaigns events every 15 minutes with an offset of 10 minutes
10-59/15 * * * * php7.2 /var/www/mautic/app/console mautic:campaigns:trigger  > /dev/null 

# process email queue
2-59/15 * * * * php7.2 /var/www/mautic/app/console mautic:emails:send  > /dev/null

# import list in the background
* * * * * php7.2 /var/www/mautic/app/console mautic:import  > /dev/null 

# update MaxMind GeoLite2 IP Database once a week
@weekly php7.2 /var/www/mautic/app/console mautic:iplookup:download  > /dev/null

Save and close the file. Note that Mautic cron jobs may use a fair amount of CPU and RAM resources. If Mautic and iRedMail are installed on a server with 2GB RAM, you should not deploy additional programs on the server, or you can choose to upgrade the server specs.

Step 10: Download IP Lookup Database

In order to know the subscriber’s geolocation, you need to download MaxMind’s free GeoLite2 IP lookup database.

First, you need to create an account at MaxMind. Maxmind will send you an email. Click the link in the email to set a password, then log in to your MaxMind account.  Next, select My License Key on the left bar.

maxmind license key

Click the Generate New License Key button.

maxmind generate new license key

Give your license key a name. Then choose No, because we don’t need to use the geoipupdate program. Then click the Confirm button.


Once the license key is created, copy the license key. Go to Mautic dashboard, click the cog icon on the upper right corner and select configuration. In the System settings tab, scroll down to Miscellaneous Settings.

  • Select Maxmind GeoLite2 City Download for the IP lookup service
  • Paste your license key into the IP lookup service authentication field.

Next, Click the Fetch IP Lookup Data Store button. Finally, click the Apply button on the upper-right corner.

mautic maxmind geolite 2 city IP lookup

Step 11: Install the Tracking JavaScript

In the tracking settings tab, you can find a code snippet that you can add to your website for tracking visitors. If you use WordPress, then copy this code snippet and paste it in the footer.php file under the WordPress theme folder.

Muatic tracking javascript

Note that you need to go to the System settings tab, and add your website’s address in the CORS settings for the tracking JavaScript to work.

Mautic CORS settings

While you are at it, you should also set the default timezone on this page.

mautic set time zone

Click the Apply button. Note: I found that I need to wait some time for the timezone setting to take effect. You can clear Mautic cache with the following command for the timezone setting to take effect immediately.

sudo rm /var/www/mautic/app/cache/* -rf

Importing Contacts to Mautic

Check out the Mautic contact import page. Please note that when importing a large list (more than one thousand contacts) to Mautic, you should choose import in the background instead of import in the browser. That’s because the default PHP maximal execution time is 30 seconds, but importing a large list can take several minutes, so it will be stopped by the PHP limit if you choose to import in the browser.

How to Update to the Latest Stable Version

When a new version of Mautic comes out, you will see a notification in the Mautic dashboard (Click the bell icon).

update mautic

Then click the Update Now link. You will see the page below.

upgrade mautic ubuntu

Note: If you are trying to upgrade to Mautic 3, but see the following error, then you need to upgrade your MariaDB version. You can install MariaDB 10.5 on Ubuntu.

upgrade to Mautic 3

You are advised to back up files and database before upgrading Mautic. To back up the Mautic files, simply run the following command, which will back up the /var/www/mautic/ directory to your home directory.

sudo tar -cpvzf ~/mautic.tar.gz /var/www/mautic/

To back up the Mautic database, run the following command, which will back up the database to your home directory.

sudo mysqldump -u root mautic > ~/mautic.sql

Next, click the Update Now button to update Mautic and you will see the progress.

mautic one-click upgrade

If the update process stalls or failed partway through, please check out this article.

Update Mautic From Command Line

If the web-based updater failed, you may want to try updating Mautic from the command line, because you can see errors in the command line and troubleshoot the problem.

Go to the Mautic webroot directory.

cd /var/www/mautic/

Then run the following command to check if there’s update available.

sudo -u www-data php7.2 app/console mautic:update:find

If update is available, run the following command to apply updates.

sudo -u www-data php7.2 app/console mautic:update:apply

If you are asked:

Are you sure you wish to update Mautic to the latest version?

Type in yes and press Enter.

During the update, I saw the following error.

PHP Warning: Use of undefined constant PHPEXCEL_ROOT - assumed 'PHPEXCEL_ROOT' (this will throw an Error in a future version of PHP) in /var/www/mautic/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php on line 31
PHP Warning: require_once(PHPEXCEL_ROOTPHPExcel/Shared/PCLZip/pclzip.lib.php): failed to open stream: No such file or directory in /var/www/mautic/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php on line 31
PHP Fatal error: require_once(): Failed opening required 'PHPEXCEL_ROOTPHPExcel/Shared/PCLZip/pclzip.lib.php' (include_path='.:/usr/share/php') in /var/www/mautic/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php on line 31

As you can see, this error is caused by an undefined constant PHPEXCEL_ROOT. To fix this error, I need to define the constant.

sudo nano /var/www/mautic/vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php

Find the following line,

require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';

And define the PHPEXCEL_ROOT constant above the line.

define("PHPEXCEL_ROOT", "/var/www/mautic/vendor/phpoffice/phpexcel/Classes/");
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';

Save and close the file. Then run the update command again.

sudo -u www-data php7.2 app/console mautic:update:apply

Wrapping Up

I hope this tutorial helped you install Mautic on Ubuntu 18.04. You can also check out Mautic getting started guide to learn how to use it. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial
[Total: 3 Average: 4.7]

29 Responses to “Install Mautic Self-Hosted Email Marketing Platform on Ubuntu 18.04 Server

  • Robson
    1 year ago

    Hi Xiao,

    My Mautic doesnt work with “queued delivery”, only send imediatly and it isnt linked with Cron Job.
    Some guys commented that they only solution is change PHP 7.3 to 7.0.

    As I’ll try your great tutorial, I would like to know if your instlation works well with queued delivery.

    Thanks man,

    • Yes, queued delivery works on my Mautic installation. If I remember correctly, Mautic doesn’t work well with PHP7.3. I’m using PHP7.2.

  • Robson
    1 year ago

    Hi Xiao, me again,

    I followed your tutorial, but queued delivery doesnt work, neither tracking visits.

    -All Cron Jobs configured
    -Tracking script installed in body site
    – VPS with 1cpu, 2Gb RAM, 30Gb disk, 2Tb band
    -Ubuntu 18.04 LTS
    -LEMP Stack and PHP 7.2.19 (following your tutorial)

    Would you mind revise my installation? I give you all access and pay doble beer 🙂

  • Does Mautic support Reply-to option? Because we have multiple users send news letters or jobs opening emails to our subscribers. But If subscriber replies it should respond back to those whoever user send the emails.

    • There’s no options to change the Reply-to address, but each user can create a separate account in Mautic and have their own subscribers. Make sure you go to Mautic Configurations -> Email settings and enable the Mailer is owner feature, so the subscriber owner’s email address will be used as the From: address.

  • Hello Xiao,

    Its me again. I am done with iredmail from your tutorial. And everything is working as it should.

    Now I have proceeded to installing mautic on iredmail as you directed here. But after everything, I created a new MX record for ‘ and gave it a priority of 5.

    Then as I navigate to the page is not showing anything.

    Then I also found out that as I visit it redirects to

    What should I do?

    • You don’t need to add MX record for Mautic is not a mail server. It’s a mailing list manager.

      You should not point to the IP address of your mail server, if your website is not hosted on your mail server.

      I don’t have time to answer every question, If you followed this tutorial to the letter but can’t get Mautic installer working, I can install Mautic for you, if you are willing to pay me.

      • Hello,

        I have been able to get past the errors and everything is going well now except that i am getting ‘500 internal server error’ after the step 2 of the mautic installation .
        And i have checked my error log. And here is the error I am getting.

        [2019-12-09 14:52:55] mautic.WARNING: PHP Warning – require(/var/www/mautic/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRole.php): failed to open s$
        [2019-12-09 14:52:55] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/mautic/app/cache/prod/doctrine/orm/Proxies/__CG__MauticUserBundleEntityRol$
        [2019-12-09 14:52:55] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/mautic/app/cache/prod/d$
        [2019-12-09 14:52:55] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: “Compile Error: require(): Failed opening required$

        Could you help out if you have some time to spare.

        • Sorry for bordering you. I have fixed it.

        • Chembian
          6 months ago

          Hi Emeke,

          How did you resolve this issue? It keeps happening.

  • Xiao Guoan Can you make tutorial on how to set dedicated ip in ubuntu 18.04 and how to setup ptr record also for ubuntu 18.04? Thanks

    • If you use a VPS, then you have a dedicated IP address and you can set PTR record in the control panel of your hosting provider.

      • What you said is true BUT… your tutorial doesnt involve installing any control panel whatsoever, it only use a fresh vps with ubuntu 18.04. and with no control panel in there you need a way to setup the dedicated ip and the rev dns + ptr record otherwise your email cant get into inbox, plus the package that you suggest with hostwind cant include the cpanel in there, cpanel with mautic plus modoboa 2gb ram is not enough. So can you make a tutorial on these 2 subjects?

    • 1.) If you use VPS, then your VPS comes with a dedicated IP address. No other person can use your VPS’s IP address. You don’t need to do other things to get a dedicated IP address.

      2.) Most VPS providers, including Hostwinds, allows you to edit PTR record (aka reverse DNS record) in the account control panel (I don’t mean control panels like CPanel). If you read my article carefully, you would find that I showed how to set PTR record in Hostwinds.

      3.) There are many factors that affect your email deliverability. A dedicated IP address and PTR record can help, but they are not “silver bullets”. I recommend reading this article: How to Stop Your Emails Being Marked as Spam

      4.) You don’t need CPanel to set PTR record. If you really want to install CPanel on your VPS, I might make a tutorial in the future.

      • Thank you for your reply Guoan, as of now i dont need to install cpanel in my vps because i believe its not necessary to install it when we are following your tutorial. About dedicated IP i need tutorial to install it because just incase my ip got blacklisted then i can replace it with a new IP. Can you make a tutorial about this? Im sure this will help many people also that face this problem

    • There’s no way to install, configure, or set up a new IP address in the operating system when you are using VPS.

      You can create a snapshot of your VPS, then create a new VPS from the snapshot, so you have a new IP address. You can delete the old VPS after that.

      If your IP address is blacklisted, you should ask for removal of your IP address from the blacklist. This will do good for your IP address reputation for the long term. If you suddenly change your IP address, your email could be put into the spam folder.

      Changing IP address in case of being blacklisted makes me think that you are trying to spam and play the hide and seek game.

    • Emeke Odili
      6 months ago

      Honestly, while installing the mautic, I battled with lots and lots of errors. And I researched lots of online resources. I also ran lots of codes. And for this particular fix I have honestly forgottn how I solved it. Perhaps you can do som google search and you’ll certainly get the fix.

  • @Xiao Guoan (Admin) , Thanks for the wonderful tutorial. My question is on installing mautic on a already installed Iredmail server.

    Can I use the already installed Let’s encrypt certificate on the iredmail server for the mautic host: I use webroot and it does not work, and cannot use installer to install mautic, but can see the installer page, with no graphical mautic images.

    Also am afraid if I use the nginx plugin as describe, it will alter the nginx installation for the mail server. I read where iremail never recommends this, but web root.

    Should I go ahead and try Use the nginx plugin for mautic in iremail server? Thanks

  • @Xiao , Ok, never worry. I got it now. I installed a separate certificate for mautic using ngnix plug in and it works. It seems MAUTIC need an independent certificate to work

  • This worked perfectly. How can set up FTP/SFTP to this? I have NGINX/LEMP stack

  • Johnny Benton
    3 months ago

    I have an active email server running Modoboa 18.04; can I install Mautic on this server?

    3 weeks ago

    Hi Xiao,

    I followed the tutorial with the iredmail installation and I have is running really well with SOGo. Mautic is installed and seems to be working, but I cannot send emails from the Mautic install.

    Error log entry:
    2020/09/25 20:18:18 [error] 23759#23759: *2243 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: [my ip], server: mautic.[my domain].com, request: “POST /s/contacts/email/2?mauticUserLastActive=1&mauticLastNotificationId= HTTP/2.0”, upstream: “fastcgi://”, host: “mautic.[my domain].com”, referrer: “https://mautic.[my domain].com/s/contacts”

    I really appreciate all the tutorials. Very helpful!

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community ( for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB.
You can upload: image.