How to Install Mautic with Apache on Ubuntu 24.04
Installing Mautic with Apache on Ubuntu 24.04 sets up your own marketing automation software.
Mautic is a free tool that lets you automatically send emails, schedule social media posts, create landing pages, and manage marketing campaigns from your own computer server.
Apache is the web server that makes your Mautic site visible online. This guide shows you how to install Mautic, specifically version 5.x, using Apache on Ubuntu 24.04.
Having full control over your marketing data and campaigns, without relying on other companies, is a major benefit of hosting Mautic yourself.
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
Install Apache on Ubuntu 24.04 to host your Mautic application. Apache is the web server software that makes your Mautic site available online. Running a simple command in your terminal will get your server ready to serve web pages for Mautic.
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
Install the MariaDB database server on Ubuntu 24.04 using your terminal to store Mautic’s important data. MariaDB will hold all your contact lists and campaign details securely. This step sets up a safe place for Mautic’s information.
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
Create a Mautic database named ‘mauticdb’ and a user ‘mauticdbuser’ with full permissions. This gives Mautic its own secure storage for data, separate from other databases. Creating this dedicated space is vital for Mautic to work correctly.
The `mauticdbuser` account receives full access to the `mauticdb` database, which allows Mautic to manage its data. This specific database access is crucial for Mautic's operational functions after Mautic installation on Ubuntu 24.04.
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
Install PHP on Ubuntu Linux
Install PHP and its required extensions on your Ubuntu 24.04 server using a terminal command. Mautic is built using PHP, and these extensions are necessary for it to run properly. This step ensures Mautic has the right programming language environment.
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
Download the latest Mautic files onto your Ubuntu 24.04 server using Composer and Git. First, install these tools via the terminal, then use Composer to get the Mautic software. This places the application on your server and prepares it for setup.
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.
You can enable the Apache virtual host by running `sudo a2ensite mautic.conf` and restart the Apache server with `sudo systemctl restart apache2`. This action makes Mautic accessible on your server.
sudo a2ensite mautic.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Setup Let’s Encrypt SSL/TLS for Mautic
Secure your Mautic installation with a free Let’s Encrypt SSL/TLS certificate for Apache on Ubuntu 24.04. This enables HTTPS, making your Mautic site safe and trustworthy for visitors. Proper security is essential when handling sensitive marketing data.
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