Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off


Running a mature business may be one of the most satisfying but equally challenging tasks people can take. First, you must have a general understanding of how the various departments should coordinate their work to come up with all dreams and visions. Second, you must ensure that your customers can provide the best experience when interacting with your product or service. In addition, you need to attract as many customers as possible and maintain the established relationships with them. This is definitely not an easy task, but a strong heart will always push challenges to victory.

Fortunately, some great people have created tools that can make running a business better and more attractive. One such tool is Mautic Marketing Software, which is open source and amazing. This guide focuses on how to run this software in your organization to help you deal with marketing and your valuable customers in an outstanding way. In short, Mautic is an open marketing software platform that can provide you with the greatest degree of integration and in-depth audience intelligence, enabling you to establish more meaningful customer connections throughout the relationship life cycle. Now for the focus of the guide, we will install Mautic in Ubuntu 20.04 or Ubuntu 18.04.

“Desire and desire to sacrifice for it”-Myles Munroe

Set up requirements

We need to meet the following requirements to successfully install Mautic.

  • PHP>= 7.2.21 <7.4
  • PHP module:
  • Required: zip, xml, mcrypt, imap, mailparse
  • Nginx | ​​Apache web server
  • MySQL database server
  • Git
  • composer

Step 1: Update and install basic tools

After entering the terminal of the new Ubuntu server, update it and install the basic tools that will be used during the installation process

sudo apt update && sudo apt upgrade
sudo apt install vim git unzip curl -y

Step 2: Install and set up the database

We will use MariaDB for this setup. Fortunately, we already have a detailed guide to install MariaDB 10.5. Check how to install MariaDB 10.5 on Ubuntu (Focal Fossa)

After installing the database, the next step is to create a database and user for Mautic. So let’s proceed with this operation as shown below. You can use different names to name the database and users at will, and make sure to use secure passwords.

MariaDB [(none)]> CREATE DATABASE mautic_database;
MariaDB [(none)]> CREATE USER 'usermautic'@'localhost' IDENTIFIED BY 'StrongPassword';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mautic_database . * TO 'usermautic'@'localhost';
MariaDB [(none)]> exit;

It’s easy and great.

Step 3: Install and configure the web server and PHP

In order to provide Mautic pages, there must be a web server. Here, you can choose Apache or Nginx. We will use Nginx in this guide. In addition, Mautic requires PHP, so we must also set it up. Please note that the required PHP version is PHP>= 7.2.21 <7.4. The PHP version (7.4.3) cannot meet this requirement. Therefore, we will use PHP version 7.3.

Install php-fpm and dependencies

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php7.3

sudo apt install php7.3-{cli,fpm,json,common,mysql,zip,gd,mbstring,curl,xml,pear,bcmath,imap,intl}

Check if php-fpm is running.

