Ubuntu

How to Install Discourse on Ubuntu 20.04 LTS

How to Install Discourse on Ubuntu 20.04 LTS

Discourse is an open-source discussion forum and mailing list management software that allows you to collaborate in a work environment with your team. The software supports many cool features that you see on other social networking sites like quick notifications, endless scrolling, and active discussions. It also keeps a strict criterion for everyone to act civilized while communicating, unlike other apps. You will also see an emergency pane on the software’s interface to communicate in case of work urgency.

Deployment Methods:

There are two ways you can install discourse. It can either be self-hosted or forum hosted.

Self-Hosted:

You install and set up discourse on your own server.

Forum hosted:

If you don’t want to dive deep into the technicality of hosting it yourself, you can simply purchase services from the forum. They have different pricing packages to host your discourse. You can check it out on their official page.

Pre-Requisites

System Requirements:

  • A server running Ubuntu 20.04 LTS.
  • A valid domain name mapped to your server.
  • An SMTP mail server.
  • Docker installed on your system

Hardware Requirements:

  • Single core CPU, dual core recommended
  • Minimum 1 GB RAM (with swap)
  • Minimum10 GB disk space

Installation guide:

Step 1: SSH into remote server

Connect to your server via its IP address using SSH protocol

Step 2: Discourse Docker Image

Clone the Official Discourse Docker Image into /var/discourse directory

Step 3: Discourse set up

Go to /var/discourse and launch the setup tool with the command below.

The setup will begin shortly and will take about 5 to 10 minutes to complete.

Step 4: Discourse Configuration Settings

Edit the discourse config file app.yml to change the default configuration settings.

Go to the /var/discourse/containers directory and edit app.yml file with nano command.

Locate the port mapping lines. This is how it will appear in the file:

Here, we are mapping http port 80 of discourse container to our machine’s port 80.

Similarly, we will expose https port 443 of the container to the https port 443 of our machine.

In the file, scroll down further and locate the lines shown in the image below.

Enter your discourse hostname and rest of the data asked. Make sure to provide the right information.

Step 5: Rebuild discourse app

To update the configuration file, use the command below. It will rebuild the discourse app, this time with the new settings we provided in the previous step.

Step 6: Make a host entry

Before running the app on your browser, do one last step. Go to /etc directory and edit the hosts file. Make a new entry of your discourse name against the machine’s IP address as shown below.

Step 7: Verify discourse installation

Now go to your browser and run the domain name you provided in the configuration file like this:

https://example.com

The browser will direct you to the discourse set up page. If you see it, congratulations, you installed Discourse!

This page will confirm that you have successfully installed the software on your server.

How to uninstall Discourse

Now that we have seen how to install discourse on a ubuntu server, let’s also have a look at how to uninstall it.

To uninstall discourse, you will have to completely wipe out the docker container in which discourse is installed.

Step 1: Stop docker container

First step is to stop the running discourse container.

The following command will give you a list of all the containers that are up and running.

In our case, only one container is running which is a discourse container. To stop it, run the following command:

Docker stop CONTAINER ID

Copy the container ID and place it in the command and run. This will stop the container

Step 2: Delete the container

Now that the container has stopped, we can easily remove it with the help of the following command:

Docker container rm CONTAINER ID

The command will look like this:

After this, discourse from your system will be successfully uninstalled.

In this guide, we saw what are the pre-requisites required to install discourse software. Then, we looked at how to install discourse on the ubuntu server, step by step. After installation, we also got to know how to uninstall the software from our system in just two easy steps.

For more information on discourse installation, visit: https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#3-install-discourse

Similar Posts