How to Install Discourse with Docker on Ubuntu 22.04

Ubuntu

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 chat room. Discourse offers some of the same social features as Twitter and Facebook. Build, engage and grow your business community in a trendy modern way. It is designed to build a community discussion platform for your team, customers, fans, supporters or friends.

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

Prerequisites

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

Install Docker CE

Before you get started, you need to have the latest version of Docker CE installed on your server. First, install all required dependencies with 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

Once installed, verify the Docker installation with the following command:

docker --version

You will get the following results:

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 repository:

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

Next, navigate to the downloaded folder and configure 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]]: root@localhost
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     : root@localhost
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 Discourse has been installed, verify the Discourse Docker container with the following command:

docker ps

You will get the following results:

CONTAINER ID   IMAGE                 COMMAND        CREATED          STATUS          PORTS                                                                      NAMES
bb5d5d7b3619   local_discourse/app   "/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

Visit the Discourse Forum

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

 

Click Register button. You will see the Sign Up screen:

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

You will receive an activation email to activate your account.

Inference

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

Hope this helps!

Source link

Share: