Multi-tenancy lets you run multiple independent ERPNext sites on a single server. Each tenant gets their own database and domain but shares the same codebase. This is essential for hosting ERPNext for multiple clients or departments.

How Multi-Tenancy Works in ERPNext

Frappe Bench supports multi-tenancy natively. Each site is a separate database with its own users, data, and configuration. The Nginx config routes requests to the correct site based on the domain name.

STEP 1 Enable DNS Multi-Tenancy

cd frappe-bench
bench config dns_multitenant on

STEP 2 Create Multiple Sites

# Site for Company A
bench new-site companya.yourdomain.com
bench --site companya.yourdomain.com install-app erpnext

# Site for Company B
bench new-site companyb.yourdomain.com
bench --site companyb.yourdomain.com install-app erpnext

# Site for Company C
bench new-site companyc.yourdomain.com
bench --site companyc.yourdomain.com install-app erpnext

STEP 3 Set Up DNS

Point all subdomains to your server. You can use a wildcard DNS record:

# DNS A Records
companya.yourdomain.com  ->  your-server-ip
companyb.yourdomain.com  ->  your-server-ip
companyc.yourdomain.com  ->  your-server-ip

# Or use a wildcard
*.yourdomain.com  ->  your-server-ip

STEP 4 Setup Production with Nginx

sudo bench setup production erpnext

Bench automatically generates Nginx config that routes each domain to the correct site.

STEP 5 Add SSL for Each Site

sudo certbot --nginx -d companya.yourdomain.com
sudo certbot --nginx -d companyb.yourdomain.com
sudo certbot --nginx -d companyc.yourdomain.com

Managing Multiple Sites

# Backup all sites
bench --site all backup

# Migrate all sites after update
bench --site all migrate

# List all sites
bench --site all list-apps

# Run command on specific site
bench --site companya.yourdomain.com console

Resource Considerations

# Recommended server specs per number of sites:
1-3 sites:   4 GB RAM, 2 CPU
4-10 sites:  8 GB RAM, 4 CPU
10-25 sites: 16 GB RAM, 8 CPU

# Each site adds approximately:
- 200-500 MB RAM usage
- 1 Redis connection per service
- 1 MariaDB database

Multi-tenancy is one of ERPNext’s strongest features for service providers. You can host dozens of clients on a single server with complete data isolation between each one.

Share this article

4 Comments

Join the discussion. Got a question, found an issue, or want to share your experience?

  1. Ahmad Apr 13, 2026

    this is test

    1. Faraz Apr 13, 2026

      testing

      1. Faraz Apr 13, 2026

        yes yes

  2. Faraz Apr 13, 2026

    Hello dear

Leave a Comment

Your email stays private. We just use it for replies.

Nothing to preview yet.

Use **bold**, *italic*, `code`, ```code blocks```, [link](url), > quote, - list