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
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.
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.
Download the latest stable Mautic. Check for the latest version number on Github
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:
Insert this into the file
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
Enable the new website on the server and restart apache
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):
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!
Hi Alex
Thanks for yet another clear & concise tutorial. I have followed quite a few of yours over the last year or so. Mostly for n8n!
I got a little concerned with this one though when I got to 4:50 (timecode) with the <VirtualHost *:80> tag. I have a full / live e-commerce website up and running on my DigtialOcean VPS droplet which I know runs on port 80 and I am wanting to run Mautic in a sub-domain on the same droplet. I am using CloudFlare for the DNS and My concern is that when I run the <VirtualHost *:80> tag in the console it might somehow adversely affect the e-commerce site that is already running. Is this the case? Or, will it work just fine and both e-Commerce site & Mautic installs will work just fine? Or, should I place Mautic on a separate droplet?
Once again many thanks for all your help!
Hi Andi,
you can run it like it is. Important is to add the correct folder and domain into this virtual host file.
Of course if you run it on another vps nothing can happen. But performance wise this is not necessary.
Good luck,
Alex
Hi Great tutorials as always! Although I have a question. I have a VPS with my WordPress website on it. I have also installed Mautic via CLI in a sub-folder on the server. I have a number of forms that are collecting data from the website and sending emails via SES etc.. Everything working great! I now wish to move onto my second stage of the build and am feeling quite nervous about it! I am fairly new to Docker & using the CLI etc… Tho can find my way around!
Here's what I wan to achieve…
I wish to install "n8n" and something like "Budibase" on the same VPS again via CLI & Docker. But I am worried that I may break my website & Mautic installation. Will installing these with docker cause problems or will they work as stand-alones? and if they will work okay are their any standout importing things that I would need to keep an eye on? (Like ports etc…) Also, do you have any tutorials showing how to do this?
And finally, I have snapshots & backups enabled for my VPS at server level (DigitalOcean) I also have daily backups for my WordPress install using ManageWP.com (great service) which allows me a very quick one click restore. So I'm wondering if there is a way of doing something similar with my Mautic and other dockers installs?
Any help / advice much appreciated & keep up the great work!
Andrew
Hi Andrew,
I don’t recommend mixing Mautic and WordPress on Apache plus containerized software. You could run everything in containers. This would work just fine.
But to be honest: If you are not really fluent in maintaining a containerized structure, simply use different VPS for each program. That sums up to around 50-100 $/€ per month and gives you soooooo much more peace and reliability. If you once had the problem of running out of diskspace you will understand.
Good luck with your choice
Alex