Install Plugins in Discourse

:warning: This guide assumes that you have a self-hosted standard installation. We only support the standard method of install here, so these instructions assume you have a standard install.

:warning: This guide only applies to self-hosted Discourse instances. If you are using a managed hosting service, the available plugins are controlled by your hosting provider. For example, on our hosting these specific plugins are available by hosting tier.

In this tutorial, we’ll install the Discourse Spoiler Alert plugin.

This tutorial requires an understanding of how to use GitHub repos, specifically, how to get or copy the git clone URL and how to edit YAML (*.yml) files via the terminal using nano, specifically how to save and exit on nano. YAML files strongly follow indentations, so be sure to respect these as you copy and paste and edit the necessary *.yml for your Discourse instance.

  • Copy the plugin’s GitHub git clone url.

  • Access your container’s app.yml file (present in /var/discourse/containers/)

    cd /var/discourse
    nano containers/app.yml
    
  • Add the plugin’s repository URL to your container’s app.yml file:

    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
    

    Add the plugin’s git clone url just below the line containing git clone https://github.com/discourse/docker_manager.git)

    Follow the existing format of the docker_manager.git line; if it does not contain sudo -E -u discourse then insert - git clone https://github.com/discourse/discourse-spoiler-alert.git.

  • Rebuild the container:

    cd /var/discourse
    ./launcher rebuild app
    

    That’s it, you’ve successfully installed the Discourse Spoiler Alert plugin on your Discourse instance!


If your plugin is hosted in a private repository

You must use an OAuth token:

With the OAuth token, you can install your plugin in the same way as a public repo, and you don’t need to create a SSH key.

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
              - sudo -E -u discourse git clone https://<token>@github.com/owner/repo.git

We strongly advise you to use OAuth tokens for plugins in private repositories. However, if you cannot, see below.

SSH Key Private Install Steps
run:
  - exec: echo "Beginning of custom commands"
  
  - exec: cd /var/www/discourse && sudo -u discourse bundle install --deployment --without test --without development
  - exec: echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config
  - file:
      path: /user/.ssh/id_rsa
      chmod: 600
      contents: |
        -----BEGIN RSA PRIVATE KEY-----
        MIIEogIBAAKCAQEArCQG213utzqE5YVjTVF5exGRCkE9OuM7LCp/FOuPdoHrFUXk
           .... etc ....
        -----END RSA PRIVATE KEY-----
  - file:
      path: /user/.ssh/id_rsa.pub
      chmod: 600
      contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tj .... etc .... user@discourse
  - exec: cd $home/plugins && git clone git@github.com:SecretOrg/secret-plugin.git
  - exec: cd $home && sudo -E -u discourse bundle exec rake db:migrate
  - exec: cd $home && rm -fr tmp/cache
  - exec: cd $home &&  sudo -E -u discourse bundle exec rake assets:precompile
  - exec: rm /user/.ssh/id_rsa
  - exec: rm /user/.ssh/id_rsa.pub

  - exec: echo "End of custom commands"
  • Rebuild the container:
cd /var/discourse
./launcher rebuild app

Your private plugin should be installed on your Discourse instance.

How to uninstall a plugin

To remove a plugin, simply remove the - git clone https://github.com/... line from your app.yml file and rebuild your site via

