How to install Mautic on EE in a subdomain

Folks, hello to all.

I need help to install the mautic in two steps.

First I need to creat a subdomain in a domain that I already have Second is create a mysql instance to connect the mautic and make this works, but I dont know the user and password to connect into

thank you all


I don’t know what Mautic is.

But if it is a standard PHP script all you need is:

ee site create --mysql

Then take note of the MySQL credentials that will appear on your screen. EE will also create a file named ee-config.php on /var/www/

thanks for the information, I think something is doing wrong with my maria db check the error message

Running pre-update checks, please wait… Setting up NGINX configuration [Done] Setting up webroot [Done] Setting up database Oops Something went wrong !! Calling cleanup actions … Reload : nginx [OK] Check logs for reason tail /var/log/ee/ee.log & Try Again!!!

I’ve searched a lot to know how to install Mautic on EE in a subdomain. Following steps is what works for me (Ubuntu 16.04/Debian 8 | Mautic v2.9.0). Hope it help.

1. Create a subdomain with SSL (let’sEncrypt recently does not support wildcard SSL, wait til Jan 2018):

ee site create --mysql --le

REMEMBER to note down: database name, user & password.

2. Get to the folder and download Mautic:

cd /var/www/

3. Unzip and delete zipped files:


if upzip is not installed, execute this command first:

apt install unzip

4. Change owner of the folder:

chown -R www-data:www-data .

chmod -R g+rw .

5. Configuration for the site:

  • Edit file (Select all > Delete > Paste):


  • With the following code:

      server {
      listen 80;
      listen [::]:80;
      access_log /var/log/nginx/ rt_cache;
      error_log /var/log/nginx/;
      root /var/www/;
      index index.php index.html index.htm;
      charset utf-8;
      # redirect index.php to root
      rewrite ^/index.php/(.*) /$1  permanent;
      # redirect some entire folders
      rewrite ^/(vendor|translations|build)/.* /index.php break;
      location / {
          try_files $uri /index.php$is_args$args;
      location ~ \.php$ {
          try_files $uri =404;
          include fastcgi_params;
          fastcgi_pass php;
      # 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;
      include /var/www/*.conf;

6. Edit php.ini file in:


Add the following line to the PHP configuration section:

always_populate_raw_post_data = -1

7. Restart the stack:

ee stack restart

8. Access to complete the installation process.

You may have to create/sign up/… SMTP server before the installation process.

9. Enjoy!


I’ve installed Mautic on successfully because on subdomain it did not work! :sweat:

Tested your tutorial on a fresh ee (Ubuntu 16.04 LTS on Linode).

Did you set up your main site as **www.** instead of naked domain as If not, maybe that’s the problem.

Hey @bravenguyen I’ve successfully installed Mautic with your instructions, but I’m having problems with tracking js. I keep getting not found errors.

Hi @goranculibrk

Try to switch to PHP7. PHP7 solved my problem the same as yours Execute the following command to switch:

ee site update --php7

After that, don’t forget to edit the file in


The same content as above but except the following (for php7):

location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass php7;

Hope it help!

What should I do to make Mautic running properly under ee site create command?

I’m facing issues about non-www redirection on my site.