What’s old is new again. In 2015 I wrote about Reclaim Hosting experimenting with the next-generation forum software Discourse using a multi-user Docker setup. We use Discourse for Reclaim’s Community forums and I’ve grown to love the software.* What’s more, as that 2015 post notes, it epitomizes some of the challenges of running these next-generation apps on existing, affordable commodity web hosting: namely it runs Ruby using Nginx and requires transactional email. As Tim pointed out yesterday, I never take the easy road with this stuff. Discourse, even on the Reclaim Cloud, is not a simple, one-click install. But I know folks asked me about it, so I wanted to see what the process looks like, and then document it, which I have in the Reclaim Community Forums (which will not be available for another two weeks given we are still building this out, but I will paste in below). I am also working on a video tutorial for this install.
The following guide describes the process of setting up Discourse on Reclaim Cloud, but before I paste it below a note for my particular case that is not necessarily generalizable. When mapping the forum it seems the proxied A record for discourse.bavatuesdays.com through Cloudflare (where I manage DNS for bavatuesdays) was creating issues. I needed to turn that off for Domain mapping to work:
If you are not using Cloudflare this issue should not occur, but it frustrated me for quite a bit.
To begin with you will need to setup a Docker Engine on Reclaim Cloud, by clicking on the downward-facing arrow next to the Docker tab:
After that select Docker Engine:
At the next prompt create the domain (bava-discourse.ca.reclaim.cloud), name the server (Bava Discourse), and decide in what region you want the app to live (blame Canada!).
At this point your Docker Engine server will be spun up, and once it is you can login via the web-based SSH window provided to install Discourse:
From the command line you can install Discourse (and the command line will follow) but before you do you need to ensure 1) you have a transactional email account working and 2) an A record pointed to the container’s public IP address if you plan on using a domain other than mydiscourse.us.reclaim.cloud. In this example we’ll be mapping Discourse to the URL discourse.bavatuesdays.com.
Transactional email services, like Mailgun and SparkMail, allows you to setup email sending and receiving for apps like Discourse. For this example we used Mailgun, and the crucial information you will need are the SMTP server address, SMTP port, SMTP username, and SMTP password. Along with the domain name, this is the information you will be prompted for when setting up Discourse, and if the email does not work (i.e. is not verified through your transactional email service) you will not be able to use the application.
This guide for setting up a new email domain using Mailgun could prove useful. But keep in mind there are more options.
Once that is done you can now begin installing Discourse. From the command line run the following commands:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
After that you can launch the Discourse setup tool:
At this point you will be prompted for domain, email, SMTP details, etc.
Hostname for your Discourse? [discourse.example.com]:
Email address for admin account(s)? [firstname.lastname@example.org,email@example.com]:
SMTP server address? [smtp.example.com]:
SMTP port? :
SMTP user name? [firstname.lastname@example.org]:
SMTP password? [pa$word]:
Let's Encrypt account email? (ENTER to skip) [email@example.com]:
We recommend defaulting to port 587 and skipping Let’s Encrypt account email if you do not want to receive email about the built-in SSL certificate.
This will generate an
app.yml configuration file on your behalf, and then starts the install which takes a few minutes. If you need to change these settings after installation, you can run
./discourse-setup again (it will re-use your previous values from the file) or edit
/containers/app.yml manually with nano and then
./launcher rebuild app, otherwise your changes will not take effect.
Last thing is if you are using a domain other than that provided by Reclaim Cloud you will need to go to Settings–>Custom Domains and add the domain there. Additionally, the domain you are pointing needs to have an A record pointed at the Docker Engine container’s public IP address.
After that, go to the domain and Discourse should be installed and ready to setup.
*We are now running Reclaim’s Discourse forum in the Reclaim Cloud quite seamlessly.