Published on 2020-03-05· Updated on 2023-09-04
Mautic is a very popular email marketing and lead management software that can be used to create customized email templates and email campaigns. With the release of Mautic 3 you can now expect better performance and some changes in code structure. So here are the detailed steps you need to follow to install Mautic 3 on your Linux server - Ubuntu 18.04.
You might need this release tutorial in order to get your self familiar with the new Mautic 3 although not much has been changed in the UI or you can use this as a debugging took so as to contribute to the Mautic 3 development and testing phase. For more about contribution to Mautic follow the Mautic community here.
Note:- As of the publishing date of this article, Mautic 3 is still in beta testing phase and a lot of new developments might be done in the future releases, considering that, this article is subject to change as the new release of Mautic 3 arrives in future. The version we will be working on will be the Mautic 3 beta version.
$ cd var/www/html/
$ sudo mkdir mautic $ cd mautic
To download Mautic at your local machine click here
Fill your credentials and click on the download button
The downloaded file would be named something like this mautic-3.0.0-beta.zip
Enter the following commands in your local machine download file location
$ scp -r mautic-3.0.0-beta.zip root@<your-domain-name/ip-address>:/var/www/html/mautic/mautic.zip
You can also install Mautic through using git and composer by following these steps(skip all steps till now):
$ git clone -b 3.0.0-beta https://github.com/mautic/mautic.git mautic $ composer install
$ sudo unzip mautic.zip
If you don't have unzip installed, you can install it by using
$ sudo apt-get install unzip
$ sudo rm -rf mautic.zip
$ sudo apt install php72 libapache2-mod-php72 libapache2-mod-php72 php72-common php72-mbstring php72-xmlrpc php72-soap php72-gd php72-xml php72-intl php72-tidy php72-mysql php72-cli php72-mcrypt php72-ldap php72-zip php72-curl php72-sqlite3
$ sudo apt install mysql-server
- After the installation a temporary password will be generated in the mysqld.log file you can access this password by the following command
$ sudo grep 'temporary password' /var/log/mysqld.log
- Now you will get a message something like this
[Note] A temporary password is generated for root@localhost: ,b*-rkuIR4Zas
- Copy this password for the next step
- Enter this command
$ sudo mysql_secure_installation
- This will prompt you to validate your password enter Y
- After this, you will be prompted to set your password strength. Enter you choice between LOW, MEDIUM and STRONG.
- Enter new password
- You can say yes to all the other prompts that come after this
- You will now be prompted with multiple questions on how to set up the MySQL installation. You can set Y to all the prompts
- You will be able to login with the user root and a blank password
mysql > create database mautic; mysql > CREATE USER 'mauticuser'@'localhost' IDENTIFIED BY 'password'; mysql > GRANT ALL PRIVILEGES ON * . * TO 'mauticuser'@'localhost'; mysql > FLUSH PRIVILEGES; mysql > exit;
(You can install Nginx or Apache server according to your needs)
- Nginx:
$ sudo apt install nginx $ sudo systemctl start nginx $ sudo systemctl enable nginx
$ vim /etc/nginx/nginx.conf
server { listen 80 default_server; listen [::]:80 default_server; server_name <Your domain name>; root /var/www/html/mautic; location / { try_files $uri /index.php$is_args$args; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_split_path_info ^(.+.php)(/.+)$; } }
Now depending upon your php-fpm setup you either need to add
fastcgi_pass 127.0.0.1:9000;
Or
fastcgi_pass unix:/var/run/php7.2-fpm.sock;
Note: If you are unclear on which value has to be set, you can check this in www.conf file.
$ sudo vim /etc/php/7.2/fpm/pool.d/www.conf
Search for the listen parameter.
- Apache:
$ sudo apt install apache2 $ sudo systemctl start apache2 $ sudo systemctl enable apache2
$ vim /etc/httpd/conf/httpd.conf
<VirtualHost *:80> DocumentRoot /var/www/html/mautic <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/mautic> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from All </Directory> </VirtualHost>
After this you will be opening http://<your-domain-address>/ to open Mautic installation panel
You may get this error if some folder permissions are not set
This error might exist because your Mautic folder user group is not the same as your running php-fpm instance.
Depending upon your user group you can set the following permissions.
Run the following commands to set permissions for Mautic installation
If your php-fpm user group is www-data
$ sudo chown -R www-data:www-data /var/www/html/mautic/
If it is nginx you have to set permissions like this
$ sudo chown -R nginx:nginx /var/www/html/mautic/
And for user group apache add
$ sudo chown -R apache:apache /var/www/html/mautic/
You can check user group of php-fpm file by using
$ ps -ef | grep fpm
Or you can check php-fpm config file by
$ sudo vim /etc/php/7.2/fpm/pool.d/www.conf
In this file check the user option
Set the Mautic directory permission
$ sudo chmod -R 755 /var/www/html/mautic/
Note: Also make sure that your PHP session path folder should also be added to the user group
$ vim /etc/php-fpm.d/www.conf
In this file check the php_value[session.save_path] attribute
Even by following the above steps you are still having issues use the following commands (For Apache users only)
sudo chcon -t httpd_sys_rw_content_t /var/www/html/mautic/app/logs -R sudo chcon -t httpd_sys_rw_content_t /var/www/html/mautic/app/cache -R sudo chcon -t httpd_sys_rw_content_t /var/www/html/mautic/app/config -R
Make sure you have all the PHP dependencies installed
Now you can go back to the browser and refresh the window and hopefully you have solved this error. If you are still getting the error screen you can try to debug using the Nginx error logs at.
/var/log/nginx/error.log
If you haven’t yet set up Mautic, you will be redirected to the installation panel.
If all the dependencies are matched for the installation of Mautic you will be shown a Ready to install prompt on the screen, Else the dependencies that are not satisfied will be listed on the panel.
If there are any minor bugs that need to be fixed they will be listed in the recommendations section. You can opt for fixing these recommendations.
After you have fixed the stated dependencies click on [Next Step] button.
Click on the Next Step button.
Note:- If you are having a problem with the blank Database Driver dropdown please make sure that you have all PHP dependencies installed you might haven't installed mysqlmd php dependency.
Step 3: Set Admin user settings
Enter the Admin credentials, these credentials will be used when logging in the Mautic user panel.
The email address you enter will be used for password resets.
Click on the Next Step button.
Before you proceed to the next step you will need our Pepipost SMTP server credentials.
Please check the screenshot provided below for reference:
You will use these credentials to set up our SMTP configuration in the next step
Now back at the Mautic installation screen
In [Who should the email be sent as?] section there are two parameters
in [How should email be spooled and delivered?] section you will be setting the following options.
In Email handling, there are two options.
Mailer transport: Select [Other SMTP Server]
Server: smtp.pepipost.com
Port: 25 [or you can set the port to 587 if 25 is blocked at your sever]
Encryption: TLS
Authentication mode: Login
Username: Your_Pepipost_username
Password: Your_Pepipost_password
Click on Next step
After this, you will be redirected to the login panel. Log in with your credentials and with this you will move on to the next step
This is how your dashboard will look
Cronjob is nothing but a scheduler that runs the specified path at a specified interval. Every action and updates done in the Mautic is mostly done by the Cron job running at regular intervals, If they are not set most of the Mautic's functionalities won't work.
For installing Cron jobs use the following command.
$ apt-get install cron
Follow these steps to add Mautic Cron jobs.
$ sudo crontab -e
Add the following Crons
*/5 * * * * php /var/www/html/mautic/app/console mautic:segments:update >> /var/log/crontab.log 2>&1 */10 * * * * php /var/www/html/mautic/app/console mautic:campaigns:update >> /var/log/crontab.log 2>&1 */12 * * * * php /var/www/html/mautic/app/console mautic:campaigns:trigger >> /var/log/crontab.log 2>&1 */15 * * * * php /var/www/html/mautic/app/console mautic:emails:send >> /var/log/crontab.log 2>&1
Based on the Cron set up your contacts, campaign and emails will be triggered, you might want to change the time interval of all of these Cron jobs based on your requirements.
Note: It is recommended that the Cron job interval doesn't collide with each other so keep the Cron timings unique.
There are two steps for creating new contacts
1. Single contact creation
2. Bulk Upload email list
This will open the Campaign panel in which all the campaign status is represented in a graphical format in which you can track the emails that are being sent.
With this, your campaign is ready to send emails from your imported segment.
After some time as the Cron runs, you will be able to see the emails being populated in the dashboard.
You can check the progress of your campaign in the campaign panel.
By following the above-mentioned steps you are now ready to send emails through the Mautic platform. You are now able to upload an email list, create an email body, filter the email leads with segments and send emails using the Pepipost SMTP server.
Netcorecloud's toolkit is the solution to all your email problems.
Netcore connects & unifies your data across all sources, connects to your marketing channels and provides you with control over AI Powered automation and personalization.
Hitesh Pandey💻
Full Stack Developer, Pepipost
🥑 Developer Evangelist | 🥇Email Geek