Install Discourse on Debian 11

This article has been created to show you how to install Discourse on Debian 11. Discourse is an open-source discussion forum and mailing list allowing you to collaborate with your team in a work environment. Discourse was written in Ruby on Rails as a backend language, Ember.js as a frontend, and uses PostgreSQL for data storage.

Cool features of Discourse include but not limited to two-factor authentication, social login, spam blocking, single sign on, emojis.

Install Discourse on Debian 11


  • A valid domain name or hostname
  • An SMTP mail server set up
  • Root privileges
  • Docker installed

Install Docker on Debian 11

Update system packages first

 sudo apt update

Install required packages:

 sudo apt install \
    ca-certificates \
    curl \
    gnupg \

Create a folder to store GPG keys

 sudo mkdir -p /etc/apt/keyrings

Setup a stable repository:

 curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
 echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the system packages once more:

sudo apt update

Install docker

sudo apt install docker-ce docker-ce-cli docker-compose-plugin

Install Discourse on Debian 11

Create a folder to store Discourse files.

mkdir -p /var/discourse/

Clone the discourse repository:

git clone /var/discourse/

Go to the directory created above:

cd /var/discourse/ 

Run Discourse setup to install it.


The setup will prompt you to enter correct configurations. To begin with, enter a valid domain i.e.

Does this look right?

Hostname          :
Email             : [email protected]
SMTP address      :
SMTP port         : 587
SMTP username     : [email protected]
SMTP password     : [email protected]
Notification email: [email protected]
Maxmind license: (unset)

Next setup details for Let’s Encrypt. Provide an email address for admin account, SMTP address, SMTP port, SMTP username, SMTP password and email address for notification and Let’s Encrypt (optional) and press enter.

I will not enter notification email, Let’s Encrypt email and Maxmind license key

Checking your domain name . . .
Connection to succeeded.
Email address for admin account(s)? [[email protected],[email protected]]: [email protected]
SMTP server address? []:
SMTP port? [587]: 587
SMTP user name? [[email protected]]: [email protected]
SMTP password? [pa$$word]: [email protected]
notification email address? [[email protected]]: 
Optional email address for Let's Encrypt warnings? (ENTER to skip) [[email protected]]: 
Optional Maxmind License key (ENTER to continue without MAXMIND GeoLite2 geolocation database) [1234567890123456]: 

Confirm that the details you have entered are correct and press enter to continue.

Does this look right?

Hostname          :
Email             : [email protected]
SMTP address      :
SMTP port         : 587
SMTP username     : [email protected]
SMTP password     : [email protected]
Notification email: [email protected]
Maxmind license: (unset)

Wait for installation to complete. An app.yml configuration file will be generated.

Remember to rebuild your app every time you edit the file /var/discourse/containers/app.yml using the command:

 ./launcher rebuild app

Access Discourse Web Interface

In your browser, type the URL or i.e You will be asked to register an admin account.

Install Discourse on Debian 11

Click on Register and enter the admin account details on the next page.

Install Discourse on Debian 11
Register an admin account

Check the email you provided and follow the instructions to activate your account

Install Discourse on Debian 11
Confirm your email

From there, you can set up few things and continue to use Discourse. That is it! You have managed to install Discourse in Debian 11.

Upgrade Discourse

To upgrade Discourse, move to Discourse directory

cd /var/discourse/

Get the latest version and rebuild the app to apply changes

git pull
./launcher rebuild app

How to uninstall Discourse from Debian 11

First check the container ID by running the command:

docker ps
CONTAINER ID   IMAGE                 COMMAND        CREATED          STATUS          PORTS                                                                      NAMES
e32f658cac7f   local_discourse/app   "/sbin/boot"   53 minutes ago   Up 53 minutes>80/tcp, :::80->80/tcp,>443/tcp, :::443->443/tcp   app

Next, stop the container using the ID above.

docker stop container e32f658cac7f   

Finally, delete the container using the same ID

docker container rm CONTAINER e32f658cac7f   


You have been able to install Discourse on Debian 11. Find out more features and how to use Discourse from the Discourse official website.

Similar interesting tutorials

Install Mattermost on Ubuntu 22.04

Install LAMP Stack on OpenSUSE

Install PHP 8 on OpenSUSE

Install MS Teams App on OpenSUSE

Android Developer | Linux | Technical Writer | Backend Developer

Leave a Comment