Published on 2020-03-06· Updated on 2023-09-06
Mautic is one of the popular open-source Marketing automation application which can be used for multiple use cases of marketing paradigm. It ranges from sending bulks emails by uploading an Email list, Scheduling and Creating campaigns, Sending SMS and User journey.
There are many ways to install Mautic on your system, In this tutorial we will see how you can install Mautic with docker on the Linux server - Ubuntu. This might be critical for those who want easy deployment of the Mautic services with ease of Migration since docker does it really well.
$ sudo docker -v
You can install docker using the following command (Skip, in case you have docker already installed):
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
Enable docker (Necessary in order to boot docker in case of server reboot)
$ sudo systemctl enable docker
$ sudo docker-compose -v
For installation of docker-compose follow these steps (Skip, in case you have docker-compose already installed):
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
The docker compose file will have all of the docker configuration that will be needed for the installation of Mautic and its dependent services such as Mysql.
$ sudo vim docker-compose.yml
Paste the following content in the yml file
version: '2' services: mauticdb: restart: always image: percona/percona-server:5.7 container_name: mauticdb volumes: - mysql_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=mysecret command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci networks: - mautic-net mautic: restart: always image: mautic/mautic:latest container_name: mautic links: - mauticdb:mysql depends_on: - mauticdb ports: - 8080:80 volumes: - mautic_data:/var/www/html environment: - MAUTIC_DB_HOST=mauticdb - MYSQL_PORT_3306_TCP=3306 - MAUTIC_DB_USER=root - MAUTIC_DB_PASSWORD=mysecret - MAUTIC_DB_NAME=mautic - MAUTIC_RUN_CRON_JOBS=true networks: - mautic-net volumes: mysql_data: driver: local mautic_data: driver: local networks: mautic-net: driver: bridge
This will set the Mysql and Mautic files configuration to these values that you can change according to your requirements.
With the following command the respective Mautic and Mysql images will be installed through docker and it will up all required containers and run it on the specified ports in the docker-compose.yml file. For our case Mysql instance will run on the default Mysql port 3306 and Mautic instance will run on port 8080.
$ sudo docker-compose up -d
you can access this service at http://locahost:8080.
Apache 2:
Follow these steps to setup reverse proxy for Apache2 server:
$ sudo vim /etc/apache2/apache2.conf
Paste these lines
# Include generic snippets of statements IncludeOptional conf-enabled/*.conf # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf
Create these directories for virtual hosts
$ sudo mkdir /etc/apache2/sites-enabled/ $ sudo mkdir /etc/apache2/sites-available/
Create a new configuration file name mautic.conf:
$ sudo vim /etc/httpd/sites-available/mautic.conf
Paste these lines
<VirtualHost *:80> ServerName localhost ProxyPreserveHost On ProxyPass "/" "http://127.0.0.1:8080/" retry=1 timeout=600 Keepalive=On ProxyPassReverse "/" "http://127.0.0.1:8080/" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Make sure that you have rewrite mod enabled for apache
$ sudo a2ensite mautic.conf $ sudo a2enmod rewrite
Enable reverse proxy for apache
$ sudo a2enmod proxy $ sudo a2enmod proxy_http $ sudo a2enmod proxy_balancer $ sudo a2enmod lbmethod_byrequests
Restart Apache server
$ sudo service apache2 restart
Now with this you can access the Mautic instance at http://<your-server-domain>
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.
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
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. 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 on docker platform.
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