How to Install Mautic with Apache on Ubuntu 24.04
You install Mautic with Apache on Ubuntu 24.04 to deploy an open-source marketing automation platform that you control entirely.
Mautic helps you automate emails, manage social media, build landing pages, and run sophisticated marketing campaigns directly on your server.
Apache is the robust web server software that will handle incoming requests for your Mautic site. This installation guides you through setting up Mautic version 5.x, the latest stable release, alongside Apache.
This is perfect if you want complete ownership of your marketing data and wish to avoid third-party limitations.
Install Apache using `sudo apt install apache2`, then install MariaDB with `sudo apt install mariadb-server`. Create a Mautic database and user in MariaDB, and finally install PHP with `sudo apt install php libapache2-mod-php php-mysql`.
Install Apache HTTP server on Ubuntu
Installing the Apache web server on Ubuntu 24.04 is the first step to running Mautic, and itās simple to do right from your terminal.
To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.
sudo apt update
sudo apt install apache2
Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
You can test that the Apache web server is running by opening your web browser and browsing to the serverās localhost or IP address.
http://localhost
When you see theĀ Apache2 Default Page, it means the Apache HTTP server is successfully installed.
Additional help on installing Apache on Ubuntu is in the link below.
Install the MariaDB database server on Ubuntu
Mautic needs a database to keep its information safe, and installing the MariaDB database server on Ubuntu 24.04 is a straightforward process using your terminal.
To install and use the MariaDB database server, use the instructions below.
Open the Ubuntu terminal and run the commands below to install the MariaDB database server.
sudo apt update sudo apt install mariadb-server
Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Run the following commands to validate and test if the MariaDB database server is installed successfully.
sudo mariadb
Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.
Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 32 Server version: 10.11.2-MariaDB-1 Ubuntu 23.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]>
The message tells you that the server is installed successfully.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create aĀ MauticĀ database
After setting up MariaDB, youāll create a dedicated database named āmauticdbā and a user āmauticdbuserā with full permissions for Mautic to use.
As part of the setup, we will create aĀ mauticdbĀ database and a user account calledĀ mauticdbuser.
Finally, weāll grant theĀ mauticdbuserĀ full access to theĀ mauticdbĀ database.
All the database steps above can be done using the commands below:
But first, log on to the MariaDB database server:
sudo mariadb
Then run the commands below to complete the steps:
CREATE DATABASE mauticdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER mauticdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON mauticdb.* TO mauticdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Ensure to replace ātype_your_password_here āwith your password.
Install PHP on Ubuntu Linux
Since Mautic is built with PHP, you need to install it on your Ubuntu 24.04 server, along with the necessary extensions, using a single command.
Then, run the commands below to install the latest PHP version.
sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip php-ldap php-imap php-redis
Additional help on installing PHP
Download Mautic files
Getting the Mautic application files onto your Ubuntu 24.04 server involves installing tools like Git and Composer first, then using Composer to download the latest Mautic version.
First, install Composer, git, and curl packages by running the command below.
sudo apt install git curl
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
Then, run the commands below to installĀ Composer and use it to downloadĀ MauticĀ content.
cd /var/www/
sudo git clone https://github.com/mautic/mautic.git
sudo chown -R www-data:www-data /var/www/mautic/
cd mautic
sudo -u www-data composer install
If the steps above fail because npm is missing, run the command below to install it, then rerun the Composer install command.
sudo apt-get install npm
sudo mkdir /var/www/.npm
sudo chown -R 33:33 /var/www/.npm
Once you have completed all the above steps, continue configuring the Apache web server below to serve the Mautic content.
Run the commands below to create an Apache virtual host file for Mautic.
sudo nano /etc/apache2/sites-available/mautic.conf
Then, copy and paste the content block below into the Apache server block.
<VirtualHost *:80>
ServerName mautic.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/mautic
<Directory /var/www/mautic/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file.
Then, run the commands below to enable the virtual host and restart the Apache server.
sudo a2ensite mautic.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Setup Letās Encrypt SSL/TLS for Mautic
Securing your Mautic site with HTTPS is important, and setting up a free Letās Encrypt SSL/TLS certificate for Apache on Ubuntu 24.04 makes your installation safe and trustworthy.
Please read the post below for additional resources on installing and creating Letās Encrypt SSL certificates for Apache.
How to set up Letās Encrypt SSL certificate for Apache on Ubuntu Linux
Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.
http://mautic.example.com
The Mautic installation wizard should appear.
Click Next to begin the installation.

Type in the database name and password, then click Next.

Create an admin account and continue.

Mautic should be ready to use.

That should do it!
Conclusion:
- Installing Mautic with Apache on Ubuntu 24.04 gives businesses a powerful open-source marketing automation tool.
- Integrating Apache, MariaDB, and PHP creates a robust marketing campaign management environment.
- Key steps include:
- Setting up the Apache web server and configuring it to serve Mautic.
- Installing the MariaDB database and creating a designated database for Mautic.
- Installing PHP and its necessary extensions to support Mauticās functionalities.
- Downloading Mautic files and configuring virtual host settings for seamless operation.
- Securing your installation with SSL/TLS using Letās Encrypt for enhanced security.
- Following the installation wizard ensures you can set up your Mautic account quickly and efficiently.
- With Mautic up and running, you can engage with your audience more effectively and manage your marketing strategies in a more controlled environment.
How do I install Mautic plugins?
Install Plugins If you are on a freshly installed Mautic instance, there is a chance that you don't have the default Plugins installed yet. Click on the Install/Upgrade Plugins button in the top right corner and all the Plugins should appear.
Does Apache run on Ubuntu?
There are several ways to start the Apache web server on Ubuntu, depending on whether you have a systemd-based system or a SysVinit-based system. A systemd-based system uses systemd as its init system, providing service management and parallelization.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, heās developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
I dont think computer programmers are actual real people. You are NPC the simulation runs you. you are the ONLY profession in the world who gets paid well to do NOTHING that ever works.
On the other page ur autheticator doesnāt even work. U are computer programmers cant make your own website work
Mautic isnāt designed to work. its NPC candy for dummies
BTW doesnt work