Discourse is a free and open-source discussion platform built for the next decade of the Internet. 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. Build, engage and grow your business community in a trendy modern way. It is designed to build community discussion platforms for your team, clients, fans, supporters, or friends.

In this tutorial, we will show you how to install Discourse Forum on Ubuntu 22.04.

Prerequisites

  • A server running Ubuntu 22.04.
  • A valid domain name is pointed to your server IP.
  • A root password is configured on the server.

Install Docker CE

Before starting, you will need to install the latest version of Docker CE on your server. First, install all the required dependencies using the following command:

apt-get install apt-transport-https ca-certificates git curl gnupg -y

Next, download the Docker GPG key and save it in the /etc/apt/keyrings directory.

mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Next, add the Docker CE repository with the following command:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Next, update the repository cache with the following command:

apt update -y

Once your repository is updated, you can install the latest version of Docker CE with the following command:

apt-get install docker-ce docker-ce-cli containerd.io -y

After the installation, verify the Docker installation using the following command:

docker --version

You will get the following output:

Docker version 20.10.18, build b40c2f6

Install Discourse Forum on Ubuntu 22.04

First, create a directory for Discourse with the following command:

mkdir /var/discourse

Next, download the latest version of Discourse from the Git repo:

git clone https://github.com/discourse/discourse_docker.git /var/discourse

Next, navigate to the downloaded directory and configure the Discourse with the following command:

cd /var/discourse

./discourse-setup

Answer all the questions as shown below to complete the installation:

Hostname for your Discourse? [discourse.example.com]: discourse.example.com

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

Does this look right?

Hostname          : discourse.example.com
Email             : [email protected]
SMTP address      : smtpl.localhost
SMTP port         : 25
SMTP username     : [email protected]
SMTP password     : jethva1981
Notification email: [email protected]
Let's Encrypt : [email protected]
Maxmind license: (unset)

ENTER to continue, 'n' to try again, Ctrl C to exit: 

Once the Discourse has been installed, verify the Discourse Docker container using the following command:

docker ps

You should get the following output:

CONTAINER ID   IMAGE                 COMMAND        CREATED          STATUS          PORTS                                                                      NAMES
bb5d5d7b3619   local_discourse/app   "https://www.howtoforge.com/sbin/boot"   44 seconds ago   Up 42 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   app

Access Discourse Forum

Now, open your web browser and access the Discourse web interface using the URL http://discourse.example.com. You should see the following screen:

<img alt="Discourse Forum" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/10/echo/p1.png6349231e94083.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="366" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Register button. You should see the Registration screen:

<img alt="Create admin account" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/10/echo/p2.png6349231f63f27.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="366" loading="lazy" src="data:image/svg xml,” width=”750″>

Provide your admin username, password, email, and click on the Register button. You should see the following screen:

<img alt="Confirm email" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/10/echo/p3.png634923203db49.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="367" loading="lazy" src="data:image/svg xml,” width=”750″>

You will receive an activation email to activate your account.

Conclusion

Congratulations! you have successfully installed Discourse Forum on Ubuntu 22.04 server. You can now implement Discourse in your organization and start communicating with your team over the internet.

<img alt="Hitesh Jethva" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/10/echo/hitesh-80.jpg63492320a6086.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="76" src="data:image/svg xml,” width=”80″>

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.