Skip to content

Guide Multi Tenancy

github-actions[bot] edited this page Apr 26, 2026 · 2 revisions

Guide: Multi-Tenancy

Run multiple independent ɳSelf projects on a single server. Each project is fully isolated with its own containers, network, and port range.

How It Works

Each nself init call creates a named project. Projects share the host OS but are separated by:

  • Docker network isolation, each project gets its own bridge network ({project}_default)
  • Port separation, each project is assigned a unique port range for internal services
  • Nginx isolation, separate virtual host configs under nginx/sites/
  • Data isolation, separate Postgres instance and volume per project

Setting Up Multiple Projects

# Project 1
cd /srv/project1
nself init project1 --env prod
# Edit .env.prod: set BASE_DOMAIN=project1.example.com
nself build && nself start

# Project 2
cd /srv/project2
nself init project2 --env prod
# Edit .env.prod: set BASE_DOMAIN=project2.example.com
nself build && nself start

Port Allocation

ɳSelf assigns unique ports per project to avoid conflicts. Check assigned ports:

nself urls        # shows all service URLs for the current project
nself status      # shows running services and their ports

If you initialise projects in separate directories, ɳSelf handles port selection automatically.

DNS Configuration

Each project should have its own subdomain:

A  project1.example.com  → server IP
A  project2.example.com  → server IP

Or use path-based routing if your use case supports it.

Resource Considerations

Each project runs its own Postgres, Hasura, and Auth containers. On a 4 GB server, 2 projects is the practical limit. For 3+ projects, use an 8 GB+ server.

See Also


Home | _Sidebar

Home


Getting Started


Commands


Features


Configuration


Plugins (87 + 10 monitoring)

Free (25)
Pro (62)
Planned (26)
  • plugin-audit
  • plugin-blog
  • plugin-checkout
  • plugin-commerce
  • plugin-drm
  • plugin-export
  • plugin-flow
  • plugin-import
  • plugin-ldap
  • plugin-mailgun
  • plugin-media
  • plugin-oauth-providers
  • plugin-pages
  • plugin-postmark
  • plugin-rate-limit
  • plugin-reports
  • plugin-saml
  • plugin-scheduler
  • plugin-sendgrid
  • plugin-sso
  • plugin-subscription
  • plugin-thumb
  • plugin-transcoder
  • plugin-twilio
  • plugin-waf
  • plugin-watermark

Guides


Architecture


Reference


Licensing


Security


Brand


Operations


Contributing


Admin


Changelog

Clone this wiki locally