Saturday, April 20, 2024
HomeTutorialsHow To Install and Configure Mautic Marketing Automation Tool on Linux

How To Install and Configure Mautic Marketing Automation Tool on Linux

The Mautic marketing automation tool is an open-source and free software used to maintain your local business. You can spread, supervise, and advertise your product through the Mautic marketing automation tool. You can set your role to the organization to monitor the service and development. The research and development department team can use this tool to know what people are demanding and what products are available.

The content, dashboard, and other Mautic marketing automation features are beneficial for new and experienced business merchandisers. You can also make an analytics report through the Mautic tool for your organization. Installing the Mautic marketing automation tool on Linux distributions is not a tough job. Moreover, using Mautic on Linux is more effortless and hassle-free.

Features of Mautic Marketing Automation Tool 


The mautic marketing automation tool has a very decent and user-friendly dashboard. You can look up the incoming visitors from the dashboard. I would not say that Mautic is more efficient than Google Analytics, but the goal of using Mautic is different. You can monitor the contacts, traffic, comprehensive reports, campaigns, and more features from the Mautic marketing automation tool’s menu bar. A few primary features of the Mautic marketing automation tool are enlisted below.

  • Look up the Anonymous IP addresses
  • See Last Activity of Users
  • Offer Points and Promotions to the Visitors
  • API Management
  • Segment or Group Contact Management
  • Branding and Advertising
  • Track Return on Investment
  • Split testing
  • Define Role Among
  • Email Marketing

Install Mautic Marketing Automation Tool on Linux


Installing the Mautic marketing automation tool on Linux distributions require a PHP server, a database, the PHP XML and JSON extension packages, and a few server configuration settings. In this post, we will see how you can install the Mautic marketing automation tool on your Linux system.

I will show the process of installing Mautic on Debian, Arch, and Fedora Linux. All the steps and primary command-lines are the same; you need to replace the package manager command for your desired Linux distribution. In the entire post, I will use Ubuntu to demonstrate the Debian commands and the Fedora-32 to explain the Fedora and RHEL commands.

Step 1: Install a PHP Server


As I have mentioned earlier that the Mautic tool requires a PHP server; in this step, we will install a PHP server on our Linux system. I am installing the Nginx server as the PHP server. The Nginx is a powerful and heavy-duty PHP server that you can install on your Ubuntu desktop to power any local server or media services.

I will recommend you choose the Nginx server because, in this tutorial, we will use the FastCGI protocol to configure the server. We all know that the Nginx performs better with the FastCGI than any other PHP servers. However, you can install Apache or any different server to power the Mautic marketing automation tool.

1. Install Nginx on Ubuntu


Here, I will use the aptitude package manager to install the server inside the Ubuntu machine. First, you need to update your system, then run the following apt command is given below to install the Nginx server.

sudo apt update
sudo apt install nginx -y

2. Install Nginx on Fedora and Red Hat Linux


Fedora, Red Hat, and CentOS users can use the following terminal command line to install the Nginx server on your system.

yum -y install nginx

If you are running an older version of Fedora, you can run the following DNF command to install it.

sudo dnf -y install nginx

After installing the Nginx server, you need to start and enable the server on your system. You can use the following system control commands given below to enable, start, and check the Nginx server’s status. Don’t forget to run those commands as a root user.

systemctl start nginx
systemctl enable nginx
systemctl status nginx

Nginx server status

Step 2: Install and Configure the PHP Extension Packages


We have just installed a PHP server on our machine; now, we need to install the PHP extra extension packages inside the system to make it functional. Here, we will install the XML, JSON, IMAP, and other additional PHP packages.

1. Install PHP Extensions on Ubuntu Linux


At first, Ubuntu and other Debian users need to run the following aptitude commands to install the software-common repositories inside the system to avoid dependency errors.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y

Now, you can install the PHP extension packages by running the following apt command on your terminal shell.

Mautic Marketing Automation Tool PHP

sudo apt install -y php7.3-fpm php7.3-mbstring php7.3-xml php7.3-mysql php7.3-common php7.3-gd php7.3-json php7.3-cli php7.3-curl php7.3-zip php7.3-xml php7.3-imap php7.3-intl

2. Install PHP Extensions on CentOS, Fedora, and Red Hat Linux


CentOS, Fedora Linux, and Red Hat Linux users can run the following rpm and yum commands sequentially on the terminal shell to install the PHP extension packages.

sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmsudo 
yum install -y php70w php70w-mysqlnd php70w-common php70w-cli php70w-xml php70w-mbstring php70w-gd php70w-mcrypt php70w-opcache php70w-imap php70w-process php70w-intl

PHP Configuration Settings


