Install Discourse on Ubuntu 20.04 LTS Focal Linux

Discourse is open source forum software that can also be used as a comment system for a website. The creators want to create the basis for modern Internet forums. Here we learn commands to install discourse on Ubuntu 20.04 LTS Focal Fossa Linux to create a self-hosted forum.

Steps to Install Discourse Forum on Ubuntu 20.04 LTS Server

The steps provided are common for other Ubuntu or Debian based Linux systems including Linux Mint, MX Linux, POP OS and more…


• Ubuntu 20.04 server • Docker • Non-rooted sudo user • Internet connection • At least 2 GB of RAM

1. Update Ubuntu 20.04 Server

To add a repository over HTTPS, we need to install the ca certificates, along with some of the other tools we asked in the tutorial. First, run the system update command and then install the required packages:

sudo apt update -y
sudo apt-get install apt-transport-https ca-certificates git curl gnupg -y

2. Setup Docker Repo

Discourse about Ubuntu 20.04 needs to have Docker installed properly, thus, to ensure we have the latest version of it; Let’s add a Docker repository and a GPG key using the given commands:

Add key:

sudo mkdir -p /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Add repo:

"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
sudo apt update

3. Install Docker for Discourse

Now, run the given command to install docker platform and other tools from it on your Linux Debian 11 system.

sudo apt-get install docker-ce docker-ce-cli -y

4. Download Discourse on Ubuntu 20.04

Once Docker is on our system, let’s create a custom directory for Discourse and then clone its git repository for further installation.

sudo mkdir /var/discourse

Now clone git repo

sudo git clone /var/discourse

5. Install and setup Discourse on Ubuntu 20.04

First switch to the directory we created and clone it.

cd /var/discourse

Start the script

Now, start the script:

sudo ./discourse-setup

Setup will ask you to add the address of the domain you want to use with Discourse:

For example:

Then to send mail, the user has to set the SMTP server address of the mail server that you want to use. It will ask for the following items:

SMTP server address -
SMTP user name -
SMTP port -
SMTP password -

You can check the official letter page to resolve email related issues. Hence, make sure the SMPT details are correct otherwise you will not be able to use Discourse later.

6. Access to the web interface

Now, open your browser which can access the domain name that you have registered in Discourse. Next in the URL, point the browser to your speech domain.

for example: here we use –

7. Register an administrator account

Click on Register Button to create an account to start using the letter

Steps to Install Discourse on Ubuntu 20.04
Speech account registration
Email confirmation of the letter

8. How to promote speech

In the future, if you want to upgrade the installation, follow the given commands:

cd /var/discourse
sudo git pull
sudo ./launcher rebuild app

9. How to uninstall Discourse

If something is wrong and you just want to completely uninstall your current Discourse installation with containers, here are the commands to follow:

cd /var/discourse
sudo ./launcher stop app
sudo ./launcher destroy app
sudo rm -r /var/discourse

Other articles:

⇒ How to install Flarum Forum on Ubuntu 22.04 | 20.04 ⇒ How to Install Foxit PDF Reader on Ubuntu 20.04 Linux ⇒ Install Ajenti Admin Panel on Ubuntu 20.04 LTS Server ⇒ How to Install SSH Server on Ubuntu 20.04 LTS