Multi-tenant vs. Single-tenant Modes in Frappe for Windows, macOS, and Linux

frappe multi tenant and single tenant

Frappe Multi-tenant and Single-tenant Setup Guide

Frappe multi-tenant
Frappe
Frappe macOS
Frappe on WSL2
Frappe Linux

Single-tenant Mode

To activate single-tenant mode, use the following command:

bench use [siteName]

Running this command effectively active single tenant mode and disables multi-tenant mode. It updates the sites/common_site_config.json file, setting the default_site property for your designated site.

Single Tenant Mode

Multi-tenant Mode in macOS and Linux

To switch to multi-tenant mode on macOS or Linux, follow these steps:

  1. Open common_site_config.json.
  2. Locate the default_site entry and remove this line.

Removing Default Site for Multi-Tenant Mode

Next, run:

bench --site [siteName] add-to-hosts

This command binds your [siteName] to localhost. To verify, check the hosts file by entering the following command (for Ubuntu):

sudo nano /etc/hosts

Editing Hosts File

Finally, initiate the server:

bench start

Your site should now be accessible at [siteName]:8000.

Multi-tenant Mode on Windows (with WSL2)

Important Notes:

  • Avoid using camel case in the site name (aSite is invalid; asite is valid).
  • You can rename the site at any time by renaming the site folder.
  • It's recommended to append .local to your site name.

Setup Process

  1. Determine the IP address of WSL2 by running:
    hostname -I
    Save this IP for future steps.
  2. Open the Windows hosts file located at:
    C:\Windows\System32\drivers\etc
  3. Edit the hosts file by adding the following rules:Multi-tenant Mode on Windows
    # Frappe with WSL 2
    [WSL2-IP] [yourFrappeSiteName]
    [WSL2-IP] [yourFrappeSiteName]
    Example:
    # Frappe with WSL 2
    172.28.248.89 asite
    172.28.248.89 rentalsite
  4. Start the server with:
    bench start

Your site is now accessible via:

http://[siteName]:8000