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 the commands to install the Discourse on Ubuntu 20.04 LTS Focal Fossa Linux to create our own self-hosted Forum.
Steps to install Discourse forum on Ubuntu 20.04 LTS Server
The steps given are common for other Ubuntu or Debian-based Linux systems including Linux Mint, MX Linux, POP OS, and more…
Requirements:
• Ubuntu 20.04 Server
• Docker
• A non-root sudo user
• Internet connection
• at least 2GB of RAM
1. Update Ubuntu 20.04 Server
To add a repository over HTTPS we need to install ca-certificates, along with some other tools we required further 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 on Ubuntu 20.04 needs Docker to get installed properly, hence, to make sure we have the latest version of it; let’s add Docker repository and GPG Key using the given commands:
Add Key:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Add Repo:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(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 the docker platform and other tools of it on your Debian 11 Linux.
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
4. Download Discourse on Ubuntu 20.04
Once the Docker is on our system, let’s create a dedicated directory for Discourse and then clone its git repository for further installation.
sudo mkdir /var/discourse
Now clone the git repo
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
5. Install and setup Discourse on Ubuntu 20.04
First switch to the directory we have created and clone the directory.
cd /var/discourse
Start Script
Now, start the script:
sudo ./discourse-setup
The setup will ask you to add the domain address which you want to use with Discourse:
For example: forum.example.com
After that to send the mail, the user has to set the SMTP server address of the mail server you want to use. It will ask for the following items:
SMTP server address -
SMTP user name -
SMTP port -
SMTP password -
You can check out the official Discourse page for solving problems related to email. Hence, make sure SMPT details are right otherwise you won’t be able to use Discourse later.
6. Access web interface
Now, open your browser that can access the domain name you have registered for Discourse. After that in the URL, point the browser to your Discourse’s Domain.
For example: Here we are using- forum.how2shout.com
https://forum.how2shout.com
7. Register Admin Account
Click on the Register Button to create an account to start using Discourse
8. How to Upgrade Discourse
In the future, if you want to upgrade your installation then follow the given commands:
cd /var/discourse
sudo git pull
sudo ./launcher rebuild app
9. How to uninstall Discourse
If something is not right and you just want to remove the existing Discourse installation completely along with containers then 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 software 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