Currently, marketing automation is the secret weapon you can use to keep your business ahead of the competitors. If you are looking for a free automation tool to enhance your marketing efforts, Mautic is an open-source marketing automation tool that’s worth its weight in gold. Today, I’ll walk you through how to install and setup Mautic on aaPanel, to have your Mautic instance up and running in no time. It allows you to engage with your audience through personalized campaigns, track user behaviour, and manage leads—all from one place.
When it comes to managing your server, aaPanel is a lightweight, user-friendly control panel that makes the setup process of any website or web app a breeze.
Before we continue, for the sake of the newbies to aaPanel and Mautic, let’s understand what Mautic and aaPanel is
What is aaPanel?
aaPanel is a free and open-source web hosting control panel that simplifies server management. It’s so easy to use for both beginners and professionals, it offers a clean and intuitive interface that makes it easy to manage websites, databases, FTP accounts, and security settings without using any command-line operations.
With aaPanel, you can effortlessly install popular software stacks like LAMP, LEMP, and one-click applications such as WordPress, Joomla, or, in this case, Mautic. It’s packed with features like file management, cron job scheduling, SSL certificate installation, and real-time monitoring—all accessible from your browser.
It’s like having cPanel for free at your fingertips but without the steep learning curve. aaPanel supports various operating systems, including CentOS, Ubuntu, and Debian, making it a versatile choice for different server environments. You can use aaPanel to manage a single site or multiple projects, it offers the flexibility and control you need to keep your server running smoothly and securely.
Now that we understand aaPanel, let’s get started with Mautic Installation and Setup on aaPanel.
How to Install and Setup Mautic on aaPanel
Step 1: Login to your aaPanel
Visit your aaPanel URL and log in using your credentials.
Go to the Database Management Section
In the aaPanel dashboard, click on “Databases.” and then click on Add DB button at the top of the database
Create a New Database
A pop-up window will display once you click “Add DB,” enter the database name (e.g., Mautic), and set a username and password for the database. Keep the credentials safe; you’ll need them during Mautic installation.
Step 2: Create a new Website
The next step is to create a website for your Mautic installation. To add a new website on aaPanel, click Website and then click on Add site.
Once you click add site, in the pop-up window, enter the domain or sub-domain name for your Mautic, e.g. mautic.example.com, edit the website path if you need to, write a description for your website and select the PHP version. Mautic currently supports PHP 7.4 and 8.0 for Mautic 4 and 8.1 for Mautic 5.
Once you’ve added your details, click the confirm button to create your website.
Install PHP extension
To run Mautic successfully on aaPanel, you need to install some PHP extensions to the PHP Version. To install the extensions, go to the Home page on your aaPanel, scroll down to the Software section and click on the PHP version you want to install Mautic on.
On the pop-up page, click on Install extensions and install fileinfo and imap extensions.
Disable Functions
You will also need to disable some functions in the Mautic PHP version to run your Mautic without error on aaPanel. To Disable functions, scroll down to “Disabled functions” on the same page where you install extensions.
Find and delete the following functions: putenv. Just click the “Del” to remove the function from the Disabled functions.
Step 3: Add SSL Certificate
Once your website is created, you will need to install the SSL certificate for the website you just created. To install the SSL certificate, click “NOT SET” under SSL in front of the domain you created.
Once you click the “Not set”, a pop-up will appear, select Let’s Encrypt, then tick your domain name and click the “Apply” button to create the SSL certificate.
Once the SSL certificate is generated, click the “save” button to apply the SSL certificate to your website.
URL Rewrite
If you use Apache on your aaPanel, ignore this step, but if you use Nginx as your server on aaPanel, you will need to set a rewrite rule for your Mautic to open correctly on the browser.
To set the Rewrite rule, go to the website on aaPanel and click on the domain name for Mautic. Scroll down to “URL rewrite” copy the code below into the space provided and click the “save” button to save the changes.
rewrite ^/(vendor|translations|build)/.* /index.php break;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
# one option: try_files $uri $uri/ /index.php$is_args$args;
try_files $uri /index.php$is_args$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
# Deny everything else in /app folder except Assets folder in bundles
location ~ /app/bundles/.*/Assets/ {
allow all;
access_log off;
}
location ~ /app/ { deny all; }
# Deny everything else in /addons or /plugins folder except Assets folder in bundles
location ~ /(addons|plugins)/.*/Assets/ {
allow all;
access_log off;
}
# location ~ /(addons|plugins)/ { deny all; }
# Deny all php files in themes folder
location ~* ^/themes/(.*)\.php {
deny all;
}
# Don't log favicon
location = /favicon.ico {
log_not_found off;
access_log off;
}
# Don't log robots
location = /robots.txt {
access_log off;
log_not_found off;
}
# Deny yml, twig, markdown, init file access
location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
deny all;
access_log off;
log_not_found off;
}
# Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc...
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Deny all grunt, composer files
location ~* (Gruntfile|package|composer)\.(js|json)$ {
deny all;
access_log off;
log_not_found off;
}
location ~* \.(jpg|jpeg|png|ico|pdf)$ {
expires 15d;
}
# Deny access to any files with a .php extension in the uploads directory
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# Solve email tracking pixel not found
location ~ email/(.*).gif {
try_files $uri /index.php?$args;
}
# Solve JS Loading 404 Error
location ~ (.*).js {
try_files $uri /index.php?$args;
}
Now that you set your URL rewrite rule for Mautic, it’s time to download and upload Mautic to your server.
Step 4: Download and Upload Mautic
Download Mautic
To download Mautic, visit the official Mautic website download page and download the latest version of Mautic.
Upload Mautic to Your Server
Once you finish downloading the latest Mautic from the Mautic official website, the next step is to upload Mautic to your server.
To upload Mautic to your server on aaPanel, go to “website,” navigate to your web root directory of the domain you want to install Mautic on (e.g., /www/wwwroot/yourdomain.com), and upload the Mautic zip file.
Once you are on the root directory, click the “upload” button to upload the Mautic Zip file. Upload the Zip file or drag the Zip file into the box.
Once uploaded, unzip the files by selecting the folder and clicking the unzip link to the right of the folder.
Step 5: Install Mautic
Access Mautic in Your Browser
Type your Mautic domain (e.g., https://yourdomain.com) in a web browser to initiate the Mautic setup wizard.
Once the page loads, it will show you your environment is ready for Mautic. Click the “Next Step” button to move to the next page.
Database Configuration
Enter the database credentials you created earlier, correctly type your database name, username, and password into the right box, and leave the rest by default. Ensure everything is correct, then click the “Next Step” button.
Mautic Installation – Administrative User
Create an admin account for your Mautic by entering your desired Admin Username, Password, First and Last Name and Email Address. Once you enter your details, click the “Next Step” button.
Keep your username and Password safe because that’s what you need to log in to your Mautic Dashboard.
Finish Installation
Complete the installation process by configuring your email settings. This stage is optional as you can set it up now or later within the Mautic dashboard
Click the Next Step button to log in to your Mautic dashboard.
Once the installation process for Mautic is complete, you will see the login screen.
Enter the Username and Password you created during the Mautic installation to log in to your Mautic dashboard. When you are logged in to the Mautic, you will be welcome with this dashboard screen.
Step 6: Connect SMTP with Mautic
Once you are logged in to your Mautic successfully, the next thing to do is to connect SMTP or API with Mautic so that Mautic can send emails to your subscribers.
To connect an email SMTP with Mautic, click on the setting icon at the top right corner and click on “configuration”
You will be taken to the configuration page, click on email settings on your left-hand side to configure the emails.
On this page, you have to do the Email Setup by entering the email address Mautic will use in sending emails out. e.g. mail.example.com and also set SMTP configurations. You select the SMTP or API service of your choice like Amazon SES, Sparkpost, Elastic Email, Mailjet, Gmail or any other SMTP even if it’s not listed.
Add port: 587
SMTP Username
SMTP Password
Once you are set with entering the SMTP details, click save and test your connection to ensure it is working.
Next, stroll down a bit on the same page to the Monitored Inbox Settings
In the monitored inbox settings, you will enter the email address you want to use to monitor the bounces on your email campaign. e.g [email protected]. Enter the Imap host of your email, e.g. email.example.com as seen below. Select 993 as your port and select SSL or TSL as your case may be.
Once everything is set, click save above and test your connection.
Step 7: Set a Cron Job for Mautic on aaPanel
You need to add the required cron jobs to your server for Mautic to run some background work perfectly. Mautic requires a few cron jobs to handle some tasks such as updating contacts, segments, campaigns, sending emails, and more.
To set up a cron Job for your Mautic on aaPanel, go to the Cron Job section on the left sidebar of your aaPanel, and click on “Cron” to open the aaPanel Cron Job Manager.
For instance, to set a campaign trigger cron job, enter the name of the cron job, set the time and enter the cron job into the script content box:
/www/server/php/80/bin/php /www/wwwroot/yourmauticrootfolder/bin/console mautic:campaigns:trigger >/dev/null 2>&1
Once you set the cron job, click Add task.
Final Thoughts
Setting up Mautic on aaPanel is a powerful way to take control of your marketing automation with minimal hassle. From installing the necessary software stack to configuring cron jobs, this guide has walked you through every step to get Mautic up and running smoothly on aaPanel.
With your server now equipped to handle sophisticated campaigns and personalized communications, you’re well on your way to driving more engagement and conversions. With aaPanel, you can quickly install Mautic to automate your digital process.