How to install plugins in Discourse

How to install plugins in Discourse - 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

How to install plugins in Discourse - 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

How to install plugins in Discourse - Copy the plugins Github URL 01

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.

How to install plugins in Discourse - Copy the plugins Github URL 02

On the GitHub page, click the green [Code] button at the top right to copy the HTTPS URL for cloning.


Installing plugins

How to install plugins in Discourse - Installing plugins

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”.

cd /var/discourse

Edit the “app.yml” file using the text editor called “nano”.

nano containers/app.yml

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
How to install plugins in Discourse - Edit the appyml file in the container 01

Once editing is complete, press [Ctrl + X] to apply the changes and exit the editor.

Rebuilding containers

To rebuild the container, enter the following commands in the terminal or command prompt window:

cd /var/discourse
./launcher rebuild app

Wait for about 3 minutes until the rebuilding process is complete.


Verify that the plugin is installed

How to install plugins in Discourse - 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.

How to install plugins in Discourse - Verify that the plugin is installed 02

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.

cd /var/discourse
nano containers/app.yml

Once the editor is open, remove the GitHub Clone link of the plugin you want to delete.

How to install plugins in Discourse - Delete plugins from Discourse

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.

How to install plugins in Discourse - Delete plugins from Discourse 02

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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top