Mautic Installation in 3 Simple Steps on a VPS
UPDATED on October 14, 2019, for Mautic 2.15.3
With this Mautic tutorial, you will learn how to complete the Mautic 2.15.3 installation on a Virtual Private Server (VPS) with PHP 7.2 on top of Ubuntu 18.04 LTS in just about 7 minutes.
If you are a total newbie to the Linux command line, this tutorial was made specifically for you, it’s the best way to get started as I carefully designed it to have the fewer amount of commands possible, so it’s easier to understand and the probability of anything going sideways is minimal. It’s designed to give you a quick success using the command line so you can have an easy victory and gain the confidence to later advance towards more complex, more secure and better-optimized setups.
On the other hand, if you are more experienced with Linux, and don’t mind some extra complexity, this might be a better tutorial for you: Securing your Mautic Installation
There are 3 steps:
- Install Mautic and required packages
- Install the Mautic cron jobs.
- Run the Mautic Configuration Wizard.
WARNING: This installation tutorial is NOT meant for a secure Mautic installation, use it just for testing or learning purposes.
This step by step Mautic tutorial is based on Ubuntu 18.04 and might not work on other versions of Linux.
Because we’re using PHP 7.2, this guide will only work if you choose any Mautic version older than 2.15.0 as Mautic support for PHP 7.2 was added in 2.15.0
A seasoned SysAdmin can complete this tutorial in less than 5 minutes, but if you are a complete Linux dummy, expect it to take you between 10 and 15 min.
This is a “Quick & Dirty” installation tutorial, just to test Mautic, which means this tutorial is by all means NOT to be used in a production environment with real data from real contacts. It is tho a good enough process to install Mautic in the following cases:
– If you want to build a quick demo for showing Mautic to your boss or a customer.
– If you are a seasoned Linux command line user, this is a really fast (5 mins or less for you) way to bring up a test install of Mautic, for example to test the specs listed above, maybe to check if a plugin or a custom piece of code you made will run well with the latest specs.
– If you are a total newbie to the Linux command line, this tutorial was made specifically for you, it’s the simplest way to get started as I carefully designed it to have the fewer number of commands possible, so you can have an easy victory and gain confidence to later advance by using any of my more advanced tutorials to build a production-ready installation of Mautic that you can safely use with real data from your customers.
This tutorial is designed to use the root account, which is the default on Digital Ocean, but NOT on AWS or other IaaS platforms, hence if you are new to the Linux Command Line (CLI) or to cloud VPSs, I strongly suggest you use Digital Ocean so you can complete the tutorial without any issues. I have also chosen Digital Ocean, because you can use user/password authentication to avoid the extra steps of creating and configuring a key, which is mandatory in other providers but optional on DO.
If you don’t yet have a VPS, this tutorial was made and tested using a Digital Ocean Droplet (VPS), I recommend you to use the same.
You can use this link to get $50 free credit to spend on DO servers: https://m.do.co/c/7a85b33e64cf
Before you can issue the commands specified in this guide, you will need to log into your server via an SSH connection. To do so you have to use an SSH client. If your desktop/laptop runs on Linux or Mac OS, you can use the “Terminal APP” already present on your system. If you are a windows user, you will need to install an SSH client like Putty or mRemoteNG:
Download mRemoteNG: https://mremoteng.org/download
How to connect to your Droplet: https://github.com/mRemoteNG/mRemoteNG/wiki/Creating-Connections
Step 1: Install Mautic and required packages.
Let’s get started!
Making sure you have the rights to issue all the commands:
Make sure your server is up to date by updating the Ubuntu OS.
apt update && apt upgrade -y
Installing all the required packages (applications) that are needed to run Mautic.
apt install apache2 libapache2-mod-php php unzip mariadb-server php-xml php-mysql php-imap php-zip php-intl php-curl ntp -y
Activating certain Apache 2 modules that are not active by default after installation.
Downloading and uncompressing the Mautic files.
Making sure Apache and Mautic, both have ownership and write access to the files.
chown -R www-data:www-data /var/www/html
chmod -R 775 /var/www/html
mv 000-default.txt /etc/apache2/sites-available/000-default.conf
Creating a database for Mautic.
mysql -u root
This command will connect you to your database, the only difference you will notice is that the text before your command prompt will change to “MariaDB [(none)]>”
CREATE DATABASE mautic DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON mautic.* TO 'root'@'localhost' IDENTIFIED BY 'password';
After the “EXIT;” command you will return to the normal mode…
Almost done, let’s reload Apache configuration to apply our changes.
service apache2 reload
OK, so your new Mautic Installation is now completed, now you just need to run the Installation Wizard:
Step 2: Run the Mautic configuration wizard.
Mautic is now ready to be configured, you just need to use a browser, like Chrome or Firefox, and navigate to the IP of your server, for example, if the IP of your droplet is: 22.214.171.124 you would type this in your browser:
http://126.96.36.199 (Change the IP to the one of your VPS or droplet)
Here’s an excerpt of your configuration for the Mautic Installation Wizard
- Database driver: MySQL PDO
- Database Host: localhost
- Database port: 3306
- DB name: Mautic
- Database Table Prefix: Leave empty
- DB User: root
- DB Password: password
- Backup existing tables: No
If you need help with the wizard steps, check this other post with very detailed step by step instructions for each of the screens: Mautic Installation: The Configuration Wizard
Step 3: Install the Mautic cron jobs.
Mautic is now already installed and you can navigate to all the sections and explore, but if you want working segments and campaigns you will also need to install the Mautic cron jobs
Done! The simplest way to install cron jobs ever…
If you want to know more about Mautic cron jobs you can check these other posts:
Got any questions? stuck on one of the steps? anything not working as planned?
Don’t hesitate to ask in the comments here below!!