How to Install a New Discourse Plugin

Discourse is an open source Internet forum and mailing list management software application written with Ember.js and Ruby on Rails. While it is a fantastic solution to many problems out of the box, Discourse can be further customized with plugins which add even greater functionality to an already great product. This guide was written to help people starting new online communities add those plugins to delight and empower their users.

Access your server

This guide assumes that you have access to the server where your instance of Discourse is running. You should be able to access your server via terminal on Mac or Linux, Git Bash on Windows, or if you prefer, PuTTY on Windows.

Go into the discourse directory

Type cd /var/discourse and press enter. This will open the directory where Discourse is typically installed. If Discourse is installed somewhere else on your server, you’ll need to cd into that directory.

Edit the app.yml file

Run nano containers/app.yml to open the app.yml using the nano text editor. If you prefer to use a different editor, feel free to do so.

Use the arrow keys to scroll down until you see this:

hooks:  
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git

Add the new plugin by copying this line:

- git clone https://github.com/discourse/discourse-solved.git

And adding it to the list of commands so that all together it looks like this:

hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-solved.git

Note the indentation in this file, it’s incredibly important to make sure that this file is indented using spaces and not tabs. Each indented line should only be indented by two additional spaces, otherwise this file will be invalid.

Save and exit the editor

Press control + O, the hit enter to save the file.

Press control + X, then hit enter to exit the editor.

Installing the new plugin and restarting Discourse

Be sure to run git pull to make sure you have the most up-to-date version of Discourse installed.

Finally, run ./launcher rebuild app. This will restart Discourse with the new plugin you just installed.

Discourse Plugin Server

Start the discussion on the forums.