How to install plugins in Discourse
In Discourse, plugins are additional features that can extend the functionality of the platform and allow for customization of the community.
Apart from the plugins developed directly by the Discourse official community, users can also explore plugins developed by other users. On this page, you can find instructions on how to download and install plugins on a Discourse site hosted on a cloud server.
Exploring the Discourse plugin
On the sidebar of the Discourse official website, you can find the plugins under the [plugin] menu. By clicking on the tags, you can filter and search for plugins based on their characteristics. We recommend using official plugins whenever possible.
Copy the plugin’s Github URL
To install the desired plugin, click on the [Repository Link] at the top of the plugin page to go to the plugin’s GitHub page.
On the GitHub page, click the green [Code] button at the top right to copy the HTTPS URL for cloning.
Connect to the server where Discourse is installed via console or SSH.
Edit the app.yml file in the container
Change the current directory to “/var/discourse”.
Edit the “app.yml” file using the text editor called “nano”.
Add the Repository URL of the plugin in the following format.
hooks: after_code: - exec: cd: $home/plugins cmd: - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git - sudo -E -u discourse git clone https://github.com/discourse/discourse-spoiler-alert.git
Once editing is complete, press [Ctrl + X] to apply the changes and exit the editor.
To rebuild the container, enter the following commands in the terminal or command prompt window:
./launcher rebuild app
Wait for about 3 minutes until the rebuilding process is complete.
Verify that the plugin is installed
Access the Discourse site and navigate to the [Admin] page. From there, you can go to the [Plugins] tab to see the installed plugins.
For detailed usage instructions of the installed plugins, you can refer to the respective plugin’s GitHub page.
Delete plugins from Discourse
To remove a plugin, you need to do the opposite of the installation process.
Connect to the server via console or SSH and navigate to the Discourse directory. Use the Nano editor to edit the app.yml file of the container.
Once the editor is open, remove the GitHub Clone link of the plugin you want to delete.
Press [Ctrl + X] to save the changes and exit the editor.
cd /var/discourse ./launcher rebuild app
By following the above steps and rebuilding the container, the installed plugin will be removed from Discourse.
Now, when you go to the Plugins Settings page on your Discourse site, you will see that the installed plugin has been removed.
When adding or removing plugins in Discourse, it is important to note that the server will be temporarily unavailable. Therefore, it is recommended to inform users in advance and perform these actions during a low-traffic period.