Mautic multi-domain support on single instance using subdomains?

I am currently looking at starting newsletter for a few domains that of course begin at zero and hopefully grow from there.

Overall, Mautic seems the best self-hosted solution for newsletter management most especially because it integrates the marketing automation.

I am understanding that Mautic currently supports one domain per installation. So, if I have more than one domain, I should use more than one installation.

To resolve this, I am planning on having a VPS serve one virtual server for each domain using a given subdomain, for example. mautic.example.com, mautict.example.net, and mautic.example.org.

The only thing I’m not clear on is whether the cron jobs can be configured to support this.

From the mauteam website I can see the following recommended cron jobs:

# Cron jobs for Mautic 3
* * * * * php /var/www/html/bin/console mautic:segments:update
* * * * * php /var/www/html/bin/console mautic:campaigns:update
* * * * * php /var/www/html/bin/console mautic:campaigns:trigger

If I have a unique Mautic installation for each domain, would I make cron jobs pointing to the unique install? For example:

# Cron jobs for Mautic 3
* * * * * php /var/www/example.com/bin/console mautic:segments:update
* * * * * php /var/www/example.com/bin/console mautic:campaigns:update
* * * * * php /var/www/example.com/bin/console mautic:campaigns:trigger

* * * * * php /var/www/example.net/bin/console mautic:segments:update
* * * * * php /var/www/example.net/bin/console mautic:campaigns:update
* * * * * php /var/www/example.net/bin/console mautic:campaigns:trigger

* * * * * php /var/www/example.org/bin/console mautic:segments:update
* * * * * php /var/www/example.org/bin/console mautic:campaigns:update
* * * * * php /var/www/example.org/bin/console mautic:campaigns:trigger

Are there other problems I did not find? (Other than my ability to correctly configure virtual domains.

This is on a server running nginx with PHP 7.3.

1 Like

You are exactly right with the multiple cron jobs.
Some side note:

  • better not run the crons every minute
  • try to get to PHP 7.4 if you can - Mautic 3.3 requires it
  • make sure to run the cron jobs with the same user your nginx is using (i.e. add a sudo to the cron statements)

Best,
Ekke

1 Like

Thanks for the response, that pretty much answers my main question. I was already planning to dig deeper into what those commands actually do and from there figure out if the recommended intervals are what I actually want, which I assume I can get from the docs.

I got the 7.3 from the install docs, but I don’t have a link at this moment. I should be able to run 7.4 since the server will only be running Mautic on the server.

I’m pretty sure I have both php and nginx configured to run as user www-data, but yeah I better check that ahead of time as cron may be running the cli config, which I usually never mess with.