How to Install Discourse on Ubuntu 22.04

how to install discourse on ubuntu 22.04

In this tutorial, we are going to show you how to install Discourse on Ubuntu 22.04 OS.

Discourse is open-source forum software written in Ruby as the backend and Javascript as frontend languages, respectively. Discourse offers a variety of features, such as threading, tagging, categorization, and many customizable plugins.

The data is stored in the PostgreSQL database, and the client uses Ember JS. The software is available in more than 20 international languages. This tutorial will install the Discourse forum software in the Docker CE engine.

Instaling Discourse is a straightforward process and may take up to 20 minutes. Let’s get things done!


  • A server with Ubuntu 22.04 as OS
  • Valid domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Update the packages to their latest versions available after a fresh install of Ubuntu 22.04

sudo apt-get update -y && sudo apt-get upgrade -y

Step 2. Install Docker

First, we will add the GPG keys and Docker repository since it is not added by default in the Ubuntu 22.04 official repository.

curl -fsSL | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] focal stable"

Once the keys and repo are added, install Docker with the following command:

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

After successful installation, start and enable the Docker service.

sudo systemctl start docker && sudo systemctl enable docker

To check the status of the Docker service, execute the following command:

sudo systemctl status docker

You should receive the following output:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

root@host:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-03-02 16:28:53 CST; 21s ago
TriggeredBy: ● docker.socket
   Main PID: 96031 (dockerd)
      Tasks: 9
     Memory: 24.8M
        CPU: 525ms
     CGroup: /system.slice/docker.service
             └─96031 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Step 3. Install Discourse

First, we need to download the Discourse repo from GitHub.

sudo mkdir -p /home/discourse

cd /home/discourse/

sudo git clone .

Now, once the Discourse is downloaded, we can execute the following command for the script to start installing the software.

sudo bash ./discourse-setup

The installation will start, and you will be asked for a couple of inputs, explained in bold below:

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

Does this look right?

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

ENTER to continue, 'n' to try again, Ctrl+C to exit:
letsencrypt.ssl.template.yml enabled

Configuration file at containers/app.yml updated successfully!

The installation script will proceed with downloading the Discourse base image for Docker and building it. After successful installation will be displayed the following output: -e -e -e DISCOURSE_SMTP_PORT=587 -e -e DISCOURSE_SMTP_PASSWORD=YourStrongPasswordHere -e -e -e -h host-app -e DOCKER_HOST_IP= --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:a7:ac:92:6f:88 local_discourse/app /sbin/boot

Now, you can access the Web interface at and register an account.

discourse installed
discourse register admin account

Congratulations! You successfully installed Discourse software using the Docker image. If you find this setup difficult, feel free to contact our technical support, and they will help you with this immediately. We are available 24/7. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket.

If you liked this about installing Discourse on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below.

Leave a Comment