Mautic is a free and open source marketing automation software. It is written in PHP using the Symfony framework and uses MySQL/MariaDB to store its data. It provides many out of the box tools for marketing automation such as Social Media Marketing which allows you to engage the leads through social media. It also provides Contact management and email marketing tools. It allows you to create valuable forms for campaigns to collect information and generate reports using the data gathered.
In this tutorial, we will learn to install Mautic on CentOS 7.
Mautic can be installed on systems with a small amount of RAM. You will also need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.
Before installing any package it is recommended that you update the packages and repository using the following command.
yum -y update
Once you have your system updated, run the following command to install few packages on your server.
yum -y install httpd mariadb-server mariadb
The above command will install Apache web server with MariaDB database server. Now you will need to install PHP. Mautic supports both PHP 5.6 and 7.0. In this tutorial, we will learn to install both PHP 5.6 and 7.0. You must install only one version of PHP. The YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP 5.6 or 7.0. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.
yum -y install epel-releaseyum -y update
Now install Webtatic repository using the following commands.
To start the Apache web server and enable it to start at boot time, run the following commands.
systemctl start httpdsystemctl enable httpd
Start MariaDB and enable it to start at boot time using the following commands.
systemctl start mariadbsystemctl enable mariadb
Now run the following command to secure your MariaDB installation.
It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. It will ask you if you want to set a root password for your MariaDB installation, choose y and set a strong password for the installation. It will further ask you for removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer yes or y to all the questions.
To create a database we will need to login to MySQL command line first. Run the following command for same.
mysql -u root -p
This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your Mautic installation.
CREATE DATABASE mautic;
The above query will create a database named mautic. For the database, you can use any name you prefer at the place of mautic. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. To create a new database user, run the following query.
CREATE USER 'mautic_user'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username mautic_user. You can use any preferred username instead of mautic_user. Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command.
GRANT ALL PRIVILEGES ON mautic.* TO 'mautic_user'@'localhost';
Now run the following command to immediately apply the changes on the database privileges.
Exit from MySQL prompt using exit command.
As we have all the dependencies ready, you can install Mautic using composer. Run the following command for same.
cd /var/www/wget https://www.mautic.org/download/latest -O mautic.zip
The above command will download the latest version of the application archive in mautic.zip file. Now unzip the file into /var/www/mautic directory using the following command.
unzip mautic.zip -d mautic
If you don't have unzip installed, you can run yum -y install unzip. Now create a virtual host for your domain or subdomain which will be used to access the Mautic site. Run the following command for same.
nano /etc/httpd/conf.d/yourdomain.com.conf Copy and paste the following lines into the file.
In the above configuration, replace yourdomain.com with your domain or subdomain.
Provide the ownership of the files to the Apache web server using the following command.
chown -R apache:apache /var/www/mautic
Now restart the Apache web server using the following command.
systemctl restart httpd
Now access the following URL through your web browser.
You will see following web interface of environment check. If you have followed the tutorial correctly, you should see that you have all the requirement satisfied to install Mautic.
Click on Next Step button to proceed further. In this interface, you will need to provide the database credentials. Choose MySQL PDO as database driver. Don't change the value of database host and port. Provide the name of the database with database username and password. Choose No for backup existing tables.
Click on Next Step button to proceed further. If the database credentials are correct, the installer will write the tables into the database. In next step of installation, you will need to create an administrative account.
Provide the administrator details and click Next Step to proceed further. In the last step, you will need to configure the email.
Choose the name and email who will send the outgoing emails. For email handling, you can choose to send immediately. Now choose the mailer transport application. You can choose PHP Mail, if you don't have an SMTP server. The emails will be sent using phpmail() function. Which is not recommended as the emails will likely go to spam folder. If you have SMTP server, you can provide the server details. You can also choose the many third party email agent for sending emails.
Once done, click on Next Step button to proceed further. The installation of Mautic is now finished, you can click on Proceed to Mautic to go to Mautic Dashboard after logging in.
In this tutorial, we have learned how to install Mautic Marketing Automation Software on CentOS 7. You can now deploy the application on your server to manage the marketing of your organization.
Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.
HostPresto will be launching a European point of presence in the coming weeks, specifically in Amsterdam. For customers needing their data located within the EU still please contact support to request migration to this location with ticket subject ‘EU Migration’. We will ensure this is actioned well before the Brexit...
Should the UK leave the EU without a deal, or should a deal be agreed that does not include a provision for .eu ownership by UK entities, it’s highly likely that the EU will revoke any .eu domain names unless you can provide an EU address. While this won’t happen...
If you own a .co.uk domain name and you have not registered the equivalent .uk version, you have until the 25th June 2019 to register the domain and secure your brand. After this date any unregistered .uk domain will enter public availability – meaning anyone can register the domain. You...