After the PHP extensions are installed, you can now edit the PHP configuration script to edit the time zone and FixCGI path. You can write your own timezone code at the timezone value, and the default FixCGI value will be 0. You can use following the terminal commands to edit the configuration script.

cd /etc/php/7.3/fpm/
nano php.ini

For better understanding, you can see the values given below. When your editing is done, save the script and exit the file.

date.timezone = "UTC"
cgi.fix_pathinfo = 0

Now, restart and enable the PHP server on your Linux system.

systemctl start php7.3-fpm
systemctl enable php7.3-fpm

You can also check the status of your server. Use the following system control commands to check the status of your PHP server.

systemctl status php7.3-fpm
ss -pl | grep php

Step 3: Install and Configure the Database


In this step, we will be installing a database for the server to store all the data. As MySQL is the most reliable and cross-platform product, we will install MySQL as the database. If you are a fan of PostgreSQL, you can also install the pgAdmin instead of MySQL. First, we will see the installation methods; later, we will cover the configuration script.

1. Install MySQL on Ubuntu


However, use the following aptitude command-line on your Ubuntu and Debian-based Linux system to install MySQL on your system. Don’t forget to run the command as a root user. After the installation is done, we will change the database password and create a database for the Mautic marketing automation tool.

sudo apt install mysql-server mysql-client

2. Install MySQL on RHEL, Fedora, and CentOS


Red Hat Linux and CentOS users can run the following RPM command and the YUM command sequentially on the terminal shell to install the MySQL server.

rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
yum --enablerepo=mysql57-community install mysql-community-server

If you’re a Fedora Linux user, you can run the following RMP, and DNF commands on your terminal shell to install the MySQL server.

sudo rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc31-1.noarch.rpm
sudo dnf -y install https://dev.mysql.com/get/mysql80-community-release-fc32-1.noarch.rpm

After your database installation is done, you might need to start and enable the SQL server on your system. You can run the following system control commands on your Linux terminal to enable the MySQL server. As system control is an administrative task, you need to perform those commands as a root user.

systemctl start mysql
systemctl enable mysql

You can check the status of your MySQL server by using the following system control command.

Mysql status

systemctl status mysql

Step 4: Create a Database for Mautic Marketing Automation Tool


Till now, we have installed and configured a PHP server and installed a database engine. Now, we will create a database for the DB engine. As the MySQL database languages are safe for all distributions, you can use the following SQL script to create a database for the Mautic marketing automation tool. Don’t forget to replace the database name and password.

First, we need to change the preset password of the MySQL engine; later, we will set a new password and create a database. You can run the following terminal command-lines to access, change, and set a new password to the database. Then login to the database with your new password.

mysql_secure_installation
mysql -u root -p

After changing the password, run the following SQL commands to create a database for the Mautic marketing automation tool. Here, I have mentioned my localhost server in the SQL command; if you want to use a custom hosting service, you have to mention the hosting address.

CREATE DATABASE mautic_db;
CREATE USER mauticuser@localhost IDENTIFIED WITH mysql_native_password BY 'mautic321';
GRANT ALL PRIVILEGES ON mautic_db.* TO mauticuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;

Database create

Step 5: Secure Your Server


In this step, we will use the Certbot encryption tool to make our SQL and PHP server secure. We will generate a 2048-bit RSA key to get the SSL certificate. Before running the CSR request, we must install the Certbot tool on our Linux system. Use the following methods to install the Certbot on your system.

1. Install Certbot on Ubuntu


On Ubuntu and other Debian distributions, you can install the Certbot tool very easily. You can install the tool by using the following apt command.

sudo apt install certbot

2. Install Certbot on RHEL, Fedora, and CentOS


You can install the Certbot on Red Hat Linux, Fedora, and CentOS through the Snap store. First, you need to install the Snap package installer. Later, you can install the Certbot tool. Use the following terminal command-lines sequentially to complete the step.

sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Generate the RSA Key


Now, stop your Nginx server from generating the CSR key request. You can restart the Nginx server after the Certbot installation is done.

sudo systemctl stop nginx

Finally, use the following command-line given below to get the 2048-bit RSA key. Don’t forget to replace the email address and the server address on the command-line. You can use this key to switch your address from HTTP to HTTPS.

certbot certonly --rsa-key-size 2048 --standalone --agree-tos --no-eff-email --email [email protected] -d mautic.ubuntupit.linux.com

Step 6: Install the Mautic Marketing Automation Tool


In this step, we will download and install the Mautic marketing automation tool on our Linux system. We can download the compressed file of the Mautic tool from the official website of Mautic. On Ubuntu and Debian distributions, we will use the wget command to download the file. On Red Hat, Fedora, CentOS, and other distributions, we will directly download the file from Mautic’s official website.

