Skip to main content

Installing a Discourse Forum on Debian Bullseye with Docker

Shenzhen, China

Install Discourse

Clone the Official Discourse Docker Image into /opt/discourse:

mkdir /opt/discourse
git clone https://github.com/discourse/discourse_docker.git /opt/discourse
cd /opt/discourse

Setting Up an SMTP EMail Server

Already have a mail server? Great. Use your existing mail server credentials. (Free email services like Gmail/Outlook/Yahoo do not support transactional emails.) No existing mail server? Check out the Email Troubleshooting Guide.

Also make sure that you have a valid Domain pointing to your Discourse server

Edit Discourse Configuration

Launch the setup tool at

./discourse-setup

Answer the following questions when prompted:

Hostname for your Discourse? [discourse.example.com]: 
Email address for admin account(s)? [me@example.com,you@example.com]: 
SMTP server address? [smtp.example.com]: 
SMTP port? [587]: 
SMTP user name? [user@example.com]: 
SMTP password? [pa$$word]: 
notification email address? [noreply@forum.instar.com]:
Let's Encrypt account email? (ENTER to skip) [me@example.com]: 

You'll get the SMTP details from your email setup, be sure to complete that section.

This will generate an app.yml configuration file on your behalf, and then kicks off bootstrap. Bootstrapping takes between 2-8 minutes to set up your Discourse. If you need to change these settings after bootstrapping, you can run /opt/discourse/discourse-setup again (it will re-use your previous values from the file) or edit /opt/discourse/containers/app.yml manually with nano and then /opt/discourse/launcher rebuild app, otherwise your changes will not take effect.

ERROR:

Updates successful. Rebuilding in 5 seconds.
Building app
x86_64 arch detected.
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
(<unknown>): did not find expected key while parsing a block mapping at line 40 column 3 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.

Solution:

Make sure not to put single quotes around your admin email accounts!

Wrong way:

Email address for admin account(s)? [me@example.com,you@example.com]: 'me@example.com,you@example.com'

Go to /opt/discourse/containers/app.yml and remove the double single-quotes around your emails and re-run ./discourse-setup.

Start Discourse

Once bootstrapping is complete, your Discourse should be accessible in your web browser via the domain name discourse.example.com you entered earlier.

Register New Account and Become Admin

Installing a Discourse Forum

Manual Update (Discourse CLI)

cd /opt/discourse
./launcher rebuild app

If you are running low on disk space:

./launcher cleanup