cd /var/discourse
./launcher rebuild app
147 Likes
Discourse Slackdoor Plugin
Site maintenance mode during rebuilds?
How to create a new plugins?
Discourse Version 1.2
Embed Etherpad Lite pads into Discourse
Solved Button Plugin
LDAP Setup for Discourse
Formatting toolbar
Wild Apricot login plugin
About the Plugin category
Can Plugins Be Added To Basic Docker Install
Discourse Checklist
Quick Messages Plugin
News Plugin :newspaper:
Discourse Mark Plugin
Discourse Akismet (Anti-Spam)
Tickets Plugin :tickets:
"Onebox Assistant", crawl for those previews reliably!
Does this software allow admin to put Adsense ads in?
Daemonite Material Theme
Retort - a reaction-style plugin for Discourse
Watching Categories based on on group in discourse
How to ad banners?
Admin Statistics Report
Discourse Push Notifications for Desktop
Projects management plugin
Application Files after Digital Ocean Setup
Bump Reset plugin - Annotated to help new devs
User feedback plugin
Topic Ratings Plugin
ReplyGif: Adding reaction GIF easily
Babble - A Chat Plugin
Update private plugin without rebuilding the application
How do i install plugins after doing a fork?
Discourse Fingerprint - Browser Fingerprinting Plugin
Sidebar with categories
Merge Users Plugin
Events Plugin :calendar:
Unable to find /plugins dir
Pwned Passwords Validator
Launcher rebuild app does nothing
Private repo on Github
Mingle - An Introductions Plugin
Category Page Plugin
Discourse Dice Roller (RogerBW)
Stop Forum Spam Plugin (auto silence known spammers)
Any options for over-riding the username restrictions?
Collude - a collaborative text editor for Discourse
Can I access Discourse forum Database to use for PowerBI reporting?
Discourse Code Review
Discourse GitHub
Discourse Policy
Custom Trust Level
Discourse Category Home :house:
Generating lots of Invite Tokens
Fatal: Not a git repository (or any parent up to mount point /discourse)
Set up a Discourse instance, install plugins and a new theme
Fatal: Not a git repository (or any parent up to mount point /discourse)
I need someone who can install a voting plugin
Custom Wizard Plugin :mage:
Introducing Font Awesome 5 and SVG icons
Topic List Previews (legacy)
Option in category setting not found
Discourse Spoiler Alert
Discourse Cookie Consent Banner
:spiral_calendar: Discourse Event
Community Network Visualisation
Discourse-a2a-bbcode
Error using discourse-oauth2-basic plugin with NeonCRM
Discourse Assign
Question Answer Plugin
Discourse Math Editor - user friendly equations!
Discourse Subscriptions
How might we better structure #howto?
How might we better structure #howto?
Cannot install new plugins: structure needs cleaning
Slow Discourse Rebuild on a VM with slow disks
Set up a Discourse instance, install plugins and a new theme
Discourse Notifier
Discourse CommonMark text highlighting?
Mumble -- VOIP Plugin for Discourse
Advice on Installing Plugins
Smallcaps formatting
Cannot install plugin - nothing happens
Configure the Discourse RSS Polling Plugin
What else do I need to take care of when self hosting?
Topic Ratings Plugin
Discourse Shared Edits
Install Discourse for development using Docker
Installing discourse-math.git
Discourse Image Filter
Discourse Linkify Google Sheets
LDAP Auth Missing from Plugins
Developing Discourse Plugins - Part 1 - Create a basic plugin
Discourse Canned Replies
Discourse BBCode
Discourse Automation
Discourse Voting missing table on postgresql
Discourse Signatures
Discourse Calendar
Discourse Footnote
Discourse Sitemap
Discourse Spoiler Alert
Add a button at the bottom of a topic, visible to a specific group: discourse-topic-group-button
Add a button at the bottom of a topic, visible to everyone: discourse-custom-topic-button
Discourse BBCode Color
Discourse Post Sorting Customizer
Set up a Discourse instance, install plugins and a new theme
Unikname Connect plugin
Discourse Video Upload Plugin with YouTube and Vimeo
Discourse Docker Manager
Set up a Discourse instance, install plugins and a new theme
Quoting not working
User profile by ID instead of username
"Onebox Assistant", crawl for those previews reliably!
Error after update failed today: [rake themes:update assets:precompile]
Votes don't Merge when we combine posts
Discourse User Feedback
LDAP Setup for Discourse
I need someone who can install a voting plugin
Availability of OpenID Connect in hosted plans
Codebytes Plugin
Multiple Users posting under same User or Group name?
What makes a successful volunteer Discourse sysadmin?
Better-Anonymous (multiple anonymous accounts and other features)
Not able to install any Discourse plugins
How to install the lazy-yt plugin
Issue With Sitemap
Discourse Category Experts
Discourse Private Replies
Set up a Discourse instance, install plugins and a new theme
Set up a Discourse instance, install plugins and a new theme
Rocket.Chat SSO + embed plugin for Discourse
Set up a Discourse instance, install plugins and a new theme
Google One Tap Login/Signup
Landing Pages Blog :small_airplane:
Group Invitation Plugin
How to make a discourse forum look like forum.glamour.de
Word Cloud plugin
Geo Blocking plugin
Signed Google Cloud CDN URLs
Google Groups Link Plugin
Discourse Patreon
Discourse LinkedIn Authentication
Discourse Affiliate
Set up a Discourse instance, install plugins and a new theme
Set up a Discourse instance, install plugins and a new theme
Discourse VK Authentication (vkontakte)
Set up a Discourse instance, install plugins and a new theme
Discourse OneDrive Picker
Discourse Solved
Discourse BCC
Discourse Apple Authentication
Set up a Discourse instance, install plugins and a new theme
Set up a Discourse instance, install plugins and a new theme
Discourse Prometheus
Animated Avatar Plugin
Discourse Dictionary Plugin :ab:
Slack Bot Construction Kit :robot:
Discourse Authorship Plugin
Locked out from WinSCP and can't Install Plugins!
Verifiable Credentials Plugin
NFT avatar plugin (discourse-nft-avatar) :sailboat:
Discord-rolesync plugin
How to: discourse-sitemap is deprecated and merged into Discourse's core. Please remove it from your app.yml file.?
Introducing Discourse Chat (BETA)
Discourse Templates
How to add a Leaderboard link to the hamburger menu?
Landing Pages Blog :small_airplane:
Discourse Who's Online
Discourse Restricted Replies
Discourse Zendesk
Discourse Docs (Documentation Management)
Discourse Checklist
Discourse Reactions
Discourse Chat Integration
Discourse Yearly Review
Discourse Data Explorer
Discourse Math
Discourse OpenID Connect
Discourse Follow
Discourse Saved Searches
Discourse Cakeday! (Celebrating birthdays and anniversaries)
Discourse Graphviz
Discourse User Notes
Microsoft Authentication
Discourse Gamification
Discourse Intercom (Advanced)
Discourse Salesforce
Discourse Ad Plugin
Sign-In with Ethereum plugin
Discourse OAuth2 Basic Support
Discourse Browser History
Discourse Algolia Search
Discourse Characters Required
Discourse No Bump
Discourse Teambuild
Discourse Login with Amazon
Discourse Tooltips
Discourse Google Perspective API
Discourse Steam Login
Discourse Learning Management System Integration (LTI 1.3 Authentication)
Landing Pages Plugin :small_airplane:
Configure OneLogin's SAML for Discourse
Migrate a phpBB3 forum to Discourse
Discourse Post Voting
Mentionables
Discourse hosting on Linode?
Discourse Topic Voting
Events Integration Plugin (Beta)
Install plugins in your non-Docker development environment
Embed comments from Discourse in your single page app
Discourse FontAwesome Pro
Modal window - a modal window style plugin for Discourse
Discourse Confused About the Number of Posts in a Topic?
Animated Avatar Plugin
Discourse Mailgun Routes
[Solved] Admin-upgrade page not showing up
Synchronizer-base for any backup provider
"Your Docker installation is not using a supported storage driver."
Solution icon does not show in posts
Fixing problems with rebuild app
Auto Bookmarks plugin
Discourse VK Authentication (vkontakte)
Force specific users through moderation
Migrate a phpBB3 forum to Discourse
Zoom Webinars Plugin
Voice recording plugin
How to hook up JWT Single Sign On to Discourse
Should all plugins be cloned as the `discourse` user?
OAuth2 integration with Drupal
Discord Sync: sync a Discourse forum with a Discord server
Discourse Narrative Bot Beta Feedback
Discourse Translator
No option appears to choose better answer
How to block all crawlers but Google's
Discourse Avatar name_first_letter
Auto-suspend inactive users
Algolia plugin indexation
Telegram Notifications Plugin (discourse-telegram-notifications)
Trying to install plugin (But not working)
How to break 99k char limit?
How to edit plugins code?
I want to install a plugin for development, what should I do?
News Plugin :newspaper:
Discourse Encrypt (for Private Messages)
Azure Blob Storage Plugin
./launcher rebuild app error './launcher: No such file or directory'
Discourse Wikilinks Plugin
SSO for College Account
Installing Plugins with Git
Should all plugins be cloned as the `discourse` user?
Developing Discourse Plugins - Part 6 - Add acceptance tests
Favorites - select your favorite categories
Why do I need a block storage?
Plugin for Preventing Malicious Linking
Custom Wizard Plugin :mage: