<-- Back to The Cleavr Slice

25 April 2023

discourse

How to install a Discourse Forum

If you're looking for a versatile and feature-rich community forum software, then Discourse is a top choice. As an open-source platform, Discourse offers modern and responsive forum functionality that allows you to engage with your community or customers effectively. In this step-by-step guide, we will walk you through the process of installing Discourse for production use, so you can create a powerful and interactive community platform.

Prerequisites

Before installing Discourse, make sure you have the following prerequisites in place:

  1. A server or virtual machine running a compatible operating system, such as Ubuntu 22.04 or later, with sufficient resources (CPU, RAM, storage) to support a production-grade forum.
  2. A domain name registered and configured to point to the IP address of your server. This is necessary for accessing your Discourse forum over the internet.
  3. Ports 80 and 443 open on your server's firewall. Port 80 is used for HTTP traffic, while port 443 is used for HTTPS traffic. These ports need to be open to allow incoming web traffic to your Discourse instance. Don't install and run Apache or NGINX on the server as this will complicate setup.
  4. An email server set up and configured to send emails for Discourse to function properly. Discourse relies on email notifications for user registration, password reset, and other important functionalities. So, having a functional email server is a prerequisite for installing Discourse.

Now, let's get started with the installation process.

Step 1: Setup your email SMTP server

To enable notifications, password resets, and system alerts on Discourse, configuring an email SMTP server is necessary. It is recommended to use established email service providers like SendGrid, Mailgun, or Amazon SES. Detailed setup instructions are available from the service providers or seek help from a professional

Once you have obtained the API keys or SMTP credentials from your email service provider, you can proceed with the Discourse installation process and input the necessary information when prompted. This will allow your Discourse forum to send emails and provide a smooth experience for your forum users.

email setup

Please note that using personal SMTP servers, such as those provided by Gmail, is not recommended for Discourse installations. It is against Gmail's terms of service to use their SMTP servers for mass mailing, which includes sending automated emails from a forum.

Step 2: Provision Your Server

The recommended server specs for running Discourse may vary depending on the size of your community and the expected usage patterns. However, as a general guideline, the Discourse team recommends the following minimum server specifications for a production Discourse installation:

  • CPU: Dual-core or higher, clocked at 2.0 GHz or higher
  • RAM: 2 GB or higher
  • Storage: 10 GB or higher of free disk space
  • Operating System: Ubuntu 22.04 LTS or later, or another officially supported Linux distribution
  • Database: PostgreSQL 13 or later
  • Web Server: Nginx

In my case, I have provisioned a plain server in Cleavr. It is important to select the Plain Server option with Cleavr so that NGINX is not installed as that would complicate the installation process.

Step 3: Install Discourse

Login to your server using SSH. You'll want to install using a terminal view as there will be additional questions during the setup process.

Have the following information handy before going through the installation setup.

  1. Domain for forum (make sure the DNS is pointing to the server's IP)
  2. Email address to use for admin account
  3. SMTP server address
  4. SMTP port
  5. SMTP user name
  6. SMTP password
  7. Notification email address

Now, start the discourse installation by running the following commands in the SSH terminal:

sudo mkdir /var/discourse
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
sudo ./discourse-setup

Step 4: Access Discourse

Once the installation is complete, you can access your Discourse forum by navigating to your domain name in your web browser. Discourse provides a web-based setup wizard to further configure your forum, including setting up categories, creating an admin account, and customizing your forum's appearance.

Upon successfully setting up your Discourse domain, you will be greeted with a congratulatory message to acknowledge the successful installation.

installation Once you have completed the registration process and confirmed your admin email, you will receive a notification that your forum is now ready for use.

forum

Step 5: Secure Your Discourse Instance

After installation, it's important to secure your Discourse instance to protect against potential security risks. Some recommended security measures include:

  • Enable HTTPS using a valid SSL certificate.
  • Regularly update Discourse and its plugins to the latest versions.
  • Configure strong and unique passwords for all user accounts.
  • Set up firewall rules to allow only necessary incoming and outgoing traffic.
  • Disable unnecessary services and features in Discourse that you don't use.

In conclusion, installing Discourse for production use involves setting up a Docker container(handled automatically during discourse setup), configuring email, and securing your instance. By following the steps outlined in this guide, you can have a powerful and customizable community forum up and running in no time. Happy forum-ing!

Take control of your servers and deployments.Without breaking a sweat.

Sign up for a 5-day free trial of Cleavr Pro. No credit card required until you decide to subscribe.

Sign up for free