Discourse is a popular discussion application that allows users to discuss topics. It is one of the most popular discussion applications with lots of features and a user friendly interface. To try out the features provided by Discourse, see the Discourse Demo.
Discourse has a standard, business and enterprise edition. These editions are non free. There is also an open source edition that is free to use. Discourse is a useful platform for building communities. In this article, I will describe the features provided by Discourse and also how to install Discourse on a Linux server.
Discourse has the following features:
The main feature of Discourse is a forum system. It allows users to post topics. Users can discuss the topics by posting replies. The replies can be moderated by special users. Dynamic notifications allow users to receive email alerts when someone has replied to their post or has mentioned them in a reply.
Discourse is a simple forum, in which replies flow down a single page. No need to click through pages to view replies. The context of a post can be viewed by clicking at the top and bottom of the post. The context reveals the full post conversation. Links in a post automatically expand to reveal additional information without requiring the user to click the link.
Discourse also provides open source mobile applications for IOS and Android.
Discourse can be extended with plugins that enhance the basic functionality of Discourse. There are standard plugins that are provided with all hosting plans. These include a chat plugin, plugins for preventing spam, advertising, displaying mathematical notation in posts and more. The Business and Enterprise plugins include a data explorer which allows running SQL queries against databases, a Sitemap plugin, a topic voting plugin and more.
To install a Discourse plugin, we need to edit the containers/app.yml configuration file and enter the text: “git clone [plugin-repository-url]”. Next we need to rebuild the container using the command: ./launcher rebuild app. The plugin should now show on the plugins list page. The article, Install Plugins in Discourse on the Discourse forums describes how to install plugins.
The Discourse API allows access to Discourse data. It also allows posting topics and replies, managing users and more.
Theme components enhance the functionality of themes. For example the Social Share Component, allows adding custom social share links to the post share form.
The Brand header theme component, allows adding a header to the Discourse with custom links. It can be used to brand the Discourse so it looks like the company website.
To install a theme component, we need to go to the theme component admin page and enter the Git Repository URL of the component. We can also choose from a list of popular theme components. Next we need to add the theme component to the current theme. This last step is very important and sometimes missed by users not familiar with Discourse.
Discourse provides useful integration options. It supports Social Login with Facebook, LinkedIn, Twitter, Yahoo, GitHub and more. It also provides Custom Oauth2 and SAML. These allow Discourse to be used as a single sign on provider for websites.
Discourse is based on RubyOnRails platform. It uses PostgreSQL database. The recommended method for running the open source version of Discourse is with Docker. The Discourse Installation Guide for Cloud Platforms describes how to install Discourse on Digital Ocean or on personal servers. Since the Discourse is run within a Docker container, the installation guide applies to all platforms that support Docker.
We first need to install Docker on the server. See the Docker installation guide for how to install Docker on different operating systems. Next we need to create the folder: /var/discourse and download the Discourse Docker source code to the folder. This can be done with the commands:
mkdir /var/discourse cd /var/discourse git clone https://github.com/discourse/discourse_docker.git
Next we need to run the Discourse setup tool using the command: ./discourse-setup. The setup script will ask for the Discourse hostname, email settings, and Lets Encrypt account email. I chose to skip the Lets Encrypt setup, since my installation of Discourse does not require https. The setup script will generate the containers/app.yml Docker configuration file. It will also start the boostrap. The bootstrap process builds the Discourse Docker image and downloads it to the server. It also starts a container from the downloaded image. It takes about 2-8 minutes to complete.
Once bootstrapping has completed, we should be able to access the Discourse from a browser using the host name that we mentioned during the setup. We will then be asked to register an Admin user account. Next we should be able to login to our Discourse instance using the admin user account.
If your server hosts other websites on port 80, then you will have to edit the Discourse Docker configuration, so that the Discourse instance can be accessed from a proxy web server, such as Nginx. When accessed through a proxy server, the Discourse server will be accessed over a socket instead of a port.
This configuration is described in the article Running other websites on the same machine as Discourse. For example to access Discourse through Nginx, we need to first stop the Discourse using the command: ./launcher stop app. Next we need to change the container definition given in containers/app.yml. After that we need to create a Nginx virtual host. The virtual host should forward requests to the Discourse instance over a socket.
Next we can restart the Nginx server with the command: service nginx restart. We can then start the Discourse using the command: launcher rebuild app. We will then be able to access the Discourse from a browser. Other websites running on the same server should also be working.
Discourse is an excellent platform for building online communities. It supports integrations with well known platforms and provides many features out of the box. Its installation is simple and well documented. Discourse is supported by a large open source community and is widely used.