Install Plugins in Discourse

(Arpit Jalan) #1

So you want to install a plugin on your Discourse instance? Great, let’s get started!

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

  • Get the plugin’s GitHub or Bitbucket 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:

        - exec:
            cd: $home/plugins
              - git clone
              - git clone

    (Add the plugin’s git clone url just below git clone

  • 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!

Installing plugins hosted in a private repo

Use an OAuth token to install your plugin

This way you can install your plugin in the same space as any other and you don’t need to create an ssh key.

    - exec:
        cd: $home/plugins
              - git clone https://<token>

Persona Login Plugin
Discourse Slackdoor Plugin
Discourse Version 1.2
Site maintenance mode during rebuilds?
Embed Etherpad Lite pads into Discourse
Data Explorer Plugin
How to create a new plugins?
Easy to use static pages plugin
Chatroom Integration Plugin (discourse-chat-integration)
How do I stop human spammers?
Increase Avatar Size to 120x120 pixels
Can Plugins Be Added To Basic Docker Install
About the Plugin category
Solved Button Plugin
Checklist Plugin - Interactive Checkboxes made Simple
Quick Messages Plugin
Wild Apricot login plugin
Discourse Zendesk Plugin
Daemonite Material Theme
Retort - a reaction-style plugin for Discourse
Formatting toolbar
Update private plugin without rebuilding the application
Discourse Mark Plugin
LDAP Setup for Discourse
Babble - A Chat Plugin
Discourse Push Notifications for Desktop
Has anyone built something for informal status updates - Chat?
ReplyGif: Adding reaction GIF easily
Discourse Translator
Bump Reset plugin - Annotated to help new devs
Unable to install plugins
Watching Categories based on on group in discourse
Admin Statistics Report
Custom Wizard Plugin
Advanced Discourse Intercom login (vkontakte)
Collude - a collaborative text editor for Discourse
Features of the open source
Graphviz Plugin
Can't able to install plugins, whats the problem?
Azure Blob Storage Plugin
./launcher rebuild app error './launcher: No such file or directory'
Plugin for Preventing Malicious Linking
Why do I need a block storage?
Google Perspective API Plugin
How can I add new badges?
[Solved] Admin-upgrade page not showing up
Can I access Discourse forum Database to use for PowerBI reporting?
Synchronizer-base for any backup provider
Discourse Akismet Anti-Spam
Auto Bookmarks plugin
Discourse GitHub
Discourse Affiliate Plugin
Beginner’s Guide to Creating Discourse Plugins Part 6: Acceptance Tests
Discourse Encrypt - RFC
Babble - A Chat Plugin [ARCHIVE]
Fixing problems with rebuild app
Install plugins for hosted solution
Discourse Code Review login (vkontakte)
Tickets Plugin :tickets:
Links Category for Discourse
Force specific users through moderation
Merge Users Plugin
Importing from phpBB3
Importing from phpBB3
Content Lock BBCode
How do you spoiler an image or onebox?
How to hook up JWT Single Sign On to Discourse
Knowledge Base Plugin
Favorites - select your favorite categories
OpenID Connect Authentication Plugin
Discourse Policy
User feedback plugin
Who's Online Plugin (discourse-whos-online)
Should all plugins be cloned as the `discourse` user?
Discourse Patreon Integration
OAuth2 integration with Drupal
Discourse Narrative Bot Beta Feedback
Sidebar with categories
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
Generating lots of Invite Tokens
How do i install plugins after doing a fork?
How to ad banners?
Algolia plugin indexation
Telegram Notifications Plugin (discourse-telegram-notifications)
Discourse Backups to Dropbox (Deprecated)
Configuring OneLogin's SAML for Discourse
Migrate from Digital Ocean to OVH?
Trying to install plugin (But not working)
How to break 99k char limit?
Beginner's Guide to Creating Discourse Plugins - Part 1
Does this software allow admin to put Adsense ads in?
SSO for College Account
How to clone private repo in container via app.yml?
Adding location at sign up
Should all plugins be cloned as the `discourse` user?
How to enable [code] feature in the forum?
Checklist Plugin - Interactive Checkboxes made Simple
Voice recording plugin
Mingle - An Introductions Plugin
Pwned Passwords Validator
Unable to find /plugins dir
Any options for over-riding the username restrictions?
How to edit plugins code?
Category Page Plugin
(Lê Trần Đạt) #6

Is there a way to rebuild app without letting the forum down like the Discourse Upgrading feature does? The down time for rebuilding Discourse is quite long.


(Sam Saffron) #7

not yet, we are probably going to solve this some time in 2015



Can be found here:

  1. Access your server (use Putty on Windows)
  2. Type cd /var/discourse
  3. Type nano containers/app.yml

It is good to teach a step by step. Not everyone is familiar to the Discourse way :blush:


How to convince my university to use/install Discourse?
How do I manually update Discourse and Docker image to latest?
(Molly) #14

Step by Step Guide:

(for those like me who needed more info the first time)

4.) Arrow down until you see this:

