# Mautic multi-domain support on single instance using subdomains?

**URL:** <https://forum.mautic.org/t/mautic-multi-domain-support-on-single-instance-using-subdomains/18421>\
**Category:** Product Support\
**Created:** [March 3, 2021, 3:46pm UTC](https://forum.mautic.org/t/mautic-multi-domain-support-on-single-instance-using-subdomains/18421 "2021-03-03T15:46:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![openletter](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/openletter/32/1602_2.png) [@openletter](https://forum.mautic.org/u/openletter)\
**Post date:** [March 3, 2021, 3:46pm UTC](https://forum.mautic.org/t/mautic-multi-domain-support-on-single-instance-using-subdomains/18421/1 "2021-03-03T15:46:22Z")

</div>

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:

```auto
# 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:

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [March 3, 2021, 5:08pm UTC](https://forum.mautic.org/t/mautic-multi-domain-support-on-single-instance-using-subdomains/18421/2 "2021-03-03T17:08:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![openletter](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/openletter/32/1602_2.png) [@openletter](https://forum.mautic.org/u/openletter)\
**Post date:** [March 3, 2021, 5:17pm UTC](https://forum.mautic.org/t/mautic-multi-domain-support-on-single-instance-using-subdomains/18421/3 "2021-03-03T17:17:53Z")

</div>

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.
