Serve multiple domain names on one site

i have multi-tenant setup and it is working with one tenant at “server.domain.com” how can i allow customers to get to www.domain.com and domain.com is this as simple as adding multiple host_ name in site_config.json

3 Likes

It’s pretty simple!

Just do

bench --site [site-name] setup add-domain [new-domain-name]

Followed by bench setup nginx and then restart nginx.

3 Likes

I’m trying to figure out multi-tenant dns. So my main site is under erp.company.com, I have another domain connected on www.newco.com. I can access these two from the different domains as mentioned.

I have several 4 other sites under my frappe, How do I access them ?

Great, works! How can we make this work with Lets Encrypt?

There’s a command to setup Let’s Encrypt for custom domains :

bench setup lets-encrypt --custom-domain

1 Like

Great! Thank you.

The full command is as follows:

sudo bench setup lets-encrypt --custom-domain my-custom-domain.tld my-site-name.tld

Run it from the frappe-bench folder.

2 Likes

Yeah, I didn’t remember the entire command, despite have had written the feature myself :grimacing:

1 Like

Please inform me. Why are we running this command in sudo?

Please give an example of this:

My bench is asking for the site:

command: sudo bench setup lets-encrypt --custom-domain example.com

response: Error: Missing argument "site".

Got it

Just feel unsure about the auto renewal part.

You forgot to put the site name after example.com

1 Like

Thanks. That was it. Didnt know it from the example.

Hi, It is probably too late but let me know if you can help. I have two companies in my setup and I haev two domains abc.domain.com and xyz.domain.com. these two domains are served by the single site.

now the problem is, the website content is the same for both the domains. is there a way (erpnext native setup) to modify the content based on the company the domain serves? I want the products/services of company abc to be served on abc.domain.com.

Set up dns multinancy and create different sites for abc and xyz domains. That way, both companies maintain completely separate data. See here:

https://frappe.io/docs/user/en/bench/guides/setup-multitenancy.html