One server for 2 Discourse communities?

Right. That makes sense. And I think would be fine for me using mailgun.

I will understand all of this better if and when I start setting up a multisite!

3 לייקים

Jumping in because I’m in a similar situation as @alltiagocom — I’ve got discourse installed on a smallish Hetzner server for my main community but have been thinking, in the background, of moving a few other Facebook groups to Discourse once I have got the hang of things.

I’m familiar with « Wordpress multisite » but I’ve understood that Discourse multisite is more involved. I was wondering what would be less of a headache, running two standalone sites (or more) or a multisite.

Any insight on this?

Multisite would definitely be less maintenance overhead so less headaches but YMMV

לייק 1

For Discourse novices, I recommend just running two sites.

I made a topic for how to run multisite without a reverse proxy, but it’s out of date now.

I think all that needs to change is

can be replaced with the new

DISCOURSE_HOSTNAME_ALIASES: domain.com,other.domain.com
2 לייקים

My two cents, after spending the whole day working on this with the help of my old notes, ChatGPT, Claude, Discourse’s AI Bot, and some topics shared here (and after taking notes and more notes about the whole process).

Everything seemed to be working just fine until I got to the point where I needed to add the reverse proxy. My first instance, which was working fine, wasn’t working. I asked a few more questions to Discourse’s AI bot, but since that’s my first day, it stopped working. It’s a limitation for new users of the bot. Claude, who was being super helpful, also stopped, because I’m on the free version. ChatGPT is the least reliable of all, so all replies from it, are always received by me with a LOT of hesitance…

Then I came to the forum again and started reading a few topics about it, some written by @pfaffman. That was the last straw. Too complex, too much technical terms for me to even understand what to ask.

Summary: my first instance was working, so I’m reverting it back to what it was (editing the app.yml file to what it was before the changes. I’m rebuilding as I type.

To be honest, for all the complexity, even though it would allow me add more communities after going through the first big obstacle, I don’t think that saving $4 a month for an extra community will be the end of the world. Since I already know how to set up a server in Hetzner and then install Discourse, I will stick to 2 communities now, pay the $8 for both, and move on. Considering I was paying $12 for one droplet with Digital Ocean a few months ago, I can do the effort of paying the same amount for 3 communities if I want to.

Regardless, I always find these adventures interesting, because I learn something new along the way, and in the end, at least I can say why I don’t want to do it, rather than just saying “I won’t do it, because I don’t know if I can do it”.

I appreciate the time and help all of you shared here, and hopefully this topic will help others who want to achieve what I was trying to.

:raising_hands:
Over and out!

7 לייקים

This is exactly why I said You need to rethink your strategy, while what you were trying to achieve wasn’t impossible, because it has been done before, it requires significant understanding of discourse to be able to get right.

I’d recommend keep experimenting in your free time if you want to learn more about how discourse works, that’s how most of us here learned it.

9 לייקים

It took me much longer than I care to admit to (mostly) figure it out!

5 לייקים

6 posts were split to a new topic: Multiple app containers for a single Discourse site

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.

לייק 1