In this tutorial, we will explain how to install Mautic on an Ubuntu 14.04 VPS with MariaDB, PHP-FPM and Nginx. Mautic is an open source marketing automation software built on top of the Symfony 2 components and open source libraries. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 14.04 VPS.
When the installation is complete, run the following command to secure your installation:
[user]$ mysql_secure_installation
Next, we need to create a database for our Mautic installation.
[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE mautic;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mautic.* TO 'mauticuser'@'localhost' IDENTIFIED BY 'mauticuser_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q
Install Nginx
Ubuntu 14.04 comes with nginx version 1.4, to install the latest stable version of Nginx version 1.8, run:
Composer is a dependency manager for PHP with which you can install packages. Composer will pull in all the required libraries and dependencies you need for your project.
[user]$ sudo nginx -t
[user]$ sudo service nginx restart
Final steps
Open http://myMautic.com in your favorite web browser and you should see the Mautic install screen. Provide the database information and create an admin user.
That’s it. You have successfully installed Mautic on your Ubuntu 14.04 VPS. For more information about how to manage your Mautic installation, please refer to the official Mautic documentation.
Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
14 thoughts on “Install Mautic on Ubuntu 14.04”
I wouldn’t recommend using the latest GitHub version of Mautic since there might be some pre-release bugs. Rather download the latest stable release from https://www.mautic.org/download/. You also won’t need to install Composer since the official package has all the dependencies.
Once I run this installation, can I fetch updates from the main repo since the download link is from the master repo on Github, or do I need to set up automatic updates in another way, so I can properly do git fetch upstream
can you please guide ? , I am getting “The site is currently offline due to encountering an error”
my default site conf
” server {
listen 80;
server_name domain.com;
root /var/www/html;
index index.php index.htm index.html;
include /etc/nginx/global/wordpress.conf;
include /etc/nginx/global/restrictions.conf;
include /etc/nginx/global/mautic.conf;
}
”
and mautic.conf
“server {
server_name domain.com/mautic;
listen 80;
root /var/www/html/mautic/public_html;
The error messages says it is a problem with the permissions. Open your PHP-FPM pool and check the value for listen.owner and listen.group. Make sure that the Mautic files are owned by that user. Thanks
I wouldn’t recommend using the latest GitHub version of Mautic since there might be some pre-release bugs. Rather download the latest stable release from https://www.mautic.org/download/. You also won’t need to install Composer since the official package has all the dependencies.
I followed the instructions and ended up with a default.domain in the site. What am I doing wrong?
Please check your nginx configuration file and make sure you add the nginx server block related to Mautic.
Once I run this installation, can I fetch updates from the main repo since the download link is from the master repo on Github, or do I need to set up automatic updates in another way, so I can properly do git fetch upstream
For more information on this, please read the documentation at http://mautic.github.io/developer-documentation
Please note, each time you update Mautic’s source after the initial setup/installation via a new git pull, etc. you will need to clear the cache.
Follow the steps and ended with a 502 Bad Gateway. Whats wrong?
Please check the Nginx error log for more info
Just find out it was a typo. Sorry to bother :)
How do I install mautic on subfolder ? using nginx , do I still need to create user and sites-available/(my subfolder conf)
Yes, you can install Mautic in a subdirectory. As for creating Nginx virtual config it is totally up to you.
can you please guide ? , I am getting “The site is currently offline due to encountering an error”
my default site conf
” server {
listen 80;
server_name domain.com;
access_log /var/log/nginx/domain.com.access_log;
error_log /var/log/nginx/domain.com.error_log;
root /var/www/html;
index index.php index.htm index.html;
include /etc/nginx/global/wordpress.conf;
include /etc/nginx/global/restrictions.conf;
include /etc/nginx/global/mautic.conf;
}
”
and mautic.conf
“server {
server_name domain.com/mautic;
listen 80;
root /var/www/html/mautic/public_html;
access_log /var/www/html/mautic/logs/access.log;
error_log /var/www/html/mautic/logs/error.log;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
“
You can check your log files for errors or more information about the problem you are experiencing. Thanks.
Follow the steps and ended with a 502 Bad Gateway. Whats wrong?
Here is the nginx error log:
2018/06/28 18:45:24 [crit] 24073#0: *11 connect() to unix:/var/run/php-fpm/php-fpm.sock failed (13: Permission denied) while connecting to upstream, client: XX.XXX.XX.XXX, server: server.mydomain.com, request: “GET /index.php HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/php-fpm.sock:”, host: “server.mydomain.com”
The error messages says it is a problem with the permissions. Open your PHP-FPM pool and check the value for
listen.owner
andlisten.group
. Make sure that the Mautic files are owned by that user. Thanks