Multi-Tenant without Domain

Hi all,
I have two questions regarding the Multi-Tenant setup:

  1. If I do not have a registered Domain, only I have live IP on DigitalOcean, in this condition can I enable a multi-tenant feature for ERPNext?

  2. If I have a domain but it points to my website (eg: which has different IP, can I use it subdomain ( or for a multi-tenant setup?


1 Like

Well, sort of…
You can use only the IP address and setup the Multitenant as using different ports to represent each tenant. It will feel a bit wonky doing it that way since each site would be represented by a long string of ip numbers and port numbers. Will it work… yeah, but should you do it… probably not. It can get far too complicated.

Yup! This idea would work much better. I use this myself a lot to setup sandbox servers for testing different configurations of ERPNext. I own a few URL’s and then make each new tenant a subdomain of one of the owned URL’s. In this case you would be using Multitenant in DNS mode and it would be much easier to maintain.


Thanks for your quick reply…
Can you guide me: let assume my IP for the ERPnext server is and I have another server in which my website is host What changes I will made for the ERPNext server so that when I type it will show ERPNext site1.


First of all you would not use
Instead you would use just

You will need to go to the servise where you purchased your URL and use their DNS section to setup the sub domains and then just point the subdomain to the IP address in their DNS table.

Once you have that setup you can go to “” and enter your URL to see if it is fully propagated around the world so it will be available in the internet. Once that works everywhere (or at least in your region of the world) then you just use the instructions in the documentation to setup ERPNext as Multitenant and start adding sites and subdomains.

And before you ask… Yes, the system is smart enough to know that even though you are pointing multiple domain names to the same IP address they all go only to their respective ERPNext sites based on the separate site_config.json file with each site.

Hope this helps…

There are several tutorials on how to setup Multitenant here on the forum that can be found with a simple search.


1 Like

Thanks, I will give it a try.


I start to add a subdomain (sub1) from the Cpanel in my website I am using Cloudflare then I add “A” record with my website IP. Then I create an index.html file on my hosting server, it is working fine.
Then I update ClouldFalre A record IP address (sub1) with my ERPNext server, and update the ERPNext Multi-Tenant settings:

  1. bench config dns_multitenant on
  2. Update the host’s file: (for example)
  3. bench setup nginx
  4. sudo service nginx restart

When I check in the browser, I received an error:

Error 521

Ray ID: 67cf7bb…494f • 2021-08-11 06:42:20 UTC

Web server is down

Anything I missed?


1- If you don’t have a domain, you will not get an SSL certificate. so you can only work with HTTP, not HTTPS. Okay for a test installation, but not advisable for production env. Multi-tenant can be done with multiple TCP ports with the same IP
We have documented this scenario here

Yes! You tried to force entries into files that do not need to be edited. Try it this way first:

bench config dns_multitenant on
bench setup add-domain --site site1.local []
bench setup nginx
sudo service nginx restart

You do NOT need to update the host’s file. Let the site_config.json file take care of that all by itself using the steps above. If you want to then add additional tenants use the following steps:

(This assumes you already ran the “bench config dns_multitenant on” command)

bench new-site [] 
bench setup nginx
bench service nginx restart
bench --site [] install-app erpnext

At this point it seems you might be trying to over-think this process. The steps I laid out above will take care of updating all of the files that need changes and you do not have to edit anything manually except the manual setup of the DNS pointer to your IP Address at your service provider.


OK Sir,
Thanks for your assistance.


If we restart nginx with the command

bench service nginx restart

will this cause the other sites be non reachable for a certain period.
Is there a way to add a new-site and setup nginx without restart?

Yes, but usually less that a second. Possibly 2 seconds for a slow and overworked server.

I believe the command “sudo server nginx reload” will reload the config file without restarting the nginx binaries.


1 Like