1. Install Mautic tool on Ubuntu Linux


Ubuntu and Debian users can use the following wget command to download the Mautic marketing automation tool. The compressed file will be saved in the home directory. Later, we will extract the file and move the files to the /var/www/ directory.

Download the Mautic Tool for Ubuntu.

wget -q https://www.mautic.org/download/latest

Now, we have to install the Unzip tool to extract the compressed file.

sudo apt install unzip

As we will move the extracted files to the /var/www/ directory, we need to get the root access to the directory. Use the following terminal command-lines to change the user mode and get the root access.

cd /var/www/
/var/www$ sudo chmod 777 /var/www/
sudo chown -R www-data:www-data /var/www/mautic

Now, extract and move the files to the /var/www/ directory on your Linux system.

$ cd /var/www/
ls
unzip -qq latest -d mautic
ls -lah

2. Install Mautic Marketing Automation Tool on RHEL and Fedora


If you are a Red Hat, Fedora, or CentOS user, you can download the latest version Mautic marketing automation tool. To initialize the download, you need to provide your details. Once the download is finished, you can now extract the compressed file on /var/www/ directory.

However, we will use the wget tool to install the Mautic tool on RHEL and CentOS. Use the following command-lines to download the file.

wget https://www.mautic.org/download/latest -O mautic.zip

Now, extract the file and access the root permission.

unzip mautic.zip -d /var/www/html 
chown -R apache:apache /var/www/html
chmod -R 755 /var/www/html

Step 7: Configure the PHP Server


In this step, we will configure the Nginx server settings to make our localhost server active for the Mautic marketing automation tool. First, we need to add the following HTML script to the Nginx configuration script. Use the following terminal commands to open and edit the Nginx configuration script.

cd /etc/nginx/sites-available/
nano mautic

Now, copy and paste the following script inside the configuration file. I have created a custom address for my localhost server, which is mautic.ubuntupit.linux.com. You need to replace the address with your own server address.

server {
listen 80;
server_name mautic.ubuntupit.linux.com;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name mautic.ubuntupit.linux.com;

ssl_certificate /etc/letsencrypt/live/mautic.hakase-labs.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mautic.hakase-labs.io/privkey.pem;

ssl_session_timeout 5m;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";

client_max_body_size 4M;
client_body_buffer_size 128k;

root /var/www/mautic;
index index.php index.html index.htm index.nginx-debian.html;

location / {
try_files $uri $uri/ =404;
}

location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

location ~* ^/index.php {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
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;
}
}

Now, run the following terminal command to set the configurations and test the Nginx server.

ln -s /etc/nginx/sites-available/mautic /etc/nginx/sites-enabled/
nginx -t

Now restart the Nginx server from your Linux machine.

systemctl restart nginx

After the installation and configuration are done, you can delete the cache files and run a warm-up test.

cd /var/www/mautic/app
rm -rf cache/*
./console cache:warmup

Mautic Marketing Automation Tool console

Extra Tip: Assign the Localhost Address for Mautic


I hope so far, you have done everything correctly. However, If you can’t load the Mautic marketing automation tool on your Linux web browser, you should check the host directory to ensure that the IP address is assigned properly for the Mautic tool.

Use the following command-line given below to set and check the hosting address. Make sure that the localhost address is present at the hosting configuration table.

sudo nano /etc/hosts/

mautic ip address for localhost

Get Started With The Mautic Marketing Automation Tool


If you have done everything correctly, you can now open your web browser to enter the web interface of the Mautic marketing automation tool. Enter the server address that you have configured previously. In my case, the address is mautic.ubuntupit.linux.com. Your’s could be the localhost server address. Now, enter your user credentials to log in.

Mautic Marketing Automation Tool Login
At the next step, you will be asked to configure the database driver, database port, database name, and other details. The default MySQL database port is 3306.

mautic server settings db engine

After completing this step, you will be asked to set a new username and password for the Mautic web interface. Finally, you’re good to go to enjoy Mautic services.

Ending Words


Mautic marketing automation tool is free to use. However, it has a paid version that you can purchase if you need it. Sometimes, installing and configuring the Mautic tool might show some errors due to wrong procedures. Be mindful to follow the steps sequentially. I have described how you can install and configure the Mautic marketing automation tool on various Linux distributions in the entire post.

Please share it with your friends and the Linux community if you find this post useful and informative. You can write your opinions in the comment section regarding this post.

Mehedi Hasan
Mehedi Hasan
Mehedi Hasan is a passionate enthusiast for technology. He admires all things tech and loves to help others understand the fundamentals of Linux, servers, networking, and computer security in an understandable way without overwhelming beginners. His articles are carefully crafted with this goal in mind - making complex topics more accessible.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

You May Like It!

Trending Now