In my last post you've learned how to install WordPress on your own VPS. This time, we're going to install Mautic on the same Server. With that, you'll have a single VPS which costs you around 10$ per month with the core systems for your onlineshop and e-commerce business. If you don't have a clue on how to secure your VPS, maybe you should use hosting services like our Mautic Hosting. As soon as you deal with real-life customer data you need to ensure a certain level of security. 

We recommend Hetzner as host for your VPS. But you can also go to Services like Vultr or others.

Prerequisites

To follow this tutorial you need to walk through the first part of this tutorial series here:
Install WordPress on a VPS.

As soon as you got everything up and running, you can start here:

Update Server

Update Package Index

apt update && apt upgrade -y

Install Mautic

First let's create a MySQL database, a database user and give the user the necessary privileges. Change test1234 to a strong password. You can use a passwordgenerator for that.

mysql -u root
CREATE DATABASE mautic;
CREATE USER 'mautic'@'localhost' IDENTIFIED BY 'test1234';
GRANT ALL PRIVILEGES ON mautic.* TO 'mautic'@'localhost';
FLUSH PRIVILEGES;
exit

Now create a folder for your Mautic installation.

mkdir /var/www/html/mautic/

Download the latest stable Mautic. Check for the latest version number on Github

wget https://github.com/mautic/mautic/releases/download/4.3.1/4.3.1.zip && unzip 4.3.1.zip -d /var/www/html/mautic && rm 4.3.1.zip

Create the virtual hosts file for to tell the apache server where your Mautic is located and where to put the traffic. Here we use "nano" as editor:

nano /etc/apache2/sites-available/mautic.conf

Insert this into the file

<VirtualHost *:80>
    ServerAdmin your@emailaddress.com
    DocumentRoot /var/www/html/mautic/
    ServerName mautic.yourdomain.com

    <Directory /var/www/html/mautic/>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Enable the new website on the server and restart apache

a2ensite mautic.conf && systemctl restart apache2

Enable the new website on the server and restart apache

certbot --apache --agree-tos --email youremail@yourdomain.com --redirect --hsts -d mautic.yourdomain.org

Make sure you see the success message from certbot. Otherwise something didn't work as it should. I explain that inside the video to this post as well - watch it (give it a like and comment).

Last thing to do is, to give read and write permissions to the apache user (www-data):

chown -R www-data:www-data /var/www/html/mautic
chmod -R 755 /var/www/html/mautic

Ok. You're good to go!
Now open your Mautic within a browser and follow the onscreen instructions of the installer. These last steps are self-explanatory. If you want to have exact instructions how to do it, again, follow the video.

Comment down below if you have questions or found something what's not working for you. 
Until next time!

About the Author

Founder and marketing-automation-nerd.
He helps onlineshops to sell more fully automated.
Using the Lead & Sales Generatorâ„¢ method, he generates qualified leads, wins satisfied customers and scales e-commerce businesses.
He also loves tea, golf, spending time with his family and exceptional business concepts.

Leave a reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Find us Here

  • Kountourioti 6, Coral Elite Residence Villa 1, Peyia, 8560, Cyprus
  • office@automatethis.pro
  • +43 660 564 1253