One server for 2 Discourse communities?

I’m documenting a supported Discourse multisite install as a command-by-command runbook.

I previously experimented with a “multiple standalone installs on one server” approach, but that configuration is not supported. This post focuses only on the supported multisite architecture, rewritten in a linear format for people who prefer explicit steps.


What this is (supported)

  • One Discourse app container (app)
  • Multisite enabled via multisite.yml
  • Shared Postgres + Redis (managed by Discourse)
  • Connectivity via unix sockets (no Docker network required)
  • Multiple hostnames routed to separate sites internally

What this is not

  • Multiple independent Discourse containers behind HAProxy
  • Rolling rebuilds by draining app nodes
  • Per-site SMTP credentials (SMTP is shared)

Operational notes (so expectations are correct)

Rebuilds / downtime

In multisite there is only one app container, so ./launcher rebuild app will restart the only node. That means short downtime for all sites is expected.

Certificates / host validation

Add all hostnames to DISCOURSE_HOSTNAME_ALIASES so Let’s Encrypt + host validation work reliably.

Backups / migration later

Each site makes its own backup in /admin/backups. Restoring a site backup onto a standalone install later is the normal migration path.


Full supported multisite runbook (command-by-command)

0) Host prerequisites

Step Command
Update system apt-get update && apt-get upgrade -y
Install dependencies apt-get install -y git curl sudo

1) Install Discourse Docker

Step Command
Clone repo git clone https://github.com/discourse/discourse_docker.git /var/discourse
Enter dir cd /var/discourse

2) Install first site (single site first)

Step Command
Run setup ./discourse-setup

This creates /var/discourse/containers/app.yml and boots the first hostname (e.g. forum1.example.com).


3) Enable multisite

Step Command
Create config dir mkdir -p /var/discourse/config
Edit multisite file nano /var/discourse/config/multisite.yml

Example multisite.yml:

forum1:
  host_names:
    - forum1.example.com

forum2:
  host_names:
    - forum2.example.com

4) Edit app.yml to enable multisite + hostname aliases

Step Command
Edit app.yml nano /var/discourse/containers/app.yml

Add:

  • DISCOURSE_MULTISITE: true
  • DISCOURSE_HOSTNAME_ALIASES: forum1.example.com,forum2.example.com

5) Rebuild

Step Command
Rebuild ./launcher rebuild app

6) Migrate multisite DBs

Step Command
Enter container ./launcher enter app
Run multisite migrate rails multisite:migrate
Exit exit
Step Command
Restart ./launcher restart app

7) Verify

Visit:

  • https://forum1.example.com
  • https://forum2.example.com

Each site has its own admin, users, uploads, and backups.


8) Backups / migration later

Per-site admin:

  • /admin/backups

Restore that backup onto a standalone install later if you want to split the site onto its own server.


If anything above conflicts with current best practice, I’m happy to update this runbook - the intent is to provide a linear supported multisite checklist that reduces trial-and-error.