$ systemctl status php7.3-fpm
● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-07-13 13:27:53 EAT; 2min 12s ago
       Docs: man:php-fpm7.3(8)
    Process: 97804 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.3/fpm/pool.d/www.conf 73 (code=exi>   Main PID: 97791 (php-fpm7.3)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
      Tasks: 3 (limit: 1035)
     Memory: 10.7M
     CGroup: /system.slice/php7.3-fpm.service
             ├─97791 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
             ├─97802 php-fpm: pool www
             └─97803 php-fpm: pool www

Jul 13 13:27:52 ubuntu-20 systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Jul 13 13:27:53 ubuntu-20 systemd[1]: Started The PHP 7.3 FastCGI Process Manager.

Add PHP settings recommended by Mautic

Open your php-fpm ini file and add/edit the details shown below. They include time zone and memory limit settings. Add your date. Time zone (Approximately line 955) and make changes memory_limit (About line 400) to 512MB.

$ sudo vim /etc/php/7.3/fpm/php.ini

memory_limit = 512M


date.timezone = Africa/Nairobi

Configure Nginx

We have to make some changes to the Nginx configuration defaults by adding the details required by Mautic. Change to enable the site, back up the default file, and create a new file with the new configuration.

cd /etc/nginx/sites-enabled/
sudo mv default /tmp

Create a new file and add the details as shown below. If you have an FQDN, replace it with

$ sudo vim /etc/nginx/sites-enabled/mautic.conf

server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        root         /var/www/html/mautic;
        index index.html index.htm index.php;

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

        location ~ .php$ {
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_read_timeout 240;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_split_path_info ^(.+.php)(/.+)$;
    rewrite ^themes/.*/(layouts|pages|partials)/.*.htm /index.php break;
    rewrite ^bootstrap/.* /index.php break;
    rewrite ^config/.* /index.php break;
    rewrite ^vendor/.* /index.php break;
    rewrite ^storage/cms/.* /index.php break;
    rewrite ^storage/logs/.* /index.php break;
    rewrite ^storage/framework/.* /index.php break;
    rewrite ^storage/temp/protected/.* /index.php break;
    rewrite ^storage/app/uploads/protected/.* /index.php break;

Step 4: Clone the Mautic file from git and install composer

The root directory is the folder where our web server will check out Mautic files and provide them upon request. Through the Nginx configuration we completed above, you can confirm that the root directory is /var/www/html/mautic. You can create a different object as needed.

cd /var/www/html/
sudo git clone

A new directory called mautic will be created inside /var/www/html/ and the files will be copied into it. This (/var/www/html/mautic) will be our root directory.

Install composer

Composer must be installed to install Mautic’s dependencies. Do the following to set up the composer

cd ~
curl -sS -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Test whether composer has been successfully installed by running the composer version command

$ composer -V
Composer version 1.10.8 2020-06-24 21:23:30

After installing composer, go to the root directory as above and run composer install to install our dependencies.

cd /var/www/html/mautic
sudo composer install  ## This might take some time to complete!

Change Mautic’s file permissions

In order for Nginx to read the file, we must grant permissions to it. Issue the following commands to complete the task.

sudo chown -R www-data:www-data /var/www/html/mautic/
sudo chmod -R 755 /var/www/html/mautic/
sudo systemctl restart nginx php7.3-fpm

As you can see, our root directory is /var/www/html/mautic, where we cloned the Mautic files.

Step 5: Complete the Mautic installation through the panel

After everything goes well so far, we should be in the final stage of installing Mautic Marketing software. Open in this step [http://ip-address-or-domain-name/] Launch the Mautic installation panel on the browser. The first page is shown below. You can review the suggestions and apply them whenever possible. Otherwise, please click “Next step

On the second page, you will be provided with a form to fill in the database details. These are we in third step. Enter your username and database name and password. Since we do not have an existing database, please click “No“.hit”Next step“To verify the details and create the database. This may take a few seconds.

Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

Upon completion, a new “Manage Users” form will be displayed. Fill in your administrator details and email again, and click “Next step“Button.

Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

The next pane needs your mail settings. The drop-down “Mail Transmission” section has many platforms that you can use to receive mail from Mautic. Please use the one you like here and enter the details as needed. Click “Next stepOnce completed. This will complete the installation.

Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

Next, you will be asked to log in to Mautic Dashboard with the “Manage User” details.

Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

And your information center should open your eyes wide and greet you to start configuring contacts, campaigns, channels, etc.

Install Mautic Marketing Software on Ubuntu 20.04 | 18.04

Step 6: Add cron job

Mautic needs to perform some cron jobs to handle some maintenance tasks, such as updating contacts or activities, performing activities, sending emails, etc. Mautic requires some mandatory cron jobs to run regularly. You must manually add the required cron jobs to the server.

As a review, here is the cron job guide.

# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

To add a mandatory cron job for Mautic, issue the crontab command with the -e (edit) option and add the cron job for the required time.

sudo crontab -e

*/10 * * * 1  php /var/www/html/mautic/app/console mautic:segments:update >> /var/log/cronmautic.log 2>&1   
*/20 * * * 3  php /var/www/html/mautic/app/console mautic:campaigns:update >> /var/log/cronmautic.log 2>&1   
*/30 * * * 5  php /var/www/html/mautic/app/console mautic:campaigns:trigger >> /var/log/cronmautic.log 2>&1 

After finishing, we should be ready to use Mautic software. You can continue to create new contacts, segments, campaigns and more. Please check Mautic official documents On how to do it.

in conclusion

Now, we can use the marketing software platform, hope this guide will help you. Otherwise, we thank you for your unremitting support and thank you for coming.

Other interesting guides:

Install Mautic Marketing & CRM software on CentOS 7

Install phpList open source newsletter and email marketing software on Ubuntu 18.04

How to install YetiForce CRM on CentOS 8 / CentOS 7

You can download this article in PDF format via the link below to support us.

Download the guide in PDF format

turn off