How to Install Mautic on Debian Latest

Mautic is an open source marketing automation software that can help you automate your marketing campaigns and increase your productivity. This tutorial will guide you through the installation process of Mautic on Debian Latest.

Prerequisites

Step 1: Update and upgrade

Before installing packages, you should update the software repositories.

apt-get update
apt-get upgrade -y

Step 2: Install Required Packages

Mautic requires Apache, MySQL, and PHP to run. You need to install them by running the following command.

apt-get install apache2 mysql-server php php-mysql libapache2-mod-php -y

After installing these packages, you can check the version of PHP by running the command below.

php --version

Step 3: Create Database and User for Mautic

Mautic requires a database to store its data. You need to create a database and user for Mautic.

mysql -u root -p
CREATE DATABASE mautic;
CREATE USER 'mauticuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON mautic.* TO 'mauticuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

In the above example, replace the 'password' field with the desired password for the user.

Step 4: Download and Install Mautic

Download the latest version of Mautic from the following URL: https://www.mautic.org/download/latest

wget https://s3.amazonaws.com/mautic/releases/2.16.2.zip

Unzip the downloaded file.

unzip 2.16.2.zip -d /var/www/html

Rename the extracted folder.

mv /var/www/html/mautic-2.16.2 /var/www/html/mautic

Set the file permission.

chown -R www-data:www-data /var/www/html/mautic/
chmod -R 755 /var/www/html/mautic/

Step 5: Configure Apache for Mautic

Create a new Apache virtual host configuration file for Mautic.

nano /etc/apache2/sites-available/mautic.conf

Add the following code to the file.

<VirtualHost *:80>
  ServerAdmin [your email address]
  DocumentRoot /var/www/html/mautic
  ServerName yourdomain.com
  ServerAlias www.yourdomain.com
  <Directory /var/www/html/mautic>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/mautic_error.log
  CustomLog ${APACHE_LOG_DIR}/mautic_access.log combined
</VirtualHost>

Replace [your email address] and yourdomain.com with your information.

Enable the virtual host by running the following command.

a2ensite mautic.conf

Reload the Apache service.

systemctl reload apache2

Step 6: Complete the Installation

You can now navigate to your Mautic URL in a web browser to complete the installation by following the on-screen instructions.

http://yourdomain.com

Conclusion

Congratulations! You have successfully installed Mautic on your Debian Latest instance.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!