How To Install Discourse on Ubuntu 22.04 LTS
In this tutorial, we will show you how to install Discourse on Ubuntu 22.04 LTS. For those of you who didn’t know, Discourse is an open-source discussion platform. You can use it as a mailing list, a discussion forum, and a long-form chat room. Discourse provides several social features similar to Twitter and Facebook.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Discourse open-source discussion platform on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
Prerequisites
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Discourse on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade sudo apt install wget apt-transport-https gnupg2 software-properties-common
Step 2. Installing Docker.
By default, Docker is not available on Ubuntu 22.04 base repository. Now run the following command below to add the Docker repository to the system:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
Next, import the GPG key to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
After the repository is enabled, now install the latest version of the Docker package using the below command:
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Once, the installation is complete start the docker service:
sudo systemctl start docker sudo systemctl enable docker
You can verify that Docker is installed and about the current version:
docker -v
Step 3. Installing Discourse on Ubuntu 22.04.
By default, Discourse is not available on Ubuntu 22.04 base repository. Now run the following command below to download the latest version of Discourse from the Git repo to your Ubuntu system:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
Then, navigate to the downloaded directory and configure the Discourse:
cd /var/discourse ./discourse-setup
Output:
Hostname for your Discourse? [discourse.example.com]: discourse.your-domain.co Checking your domain name . . . Connection to discourse.example.com succeeded. Email address for admin account(s)? [me@example.com,you@example.com]: gdt@idroot.us SMTP server address? [smtp.example.com]: smtpl.localhost SMTP port? [587]: 25 SMTP user name? [user@example.com]: root@localhost SMTP password? [pa$$word]: your-strong-password notification email address? [noreply@discourse.example.com]: Optional email address for Let's Encrypt warnings? (ENTER to skip) [me@example.com]: gdt@idroot.us Optional Maxmind License key (ENTER to continue without MAXMIND GeoLite2 geolocation database) [1234567890123456]: Does this look right? Hostname : discourse.your-domain.com Email : gdt@idroot.us SMTP address : smtpl.localhost SMTP port : 25 SMTP username : root@localhost SMTP password : meymey1234 Notification email: noreply@discourse.your-domain.com Let's Encrypt : gdt@idroot.us Maxmind license: (unset) ENTER to continue, 'n' to try again, Ctrl+C to exit:
Once the Discourse is done, verify the Discourse Docker container using the following command:
docker ps
Step 4. Accessing Discourse Web Interface.
Once successfully installed, open your web browser and access the Discourse using the URL http://discourse.your-domain.com
. You will be redirected to the Discourse registration page:
Congratulations! You have successfully installed Discourse. Thanks for using this tutorial for installing the Discourse open-source discussion platform on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official Discourse website.