איך אני יכול לארח יותר מפורום Discourse אחד על VPS אחד?

סיכום מבוסס בינה מלאכותית

In a discussion titled “How can I host more than 1 Discourse forum on 1 VPS?”, Aiden12114 asks for beginner-friendly, step-by-step guidance. neounix confirms it’s possible but warns it’s an advanced topic requiring knowledge of reverse proxies, virtual hosts, SSL, and web app configuration — which Aiden12114 admits to not knowing. riking offers two options: multisite (more complex, using one container for multiple sites) or multiple containers (slightly complex, requiring a reverse proxy, more expensive). neounix elaborates on the trade-offs: multisite means all sites go down if the single container fails, while multiple containers isolate failures to one site. They note Docker’s overlay2 storage driver minimizes disk usage across containers, making multi-container setups practical. neounix recommends the multi-container approach for reliability and isolation, citing their own operational preference. Links and a diagram explain Docker’s overlay filesystem for deeper context.

Hello! I as wondering if I can host more than one Discourse on 1 VPS. Since i’m a beginner, can I please have clear, step-by-step instructions? Thanks.

Yes you can!

However, this is an advanced topic you will need to know these basic concepts:

  • What is a reverse proxy?
  • What reverse proxy should I use?
  • How do I configure a virtual host on a reverse proxy?
  • How do I configure a virtual host as a reverse proxy to my web app?
  • How do I configure a web app to work with a reverse proxy?
  • How do I set up SSL when using a reverse proxy.

@Aiden12114, are you familiar with these concepts?

If so, you are good to go, for sure!

Sadly, I have no idea what any of that means :rofl:

You have two options:

  • Multisite - more complicated Multisite configuration with Docker
  • Multiple containers - slightly complicated (requires a reverse proxy etc as mentioned above), more expensive.
    Follow the instructions for setting up Discourse without the ./discourse-setup script (cp samples/standalone.yml containers/app2.yml) and rename the volumes to something other than standalone.

I think it is important to share a few technical facts to anyone interested or making a decision about this:

  • A single Discourse container with multiple “sites” per container, or
  • Multiple containers for each Discourse “site”.

If you use the “single container, multisite” approach, and you have 5 Discourse sites up and running (or even 10), when you rebuild your container, or have a problem with the container for any reason, you will have 5 (or 10) Discourse sites failing (or down) at the same time. This is because you have one container supporting all the “sites”.

If you use the “multiple container” approach, and you have 5 Discourse sites up and running (or 10), when you rebuild a container for one of your sites, or have a problem with a site container for any reason, you will have 1 Discourse site failing (or down). This is because you have one container supporting one “site” (or two if you are running separate data and app containers, per site, like we do).

In addition, because how Docker overlays and shares all of the read-only layers for each container (when using the Discourse recommended Docker storage driver, overlay2) between containers; only a thin read-write overlay layer is unique per container (for log files, the cache, etc), using multiple containers does not take very much additional disk space due to how the OverlayFS works.

For more on this interesting topic of how the Docker overlay driver works (and shares libs between containers), kindly refer to:

Obviously, the choice is up to each sys admin which approach to take. Based on our analysis, we have chosen to always go with the multi-container approach; for the reasons outline above (and some reasons yet discussed).

HTH