{"id":2805,"date":"2018-01-29T19:50:52","date_gmt":"2018-01-29T16:50:52","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-1604\/"},"modified":"2018-01-29T19:50:52","modified_gmt":"2018-01-29T16:50:52","slug":"how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04\/","title":{"rendered":"How to Install Mautic Marketing Automation Tool on Ubuntu 16.04"},"content":{"rendered":"<p><strong>Mautic<\/strong> is an open source self-hosted marketing automation tool for everyone. You can use it to grow up your business or community, monitor your website, create landing pages, create a campaign for your business, manage contacts, and even send marketing emails.<\/p>\n<p>In this tutorial, I will show you step-by-step how to install Mautic Marketing\u00a0Automation Platform using Ubuntu 16.04. It&#8217;s a web-based application, and we will be using the\u00a0<a href=\"https:\/\/www.howtoforge.com\/tutorial\/installing-nginx-with-php7-fpm-and-mysql-on-ubuntu-16.04-lts-lemp\/\" target=\"_blank\" rel=\"noopener\">LEMP<\/a> stack for our installation guide.<\/p>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<ul>\n<li>Ubuntu 16.04<\/li>\n<li>Root privileges<\/li>\n<\/ul>\n<h2 id=\"what-we-will-do\">What we will do<\/h2>\n<ol>\n<li>Install Nginx<\/li>\n<li>Install and configure MariaDB<\/li>\n<li>install and configure PHP-FPM<\/li>\n<li>Download Mautic<\/li>\n<li>Configure Nginx virtual host for Mautic<\/li>\n<li>Mautic Web-based installation<\/li>\n<li>Testing<\/li>\n<\/ol>\n<h2 id=\"step-install-nginx\">Step 1 &#8211; Install Nginx<\/h2>\n<p>Mautic is a web-based marketing automation tool, and we will be using the Nginx web server for our Mautic installation.<\/p>\n<p>Login to your server machine, and then update and upgrade all packages.<\/p>\n<p class=\"command\">sudo apt update<br \/>sudo apt upgrade<\/p>\n<p>Now install Nginx using the apt command below.<\/p>\n<p class=\"command\">sudo apt install nginx<\/p>\n<p>After the installation is complete, start the nginx service and enable it to launch every time at system boot.<\/p>\n<p class=\"command\">systemctl start nginx<br \/>systemctl enable nginx<\/p>\n<p>The Nginx web server has been installed on to the Ubuntu 16.04 system &#8211; check it using the netstat command.<\/p>\n<p class=\"command\">netstat -plntu<\/p>\n<p>You should get the default HTTP port 80 on the list with &#8216;LISTEN&#8217; state status.<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04.png\" alt=\"Start nginx\" width=\"500\" height=\"206\" title=\"\"><\/a><\/p>\n<h2 id=\"step-install-and-configure-mariadb\">Step 2 &#8211; Install and Configure MariaDB<\/h2>\n<p>Mautic offers support only for the MySQL database with min version 5.5.3. For this guide, we will be using the mariadb-server 10.0 based on MySQL 5.5.<\/p>\n<p>Install the mariadb database using the following apt command.<\/p>\n<p class=\"command\">sudo apt install mariadb-server mariadb-client -y<\/p>\n<p>After the installation is complete, start the mariadb service and enable it to launch every time at system boot.<\/p>\n<p class=\"command\">systemctl start mysql<br \/>systemctl enable mysql<\/p>\n<p>Now, we need to create a new database and user for mautic. We will create new database named &#8216;<strong>mautic<\/strong>&#8216;, user &#8216;<strong>mauticuser<\/strong>&#8216; with password &#8216;<strong>aqwe123<\/strong>&#8216;.<\/p>\n<p>Login to the MySQL shell using the following mysql command.<\/p>\n<p class=\"command\">mysql -u root -p<\/p>\n<p>Create a new database and user using the following queries.<\/p>\n<p class=\"command\">create database mautic;<br \/>grant all on mautic.* to &#8216;mauticuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;aqwe123&#8217;;<br \/>flush privileges;<br \/>exit;<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-1.png\" alt=\"Create MySQL database for Mautic\" width=\"500\" height=\"369\" title=\"\"><\/a><\/p>\n<p>MariaDB database has been installed, and the database for Mautic installation has been created.<\/p>\n<h2 id=\"step-install-and-configure-phpfpm\">Step 3 &#8211; Install and Configure PHP-FPM<\/h2>\n<p>Mautic requires at-least PHP 5.6.19 for the installation. So for this guide, we will be using PHP-FPM 7.0 for our mautic installation.<\/p>\n<p>Install PHP and PHP-FPM (with all required extensions) using the apt command below.<\/p>\n<p class=\"command\">sudo apt install -y php7.0-fpm php7.0-mbstring php7.0-xml php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl php7.0-zip php7.0-xml php7.0-mcrypt php7.0-imap php7.0-intl<\/p>\n<p>After the installation is complete, we need to configure the php.ini files for FPM and CLI configurations.<\/p>\n<p>Go to the &#8216;\/etc\/php\/7.0&#8217; directory and edit the &#8216;php.ini&#8217; file under &#8216;fpm&#8217; directory.<\/p>\n<p class=\"command\">cd \/etc\/php\/7.0\/<br \/>vim fpm\/php.ini<\/p>\n<p>Uncomment the &#8216;date.timezone&#8217; line and give the with &#8216;<strong>UTC<\/strong>&#8216; for timezone configuration.<\/p>\n<pre class=\"system\">date.timezone = \"UTC\"<\/pre>\n<p>Now uncomment the &#8216;cgi.fix_pathinfo&#8217; line and change the value to &#8216;0&#8217;.<\/p>\n<pre class=\"system\">cgi.fix_pathinfo = 0<\/pre>\n<p>Save and exit.<\/p>\n<p>Next, edit the &#8216;php.ini&#8217; file under the &#8216;cli&#8217; directory.<\/p>\n<p class=\"command\">vim cli\/php.ini<\/p>\n<p>Uncomment the &#8216;date.timezone&#8217; line and give the value with &#8216;UTC&#8217; for PHP timezone configuration.<\/p>\n<pre class=\"system\">date.time = \"UTC\"<\/pre>\n<p>Next, uncomment the &#8216;cgi.fix_pathinfo&#8217; line, and change the value to &#8216;0&#8217;.<\/p>\n<pre class=\"system\">cgi.fix_pathinfo = 0<\/pre>\n<p>Save and exit.<\/p>\n<p>Now start the PHP-FPM service and enable it to launch every time at system boot.<\/p>\n<p class=\"command\">systemctl restart php7.0-fpm<br \/>systemctl enable php7.0-fpm<\/p>\n<p>The PHP and PHP-FPM installation and configuration for our Mautic installation has been completed. Check it using the netstat command as shown below.<\/p>\n<p class=\"command\">netstat -pl | grep php<\/p>\n<p>And you should get the result as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-2.png\" alt=\"\" title=\"\"><\/a><\/p>\n<h2 id=\"step-download-mautic\">Step 4 &#8211; Download Mautic<\/h2>\n<p>Goto the &#8216;\/var\/www\/&#8217; directory and download the mautic source code using the following wget command.<\/p>\n<p class=\"command\">cd \/var\/www<br \/>wget https:\/\/www.mautic.org\/download\/latest<\/p>\n<p>Extract the &#8216;latest&#8217; file with the unzip command to the &#8216;mautic&#8217; directory.<\/p>\n<p class=\"command\">unzip latest -d mautic\/<\/p>\n<p><strong>Note: <\/strong>If you don&#8217;t have the unzip command on your system, install it using the command below.<\/p>\n<p class=\"command\">sudo apt install unzip -y<\/p>\n<p>Now change the owner and group for the &#8216;mautic&#8217; directory to &#8216;www-data&#8217;.<\/p>\n<p class=\"command\">chown -R www-data:www-data mautic\/<\/p>\n<p>Mautic is downloaded to the &#8216;\/var\/www\/mautic&#8217; directory.<\/p>\n<h2 id=\"step-configure-nginx-virtual-host-for-mautic\">Step 5 &#8211; Configure Nginx Virtual Host for Mautic<\/h2>\n<p>For this guide, we&#8217;re using Nginx instead of the Apache web server. In this step, we will configure the Nginx virtual host for the mautic installation.<\/p>\n<p>Go to the &#8216;\/etc\/nginx&#8217; directory and create a new file named &#8216;mautic&#8217; under the &#8216;sites-available&#8217; directory.<\/p>\n<p class=\"command\">cd \/etc\/nginx\/<br \/>vim sites-available\/mautic<\/p>\n<p>Paste the following mautic nginx configuration there.<\/p>\n<pre class=\"system\" readability=\"11\">server {<br\/>\u00a0\u00a0\u00a0 listen 80;<br\/>\u00a0\u00a0\u00a0 listen [::]:80;\u00a0\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 server_name mautic.hakase-labs.co;<br\/>\u00a0\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 root \/var\/www\/mautic;<br\/>\u00a0\u00a0\u00a0 index index.php index.html index.htm index.nginx-debian.html;<br\/>\u00a0\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 location \/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 try_files $uri $uri\/ =404;<br\/>\u00a0\u00a0\u00a0 }<p>\u00a0\u00a0\u00a0 location ~ .php$ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 include snippets\/fastcgi-php.conf;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;<br\/>\u00a0\u00a0\u00a0 }<\/p><p>\u00a0\u00a0\u00a0 location ~* ^\/index.php {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_split_path_info ^(.+.php)(\/.+)$;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_index index.php;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 include fastcgi_params;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_buffer_size 128k;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_buffers 256 16k;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_busy_buffers_size 256k;<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 fastcgi_temp_file_write_size 256k;<br\/>\u00a0\u00a0\u00a0 }<br\/>}<\/p><\/pre>\n<p>Save and exit.<\/p>\n<p>Now activate the &#8216;mautic&#8217; virtual host and check it using the &#8216;nginx -t&#8217; command as shown below.<\/p>\n<p class=\"command\">ln -s \/etc\/nginx\/sites-available\/mautic \/etc\/nginx\/sites-enabled\/<br \/>nginx -t<\/p>\n<p>Make sure there is no error, and restart the webserver.<\/p>\n<p class=\"command\">systemctl restart nginx<\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-3.png\" alt=\"Configure Nginx for Mautic\" width=\"500\" height=\"193\" title=\"\"><\/a><\/p>\n<p>Nginx virtual host configuration for mautic has been completed.<\/p>\n<h2 id=\"step-mautic-webbased-installation\">Step 6 &#8211; Mautic Web-Based Installation<\/h2>\n<p>Open your web browser and visit the mautic domain name, mine is http:\/\/mautic.hakase-labs.co.<\/p>\n<p>You will be redirected to the mautic installation page. Make sure all the extensions and configuration is error-free as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-4.png\" alt=\"Mautic Web Installer\" width=\"500\" height=\"200\" title=\"\"><\/a><\/p>\n<p>Click &#8216;<strong>Next Step<\/strong>&#8216; button to continue.<\/p>\n<p>Now you will see the page about the database configuration. Type your database name, database user, and password as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-5.png\" alt=\"Database configuration\" width=\"500\" height=\"289\" title=\"\"><\/a><\/p>\n<p>And click the &#8216;<strong>Next Step<\/strong>&#8216; button.<\/p>\n<p>Now we need to create the new admin account for Mautic. Type your admin user, email, and password.<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-6.png\" alt=\"Set admin user and password\" width=\"500\" height=\"271\" title=\"\"><\/a><\/p>\n<p>Click the &#8216;<strong>Next Step<\/strong>&#8216; button.<\/p>\n<p>For the email configuration, you can choose one option, or you can configure it later.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-7.png\" alt=\"Email configuration\" width=\"500\" height=\"230\" title=\"\"><\/a><\/p>\n<p>Click the &#8216;<strong>Next Step<\/strong>&#8216; button again.<\/p>\n<p>Now you will get to see the admin login page. Type your admin user and password and click the &#8216;<strong>Login<\/strong>&#8216; button.<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-8.png\" alt=\"Mautic login\" width=\"500\" height=\"253\" title=\"\"><\/a><\/p>\n<p>And now you&#8217;ll be able to see the Mautic admin dashboard.<\/p>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_mautic_marketing_automation_tool_on_ubuntu_1604\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-install-mautic-marketing-automation-tool-on-ubuntu-16-04-9.png\" alt=\"Mautic Dashboard\" width=\"500\" height=\"282\" title=\"\"><\/a><\/p>\n<p>The installation of the Mautic marketing automation tool on Ubuntu 16.04 with Nginx webserver has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mautic is an open source self-hosted marketing automation tool for everyone. You can use it to grow up your business or community, monitor your website, create landing pages, create a campaign for your business, manage contacts, and even send marketing emails. In this tutorial, I will show you step-by-step how to install Mautic Marketing\u00a0Automation Platform &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2805","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=2805"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2805\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=2805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=2805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=2805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}