Running a fully-fledged business can be one of the most satisfying and yet equally challenging task one can ever venture into. Firstly, you have to have a general picture of how the different departments should work in harmony to come up with the dream and vision at the heart of it all.
Secondly, you have to ensure that your customers have the best experience you can afford to proffer when they are interacting with your product or service. Moreover, you need to reach as many customers as you can and maintain the relationships you have built with them over time. It is definitely not easy but the strong at heart always push the wheels of the challenges to win.
Fortunately, there are tools created by awesome people that make running businesses better and more engaging. One such tool is Mautic Marketing Software which is Open Source and amazing. This guide focuses on how to get this software running in your organization to help you handle marketing and your precious customers in a superior manner.
In a nutshell, Mautic is an Open Marketing software platform that provides you with the greatest level of integration and deep audience intelligence, enabling you to make more meaningful customer connections throughout the relationship lifecycles. Now into the crux of the guide, we shall get Mautic installed in Ubuntu Linux server.
“Desire is craving enough to sacrifice for”
― Myles Munroe
Setup Requirements
We need to meet the following requirements to successfully get Mautic installed.
- PHP >=7.2.21
- PHP modules:
- Required: zip, xml, mcrypt, imap, mailparse
- Nginx | Apache web server
- MySQL Database server
- Git
- Composer
Step 1: Update and install essential tools
Once in the terminal of your fresh Ubuntu server, update it and install essential tools we shall use in our installation process
sudo apt update && sudo apt upgrade -y
Check if a reboot is required after the upgrade.
[ -e /var/run/reboot-required ] && sudo reboot
Install other dependencies thereafter:
sudo apt install vim git unzip curl -y
Step 2: Install and setup database
We are going to use MariaDB for this setup.
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s --
To install the default version in your OS repositories run:
sudo apt update
sudo apt -y install mariadb-server
You can secure your database server by running the hardening script.
sudo mariadb-secure-installation
After you have the database installed, the next step is to create a database and user for Mautic. Let us, therefore, go ahead and get this done as shown below. You are free to name your database and user differently and ensure you use a safe password.
$ sudo mariadb -u root
CREATE DATABASE mautic;
CREATE USER 'mautic'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON mautic.* TO 'mautic'@'localhost';
FLUSH PRIVILEGES;
EXIT;
That was easy and awesome.
Step 3: Install webserver and PHP
In order to get Mautic pages served, there has to be a webserver. Here, you have the freedom of either picking Apache or Nginx. We shall use Nginx for this guide. Additionally, Mautic requires PHP and therefore we will have to set it up as well. Note that the version of PHP required is PHP >=7.2.21.
At the time of updating this article, Mautic does not support PHP version >=8.1.
Install PHP and dependencies
- OS Provided PHP (version varies from one OS to another) – Only Ubuntu 20.04 & 18.04
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt install -y php
sudo apt install php-{cli,fpm,common,mysql,zip,gd,mbstring,curl,xml,bcmath,imap,intl}
- Installing PHP 8.0 from PPA (Ubuntu 22.04)
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt install -y php8.0
sudo apt install php8.0-{cli,fpm,common,mysql,zip,gd,mbstring,curl,xml,bcmath,imap,intl}
Check if php-fpm is running.
$ systemctl status php*-fpm.service
● php8.0-fpm.service - The PHP 8.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.0-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-12-07 12:28:40 UTC; 1min 15s ago
Docs: man:php-fpm8.0(8)
Main PID: 29559 (php-fpm8.0)
Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 4524)
Memory: 11.4M
CPU: 104ms
CGroup: /system.slice/php8.0-fpm.service
├─29559 "php-fpm: master process (/etc/php/8.0/fpm/php-fpm.conf)" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
├─29561 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
└─29562 "php-fpm: pool www" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
Dec 07 12:28:40 jammy systemd[1]: Starting The PHP 8.0 FastCGI Process Manager...
Dec 07 12:28:40 jammy systemd[1]: Started The PHP 8.0 FastCGI Process Manager.
Add Mautic’s recommended PHP Settings
Open up your php-fpm ini file and add/edit the details shown below. They include Timezone, and memory limit settings. Add your date.timezone (at about line 955) and change memory_limit (at about line 400) to 512MB.
$ sudo vim /etc/php/*/fpm/php.ini
memory_limit = 512M
[Date]
date.timezone = Africa/Nairobi
Step 4: Download Mautic source files
Visit Mautic Downloads page and pull the latest release. For me I’ll download directly from github.
VER=4.4.10 #from https://www.mautic.org/mautic-releases
wget https://github.com/mautic/mautic/releases/download/$VER/$VER.zip
Install unzip package.
sudo apt install unzip
Extract downloaded file.
unzip $VER.zip -d mautic
Move the mautic folder to the /var/www/ directory.
rm -f $VER.zip
sudo mv mautic/ /var/www/
Change Mautic’s files permissions
In order for web server to read the files, we have to grant it the rights and the right permissions. Issue the commands below to get that done.
sudo chown -R www-data:www-data /var/www/mautic/
sudo chmod -R 755 /var/www/mautic/
As you can see, our root directory is /var/www/mautic where we have our cloned Mautic files.
Option 2: Using Apache Web browser
Ensure Apache and its PHP module installed.
sudo apt remove nginx nginx-core nginx-common
# For PHP 8.0 from PPA
sudo apt install apache2 libapache2-mod-php8.0
# OS PHP version (Ubuntu 20.04 & 18.04)
sudo apt install apache2 libapache2-mod-php
Disable default Apache website.
sudo a2dissite 000-default.conf
sudo rm /var/www/index.html
sudo systemctl restart apache2
Create VirtualHost for Mautic.
sudo vim /etc/apache2/sites-available/mautic.conf
Paste and modify the following contents in to the file.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mydomain.com
ServerAlias mautic.mydomain.com
DocumentRoot /var/www/mautic
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/mautic>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable website and restart Apache web server.
sudo a2ensite mautic.conf && sudo systemctl restart apache2
You can then access Mautic on http://mydomain.com or http://mautic.mydomain.com depending on your server and DNS configurations.

Option 2: Using Nginx Web browser
Remove Apache2
sudo apt remove apache2
Install nginx Web server
sudo apt install nginx
We have to make a few changes to the Nginx configuration defaults by adding the details we need for Mautic.
Change into sites-enabled, back up the default file, and create a new one having new configurations.
sudo mv /etc/nginx/sites-enabled/default /root/nginx-default.backup
Create a new file and add the details shown below. If you have an FQDN, replace example.com with it. It can also be a subdomain such as mautic.example.com.
$ sudo vim /etc/nginx/sites-enabled/mautic.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mautic.example.com;
root /var/www/mautic;
index index.html index.htm index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php-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;
}
Validate nginx configuration:
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Restart nginx
sudo systemctl disable --now apache2
sudo systemctl restart nginx
Step 5: Finish Mautic’s Installation via Panel
After everything has gone well thus far, we should be at our final stages of installing Mautic Marketing software. In this step open [http://ip-address-or-domain-name/] to launch the Mautic installation panel on your browser. The first page will be as shown below. You can view the recommendations and apply them if you can. Otherwise, click “Next Step“

On the second page, you will be presented with a form to fill in Database details. These are the ones we set up in Step 3. Input the username and database name you used as well as your password. Since we have no existing database, click on “No“. Hit “Next Step” to Verifying the details and create the database. This may take a few seconds.

Once it is done, a new Administrative User form will be presented. Once again, fill in your Admin details and email then click “Next Step” button.

The next pane requires your mail settings. The drop-down “Mailer-transport” part has many platforms you can use to be receiving your mail from Mautic. Kindly use the one you prefer here and enter the details as required. Click “Next Step” once done. This will complete the installation.

Next, you will be required to log into Mautic Dashboard using the Administrative User details.

And your dashboard should blaze your eyes and beckon you to start configuring contacts, campaigns, Channels and others.

Step 6: Add Cron Jobs
Mautic requires a few cron jobs to handle some maintenance tasks such as updating contacts or campaigns, executing campaign actions, sending emails, and more. Mautic needs some mandatory cron jobs to run on a regular basis. You must manually add the required cron jobs to your server.
As a refresher, below 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 Mautic’s mandatory cron jobs, issue the crontab command with -e (edit) option and add the cron jobs with times set as you desire.
$ sudo crontab -e
*/10 * * * 1 php /var/www/mautic/app/console mautic:segments:update >> /var/log/cronmautic.log 2>&1
*/20 * * * 3 php /var/www/mautic/app/console mautic:campaigns:update >> /var/log/cronmautic.log 2>&1
*/30 * * * 5 php /var/www/mautic/app/console mautic:campaigns:trigger >> /var/log/cronmautic.log 2>&1
After that is done, we should be ready to use Mautic Software. You can go ahead and create new contacts, segments, campaigns and much more. Please check out the Official Mautic documentation on how to go about them.
Conclusion
We now have this Marketing software platform ready for use and we hope the guide was helpful. Otherwise, we return our appreciation for your relentless support, and thank you for visiting.
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