Setting up Mautic on Ubuntu 24.04 with Apache allows you to run a powerful open-source marketing automation platform on a reliable server environment. This guide walks you through each step to get Mautic up and running smoothly, ensuring your marketing campaigns can be managed efficiently. Before starting, ensure you have a fresh Ubuntu 24.04 server and root or sudo access. Familiarity with Linux command-line operations is helpful but not mandatory, as this guide provides detailed instructions.
What You’ll Need
- Ubuntu 24.04 server (fresh install recommended)
- Root or sudo user access
- Domain name pointing to your server’s IP address
- Basic knowledge of Linux commands
Step-by-Step
- Update your system packages: Run
sudo apt update && sudo apt upgrade -yto ensure all packages are current. - Install Apache web server: Execute
sudo apt install apache2 -y. Enable and start Apache withsudo systemctl enable apache2 && sudo systemctl start apache2. - Install PHP and required modules: Mautic requires PHP 8.2+ and several extensions. Install them with:
sudo apt install php php-cli php-common php-mbstring php-xml php-bcmath php-curl php-zip php-mysql libapache2-mod-php -y - Configure PHP settings: Edit
php.inito set appropriate limits:sudo nano /etc/php/8.2/apache2/php.iniSet values like:
memory_limit = 512M upload_max_filesize = 50M post_max_size = 50M default_socket_timeout = 600 - Install MySQL Server: Run
sudo apt install mysql-server -y. Secure it withsudo mysql_secure_installationand create a database and user for Mautic:sudo mysql -u root -pCreate database:
CREATE DATABASE mauticdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'mauticuser'@'localhost' IDENTIFIED BY 'your_secure_password'; GRANT ALL PRIVILEGES ON mauticdb.* TO 'mauticuser'@'localhost'; FLUSH PRIVILEGES; EXIT; - Download Mautic: Navigate to your web directory and download the latest Mautic package:
cd /var/www/html sudo wget https://github.com/mautic/mautic/releases/latest/download/mautic.zip - Extract and set permissions: Unzip the package and assign ownership:
sudo apt install unzip -y sudo unzip mautic.zip -d mautic sudo chown -R www-data:www-data /var/www/html/mautic - Configure Apache virtual host: Create a new config file:
sudo nano /etc/apache2/sites-available/mautic.confAdd the following, replacing
yourdomain.com:<VirtualHost *:80> ServerName yourdomain.com DocumentRoot /var/www/html/mautic <Directory /var/www/html/mautic> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/mautic_error.log CustomLog ${APACHE_LOG_DIR}/mautic_access.log combined </VirtualHost> - Enable site and rewrite module: Run:
sudo a2ensite mautic.conf sudo a2enmod rewrite sudo systemctl reload apache2 - Complete the installation via web interface: Open your browser and navigate to
http://yourdomain.com. Follow the on-screen instructions to connect to your MySQL database and configure Mautic.
Common Mistakes
- Not updating system packages before starting, leading to compatibility issues.
- Forgetting to set correct permissions on the Mautic files, causing access errors.
- Using incorrect PHP version or missing required PHP modules.
- Not securing your database with a strong password or not setting proper privileges.
- Failing to enable Apache rewrite module, which is essential for Mautic’s URL rewriting.
- Overlooking PHP configuration settings like memory_limit or max_execution_time, which can cause installation failures.
Tips
- Use a domain name rather than IP address for better branding and SSL setup.
- Configure SSL (Let’s Encrypt) after installation for secure connections.
- Regularly update your server and Mautic for security patches and new features.
- Backup your database and Mautic files periodically to prevent data loss.
- Monitor server logs for errors, especially after initial setup.
- Adjust PHP settings based on your expected email volume and campaign complexity.
Troubleshooting
If you encounter issues during installation or after deployment:
- Cannot access Mautic via browser: Check Apache error logs (
/var/log/apache2/mautic_error.log) for clues. Verify your DNS settings and ensure Apache virtual host is enabled. - Database connection errors: Confirm your database credentials are correct in the Mautic configuration. Test MySQL connection manually.
- Permission denied errors: Ensure the web server user (
www-data) owns the Mautic directory and files. - PHP errors or blank page: Check PHP error logs and verify PHP settings meet Mautic requirements.
- SSL issues: Ensure SSL certificate is properly installed and configured in Apache.
In case of persistent problems, consult the official Mautic documentation or community forums for specific guidance.
Frequently Asked Questions
1. Can I install Mautic without using a domain name?
Yes, you can access Mautic via your server’s IP address, but setting up a domain is recommended for SSL and branding reasons.
2. How do I secure my Mautic installation?
Use SSL certificates (Let’s Encrypt), secure your database with strong passwords, and keep your server updated with security patches.
3. What are the server requirements for Mautic?
Mautic requires PHP 8.2+, MySQL 5.7+, and at least 512MB RAM. A LAMP stack (Linux, Apache, MySQL, PHP) is recommended.
4. How do I upgrade Mautic when a new version is released?
Download the latest release, replace the old files, and run the upgrade script via the web interface. Always back up before upgrading.
5. Can I run multiple Mautic instances on the same server?
Yes, but each instance should have its own dedicated database and virtual host configuration to avoid conflicts.
6. How do I set up email sending in Mautic?
Configure SMTP settings in Mautic’s email configuration panel with your email provider’s SMTP details for reliable email delivery.
Related
- How to Hide Sender Initials and Pictures in Outlook.com
- How to Import Firefox Passwords to Edge in Windows 10
- How to Import Excel List into Outlook Contacts Easily