Installation of Mautic
- Installing Mautic Email Marketing Tool Using Docker: A Simplified Guide
- Adding Email Server Settings to Mautic
Installing Mautic Email Marketing Tool Using Docker: A Simplified Guide
Mautic, an open-source marketing automation tool, can be installed in various ways, but this guide focuses on using Docker for its simplicity and efficiency. Docker allows for easy deployment and management of Mautic, making it an ideal choice for users looking for a straightforward installation process. While other methods exist, this guide emphasizes the Docker approach as it streamlines the setup and configuration of Mautic.
Installing Mautic with Docker
Pulling the Docker Image
To begin the installation process, the first step is to pull the latest stable Mautic image from Docker Hub. Run the following command in your terminal.
docker pull mautic/mautic:latest
Running Basic Containers
Before running Mautic, it's necessary to set up a MySQL server. Create a Docker volume for MySQL data:
docker volume create mysql_data
Next, run the MySQL container (using Percona as an example):
docker run --name percona -d \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=mypassword \
-v mysql_data:/var/lib/mysql \
percona/percona-server:5.7 \
--character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
docker volume create mautic_data
Finally, run the Mautic container:
docker run --name mautic -d \
--restart=always \
-e MAUTIC_DB_HOST=127.0.0.1 \
-e MAUTIC_DB_USER=root \
-e MAUTIC_DB_PASSWORD=mypassword \
-e MAUTIC_DB_NAME=mautic \
-e MAUTIC_RUN_CRON_JOBS=true \
-e MAUTIC_TRUSTED_PROXIES=0.0.0.0/0 \
-p 8080:80 \
-v mautic_data:/var/www/html \
mautic/mautic:latest
This will launch a basic MySQL service within Mautic, accessible at http://localhost:8080.
Customizing Mautic Container
Database Options
Mautic container provides various environment variables for database configuration:
MAUTIC_DB_HOST
: Specifies the IP and port of the linked MySQL container (defaults to 127.0.0.1).MAUTIC_DB_USER
: Sets the database user (defaults to "root").MAUTIC_DB_PASSWORD
: Defines the database user's password (defaults to MySQL_ROOT_PASSWORD from the linked MySQL container).MAUTIC_DB_NAME
: Specifies the database name (defaults to "mautic").MAUTIC_DB_TABLE_PREFIX
: Adds a prefix to Mautic tables (defaults to empty).
If using an external database, provide the hostname, port, password, and username accordingly.
Mautic Options
Several environment variables control Mautic's behavior:
MAUTIC_RUN_CRON_JOBS
: Enables/disables Mautic cron jobs (defaults to true).MAUTIC_TRUSTED_PROXIES
: Specifies trusted proxies for reverse proxy setups.MAUTIC_CRON_HUBSPOT
,MAUTIC_CRON_SALESFORCE
, and others: Enable crons for specific CRM integrations.
Enable/Disable Features
MAUTIC_TESTER
: Enables Mautic Github Pull Tester documentation.
PHP Options
PHP_INI_DATE_TIMEZONE
: Sets the PHP timezone (defaults to UTC).PHP_MEMORY_LIMIT
: Configures PHP memory limit (defaults to 256M).PHP_MAX_UPLOAD
: Defines the maximum file size for PHP uploads (defaults to 20M).PHP_MAX_EXECUTION_TIME
: Specifies the maximum execution time for PHP scripts (defaults to 300).
Persistent Data Volumes
Mautic stores data at /var/www/html
, requiring a volume for persistence.
Mautic Versioning
Specify the Mautic version and SHA1 hash using the following environment variables:
MAUTIC_VERSION
(Defaults to "2.15.0").MAUTIC_SHA1
(Defaults to "b07bd42bb092cc96785d2541b33700b55f74ece7").
Accessing the Mautic Instance
After successfully setting up Mautic, access it at http://localhost:8080 or http://host-ip:8080 in a web browser.
Using Docker-Compose
For a more organized setup, use Docker Compose. Here's an example docker-compose.yml
file:
version: '2'
services:
mauticdb:
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:
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
docker-compose up
, wait for initialization, and access Mautic at http://localhost:8080 or http://host-ip:8080.Conclusion
By opting for Docker as the installation method for Mautic, users benefit from a simplified and efficient process. This guide covers the basics of pulling the image, running containers, customization options, and utilizing Docker Compose for a more organized deployment. Access Mautic through the provided URLs and leverage its powerful marketing automation features with ease.
Adding Email Server Settings to Mautic
Mautic allows you to configure email server settings to send emails efficiently. Follow these steps to add email server settings:
-
Log in to Mautic:
- Open your web browser and navigate to your Mautic instance.
- Log in using your administrator credentials.
-
Access Configuration Settings:
- Once logged in, click on the "Settings" gear icon located in the top right corner.
- From the dropdown menu, select "Configuration".
-
Navigate to Email Settings:
- In the Configuration menu, select "Email Settings" from the left-hand sidebar.
-
Choose Email Service:
- Under the Email Settings section, you'll see options for various email services such as SMTP, Amazon SES, SendGrid, etc. Choose the appropriate service according to your preference or requirement.
- For this guide, we'll focus on setting up SMTP, which is a common choice.
-
Configure SMTP Settings:
- Select "SMTP" from the list of email services.
- Fill in the SMTP server details provided by your email service provider or your IT department. This typically includes:
- SMTP Hostname: The address of your SMTP server (e.g., smtp.example.com).
- SMTP Port: The port number used for SMTP communication (e.g., 587 for TLS).
- SMTP Encryption: Select the appropriate encryption method (e.g., None, SSL, TLS).
- SMTP Authentication: Enable this option if your SMTP server requires authentication.
- SMTP Username/Password: Enter the credentials for authenticating with the SMTP server.
- Sender Email Address: The email address from which emails will be sent.
- Sender Name: The name associated with the sender's email address.
-
Test Connection:
- After filling in the SMTP details, click on the "Test Connection" button to ensure that Mautic can successfully connect to your SMTP server.
- If the connection is successful, you'll receive a confirmation message. If not, double-check your SMTP settings for any errors.
-
Save Settings:
- Once the connection test is successful, click on the "Save & Close" button to save your email server settings.
-
Verify Email Sending:
- To verify that your email server settings are working correctly, you can send a test email to yourself or another email address.
- Navigate to "Channels" > "Emails" and create a new email campaign or test email.
- Send the email and verify that it is delivered successfully to the intended recipients.
By following these steps, you should be able to add and configure email server settings in Mautic effectively. If you encounter any issues, double-check your settings and consult with your email service provider or IT department for further assistance.