Setting up Discourse on a VPS with other sites

AI-generated summary

JoyalV is seeking guidance on installing Discourse on an Ubuntu 16.04 VPS that already hosts two websites using Apache. The primary goal is to run Discourse as a Docker container on a subdomain (e.g., forum.example.com) while obtaining SSL certificates via Let’s Encrypt 1.

Falco provided a reference thread for running other websites alongside Discourse 2. mpalmer noted that while the linked guide uses Nginx, the process must be adapted for Apache 4. JoyalV proposed creating a VHost in /var/www or /var/discourse, but pfaffman clarified that a reverse proxy should be configured instead of installing Discourse files directly on the host’s file system 6. Specifically, mpalmer emphasized that no VHost should be set up on the host system; rather, traffic for the Discourse subdomain should be proxied directly into the container 8.

fefrei suggested a potentially easier architecture: reconfigure Apache to listen on a non-standard port and use Nginx as a reverse proxy to handle all traffic, including SSL termination 9. However, JoyalV expressed confusion regarding these advanced steps, noting a lack of experience with Nginx or changing Apache ports, and emphasized they need to install Discourse from scratch alongside existing sites 10, 12. pfaffman warned that running both applications requires at least 2GB of RAM and that without knowledge of Apache configuration, the advanced proxy instructions might be difficult to follow 14.

Hello,

I have a Ubuntu 16.04 VPS with Apache running two websites. I want to setup discourse but it seems like it will be a docker container (concept I am new to),.

How do I go about giving discourse a subdomain like forum.example.com then ensuring I can install SSL certs with Lets’ Encrypt?

Following instructions here: discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub

I am using Apache, so I would create another VHost in /var/www ?

Or would I create a vhost and set it’s default folder as /var/discourse ?

You’ll need to translate the instructions in the topic @Falco linked to from nginx to Apache.

Hmmm, I don’t know anything about nginx but I can try I guess

Gets pretty much it, but you configure the host add a reverse proxy.

so I would setup a VHost /var/www/discourse.domain.com and install in discourse in there rather than /var/discourse

And then add a reverse proxy?

No, you don’t setup a vhost anywhere on the host system. You proxy everything for the Discourse subdomain into the container.

There’s a (in my opinion) slightly easier alternative:

  1. Configure your Apache to listen on a different port.
  2. Set up nginx as a reverse proxy as described above.
  3. Set up nginx to proxy the non-Discourse traffic to Apache’s port.

Note that if you want HTTPS (and you do want that), in that case, you’ll have to set this up in nginx.

I have no idea how to do that. All I have done is setup two sites with apache vhost and now want to add discourse

Instructions for steps :two: and :three: have already been posted by @Falco above:

Idk how to “Configure your Apache to listen on a different port.”

And the instruction says "This guide assumes you already have Discourse working " which I don’t. I am trying to install it onto a VPS with 2 normal sites already configured

You’ll need 2gb to run Apache and Discourse, so if your current host doesn’t have 2 GB then there’s no advantage to using the same host.

If you don’t know how to change Apache port, you can Google that, but it likely means that the other instructions will be difficult to make sense of.