In this tutorial, we will show you how to install Discourse on Ubuntu 20.04 LTS. For those of you who didn’t know, Discourse is an open-source platform used for discussions forum, chat rooms, or as mailing list management software. It is a modern forum solution that powers discussions on thousands of sites to drive user engagement. A discourse was written in Ruby on Rails as a backend language, Ember.js as a frontend, and uses PostgreSQL for data storage.
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 Discourse on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.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 20.04 LTS Focal Fossa
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 net-tools
Step 2. Installing Docker.
Now we install the latest version of Docker to your system using the following command below:
sudo apt install docker.io
Once the Docker is installed, start the Docker service and enable it to start at reboot with the following command:
sudo systemctl start docker sudo systemctl enable docker
Step 3. Installing Discourse on Ubuntu 20.04.
By default, Discourse is not available Ubuntu 20.04 base repository. Now run the following command below to download the latest version of Discourse from the GitHub repository:
sudo mkdir /var/www/discourse/ git clone https://github.com/discourse/discourse_docker.git /opt/discourse
Next, change the directory to /opt/discourse
and run the Discourse setup script:
cd /opt/discourse ./discourse-setup
The Discourse installation script will ask the following questions:
Ports 80 and 443 are free for use 'samples/standalone.yml' -> 'containers/app.yml' Found 16GB of memory and 4 physical CPU cores setting db_shared_buffers = 1024MB setting UNICORN_WORKERS = 6 containers/app.yml memory parameters updated. Hostname for your Discourse? [discourse.your-domain.com]: discourse.idroot.us
Next, you will be asked to provide an email address for the admin account, SMTP server, SMTP username, SMTP password, and email address for Let’s Encrypt as shown below:
Checking your domain name . . . Connection to discourse.idroot.us succeeded. Email address for admin account(s)? [me@example.com,you@example.com]: admin@idroot.us SMTP server address? [smtp.example.com]: smtp.gmail.com SMTP port? [587]: SMTP user name? [user@example.com]: admin@idroot.us SMTP password? [pa$$word]: m3ilan4m4ri4 Optional email address for Let's Encrypt warnings? (ENTER to skip) [me@example.com]: admin@idroot.us
Once you enter these values, there will be another window to check them again:
Does this look right? Hostname : discourse.idroot.us Email : admin@idroot.us SMTP address : smtp.gmail.com SMTP port : 587 SMTP username : admin@idroot.us SMTP password : asdfgsd Let's Encrypt : admin@idroot.us ENTER to continue, 'n' to try again, Ctrl+C to exit:
Step 4. Accessing Discourse Web Interface.
Once successfully installed, open your web browser and access the Discourse using the URL http://discourse.idroot.us
. You will be redirected to the Discourse registration page:
Congratulations! You have successfully installed Discourse. Thanks for using this tutorial for installing Discourse on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you to check the official Discourse website.