Welcome to this tutorial on how to install Discourse, a free and open-source discussion platform, on an Ubuntu 22.04 server using Docker. Discourse is a versatile tool that allows you to create mailing lists, discussion forums, and chat rooms, providing social features similar to Twitter and Facebook. With Discourse, you can build, engage, and grow your business community in a trendy and modern way. Whether you want to create a platform for your team, clients, fans, supporters, or friends, Discourse has got you covered.
In this guide, we will walk you through the step-by-step process of installing Discourse on your Ubuntu 22.04 server. Before we begin, make sure you have the following prerequisites in place:
Prerequisites
- A server running Ubuntu 22.04.
- A valid domain name pointed to your server’s IP.
- A root password configured on the server.
Step 1: Installing Docker CE
Before we can proceed with the installation of Discourse, we need to install Docker CE (Community Edition) on our server. Docker is an open-source platform that allows you to automate the deployment, scaling, and management of applications using containerization.
To install Docker CE, follow these steps:
- Update the package repository cache by running the following command:
apt update -y
- Install the required dependencies by running the following command:
apt-get install apt-transport-https ca-certificates git curl gnupg -y
- 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
- Add the Docker CE repository by running 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
- Update the repository cache again to include the Docker CE repository:
apt update -y
- Finally, install Docker CE by running the following command:
apt-get install docker-ce docker-ce-cli containerd.io -y
Once the installation is complete, verify that Docker is installed correctly by running the following command:
docker --version
You should see an output similar to the following:
Docker version 20.10.18, build b40c2f6
Now that Docker CE is installed, we can proceed with the installation of Discourse.
Step 2: Installing Discourse Forum
To install Discourse, we need to create a directory for it and then clone the latest version from the Git repository.
Follow these steps to install Discourse:
- Create a directory for Discourse by running the following command:
mkdir /var/discourse
- Clone the latest version of Discourse from the Git repository into the
/var/discourse
directory:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
- Navigate to the downloaded directory:
cd /var/discourse
- Run the
discourse-setup
script to configure Discourse:
./discourse-setup
During the setup process, you will be asked a series of questions. Provide the following information:
- Hostname for your Discourse?: Enter the domain name you have pointed to your server’s IP address, e.g.,
discourse.example.com
. - Email address for admin account(s)?: Enter the email address you want to use for the admin account.
- SMTP server address?: Enter the address of your SMTP server, e.g.,
smtpl.localhost
. - SMTP port?: Enter the port number for your SMTP server, e.g.,
25
. - SMTP user name?: Enter the username for your SMTP server, e.g.,
root@localhost
. - SMTP password?: Enter the password for your SMTP server.
- Optional email address for Let’s Encrypt warnings?: Enter an email address where you want to receive Let’s Encrypt warnings, or press Enter to skip.
- Optional Maxmind License key: Press Enter to continue without the Maxmind GeoLite2 geolocation database.
Review the information you provided, and if everything looks correct, press Enter to continue with the installation. Once the installation is complete, you should see the Docker container for Discourse running when you run the following command:
docker ps
The output should display the container information, indicating that Discourse is up and running.
Step 3: Accessing Discourse Forum
Now that Discourse is installed, you can access the Discourse web interface using your web browser.
Follow these steps to access Discourse:
- Open your web browser and enter the URL
http://discourse.example.com
, replacingdiscourse.example.com
with your domain name. - You should see the Discourse welcome screen. Click on the “Register” button to create an account.
- Fill in the required details, such as your admin username, password, and email address, and then click on the “Register” button.
- Check your email for an activation link to activate your account.
Congratulations! You have successfully installed Discourse Forum on your Ubuntu 22.04 server. You can now start using Discourse to communicate and collaborate with your team or community.
Conclusion
In this tutorial, we walked you through the process of installing Discourse on an Ubuntu 22.04 server using Docker. Discourse is a powerful discussion platform that allows you to build thriving communities and engage with your audience in a modern and trendy way. By following the steps outlined in this guide, you have successfully set up Discourse and can now start enjoying its features.
If you’re looking for reliable and efficient cloud hosting solutions, consider checking out Shape.host. They offer Linux SSD VPS services that provide scalability, security, and top-notch performance for your hosting needs. Shape.host is dedicated to empowering businesses with reliable cloud hosting solutions, so give them a try for your next project.