# How are plugins loaded automatically?

**URL:** https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033
**Category:** Development
**Created:** [April 15, 2017, 2:05pm UTC](https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033 "2017-04-15T14:05:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kgish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kgish/32/121131_2.png) [@kgish](https://meta.discourse.org/u/kgish)
#### Post date: [April 15, 2017, 2:05pm UTC](https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033/1 "2017-04-15T14:05:38Z")

</div>

I’d like to understand better how discourse automatically loads plugins, e.g all those placed in the `/plugins` directory.

How does a plugin can provide a mount point and its resources during initialization?

Can someone either explain this or point me to where I can find more information?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 15, 2017, 3:06pm UTC](https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033/2 "2017-04-15T15:06:44Z")

</div>

Your best starting point is the `plugin/instance.rb` file

> <https://github.com/discourse/discourse/blob/main/lib/plugin/instance.rb>

---

<div class="post-metadata">

### Author: ![kgish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kgish/32/121131_2.png) [@kgish](https://meta.discourse.org/u/kgish)
#### Post date: [April 15, 2017, 4:47pm UTC](https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033/3 "2017-04-15T16:47:22Z")

</div>

Yes that’s very useful for the plugin side, but I’m also interested in how the discourse side manages it.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2017, 5:22pm UTC](https://meta.discourse.org/t/how-are-plugins-loaded-automatically/61033/4 "2017-04-15T17:22:17Z")

</div>

Don’t be misguided by the CustomEmoji class at the top, further in the file _is_ where the Discourse side manages it.
