Install ERPNext DNS based Multi-tenancy, with these file structure

Usually, With DNS based multitenancy, I usually configure each ERPNext projects as: and another Each one has to be setup like this.
Now the question is: Can I change them as to reduce creating subdomains.

For example:

If Yes, Please let us know. How?


Not sure why you don’t want to create subdomains because it will save you from using specific ports for each domain you create. Therefore, to avoid constantly creating subdomains, you can setup wildcard subdomains for your domain *

Basically you would continue to setup your site as you normally would using bench and Nginx will take care of routing to the right subdomain.

This might help you a start:

Please note that I have not tested this. I have done wildcard domains in Apache and they work on the same principle. You also need to make sure that you have an entry in your DNS records indicating the wildcard domain where instead of name you would enter an asterisk “*” and in the IP part enter the IP you wish to point the wildcard domain.

Hope this helps

I’m already using the same you told above. Everything is perfectly working. In addition to that, I want to install ERPNext in Sub-Directory. Just like:


My concern is, with stickying same domain, by just changing Subdirectory only. Possible to install and use independent ERPNext environment without conflicting data from * to *

Based on the Application Structure, Frappe & ERPNext as well as any other app you install, are common to all the sites, meaning one shared codebase. Am pretty sure its designed such so that one only have to maintain that one codebase.

If I understand correctly, you want each to have its own instance of ERPNext.

What I am unsure about with your desired configuration, Where do you see the conflicting data since each site created uses its own database.

I was able to achieve this for gunicorn API calls on Kubernetes using ingress-nginx annotations for rewrite.

More: Rewrite - Ingress-Nginx Controller