5.) Paste “- git clone” beneath that so that all together it looks like this:

6.) control + O (to save app.yml), hit enter

8.) control + X (to exit app.yml), then hit enter

9.) git pull (this updates stuff)

10.) ./launcher rebuild app (restarts Discourse and includes the plugin)

^ @AdamCapriola showed me that stuff and I did exactly the way I ordered it and it worked for me.

It may seem like an obvious order to those more familiar with it, but that’s what I needed to do it successfully the first time. Now I can do it easy peasy.


Babble - A Chat Plugin [ARCHIVE]
Problem is installing plugin
Change the domain name or rename my Discourse?
(Jens Maier) #15

Please do beware that indentation in YAML – the file format used through the app.yml file – matters! Whenever you post YAML documents or snippets, please use the proper markup:

<--- paste snippet here!

Here’s your app.yml snippet with proper indentation:

    - exec:
        cd: $home/plugins
          - mkdir -p plugins
          - git clone
          - git clone

If you use <blockquote> blocks or, as you did above, [quote] blocks, whitespace at the beginning of the line will not be preserved and the YAML document’s meaning will change, resulting in errors.

Also… learn Vim. :wink:


(Athithan) #32

How to install a private git repository plugin?


(Arpit Jalan) #33

To add a private git repository plugin, you need to follow these steps:

  - exec: echo "Beginning of custom commands"
  - exec: cd /var/www/discourse && sudo -u discourse bundle install --deployment --without test --without development
  - exec: echo "Host\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config
  - file:
      path: /user/.ssh/id_rsa
      chmod: 600
      contents: |
        -----BEGIN RSA PRIVATE KEY-----
           .... etc ....
        -----END RSA PRIVATE KEY-----
  - file:
      path: /user/.ssh/
      chmod: 600
      contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tj .... etc .... user@discourse
  - exec: cd $home/plugins && git clone
  - 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/

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


Discourse: Install plugin from Gitlab private repository
Specifying the gem dependecies for plugin - gem does not exist
(Sandip Pingle) #34

after following this steps to install this plugin


cd /var/discourse
./launcher rebuild app

There was no errors, but my site stopped working completely.
Tried ./launcher restart app, docker restart also rebooting serve, but still error persist.

Also tried removing plugin url from app.yml and again rebuilding app.

Thanks in advance.


(Jeff Atwood) #35

Your YAML is probably invalid. Copy and paste it into an online YAML validator. I just set up the tagging plugin for several DO droplets and it worked fine.


(Sandip Pingle) #36

@codinghorror, thanks for reaching out.
my app.yml is valid, I’ve tested it using

Any other pointers to solve issues.


(Sam Saffron) #37

yaml can be well structured yet invalid in some cases.

start from the samples, one change at a time and rebuild.


(David Detlefsen) #38

How do you install a plugin with a hosted instance?

1 Like

(Kane York) #39

With hosting, plugins are only available in the Enterprise offering, and you email with info on the plugin (the URL).

1 Like

(eriko) #40

Issue cloning plugin from an internal server.

Cloning into 'xxxx_xxx_xxx'...
fatal: unable to access 'https://git.XXXX.XXX/academic-technologies/xxxx_xxx_xxx.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

I have an internally accessible gitlab server with a valid ‘DigiCert SHA2 Secure Server CA’ intermediary cert. basically Chrome is happy with it and we use certs from the same source for our external services. Because of the datasources and to things that get set it is really not for public consumption so I can not put it on get hub

So is there a cache of server certificates that discourse_docker is allowed to install plugins from?.


(Kane York) #41

Try installing updates on the host: sudo apt-get update && sudo apt-get upgrade. That should update the certificate files.


(eriko) #42

Ok I can see why that would work. I had assumed that since connecting from the OS hosting the docker containers worked that it would from inside the container.

So I am running into this while running ./launcher rebuild so do I need to update the docker image that is being used to setup the container. I could put that apt-get commands in to the container file before the plugin is installed but seems kludgy.


(Curiositry) #43

FYI: In addition to what @elberet said, the launcher will not let you rebuild if you use tabs! You have to use spaces to indent your YAML. Picky picky… :stuck_out_tongue:


(Jeff Atwood) #44

What kind of animal would use tabs instead of spaces


(Curiositry) #45

@codinghorror Haha. I suppose self-taught varmints like @curiositry use tabs when they’re in the heat of battle with a Goliath rails app :smile:. (I’m used to using Atom or Sublime, which convert tabs to 2 spaces…)

Thanks for building Discourse by the way, and making it open-source. It’s a sweet piece of software.