# How to recompile plugins and NOT to recompile Discourse?

**URL:** https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503
**Category:** Support
**Created:** [August 1, 2020, 7:08am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503 "2020-08-01T07:08:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ed\_Bobkov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_bobkov/32/200014_2.png) [@Ed\_Bobkov](https://meta.discourse.org/u/Ed_Bobkov)
#### Post date: [August 1, 2020, 7:08am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503/1 "2020-08-01T07:08:38Z")

</div>

How is it possible to recompile the plugin and NOT to recompile Discourse (not to update to the latest version)? I have a problem that Discourse has very frequent updates. Very often updates make plugins not working. I would like to recompile without Discourse update. Is it possible?

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 1, 2020, 8:01am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503/2 "2020-08-01T08:01:48Z")

</div>

Dear @Ed_Bobkov

You can accomplish the “essence” of what you want in an “unsupported way” by building Discourse with (1) your own base Discourse Docker image and (2) forked Discourse github code base, if you believe you absolutely must, by running a fork of the Discoures source code.

So, in that case you will need to:

- Edit the Dockerfile and add your forked [Discourse source repository](https://github.com/discourse/discourse_docker/blob/5f7f09539cac22ee995eb394bccf7369b8646efa/image/base/Dockerfile#L138)
- Edit the launcher script and add an [alternative base Docker image](https://github.com/discourse/discourse_docker/blob/5f7f09539cac22ee995eb394bccf7369b8646efa/launcher#L91)

See this line in the Discourse Dockerfile:

```plaintext
 git clone https://github.com/discourse/discourse.git &&\

```

and this line in the launcher script:

```plaintext
image="discourse/base:2.0.20200512-1735"

```

If you run a private Docker registry, you can push the Discourse base image (of your choice) to your private registry and so, for example:

```plaintext
image="localhost:5000/base:2.0.20200512-1735"

```

and likewise, if you fork Discourse, you can use that fork in the `Dockerfile` (above), for example:

```plaintext
 git clone https://github.com/your_git_account/discourse.git &&\

```

This will help you manage both the base Docker image and the build code.

Of course, this is not recommended because you will not benefit from all the bug fixes and security (and feature) updates from Discourse; and this method is both not supported nor recommended.

Hope this helps @Ed_Bobkov

Note: In this method, you are still rebuilding Discourse; but you are controlling (1) the version of the base Docker image and (2) the Discourse github repo code; and are “on your own” because this method is not supported, nor recommended, at all (to my knowledge).

See Also:

> [@How can I customized my own site](https://meta.discourse.org/t/how-can-i-customized-my-own-site/157004/5):
>
> If you absolutely have to run a fork of the source code (which is definitely not recommended, you can accomplish almost everything with a [plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515)), then you will need to: build a new base image with a [different source repository](https://github.com/discourse/discourse_docker/blob/5f7f09539cac22ee995eb394bccf7369b8646efa/image/base/Dockerfile#L138) pass the launcher a [different --run-image parameter](https://github.com/discourse/discourse_docker/blob/5f7f09539cac22ee995eb394bccf7369b8646efa/launcher#L91)

---

<div class="post-metadata">

### Author: ![Ed\_Bobkov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_bobkov/32/200014_2.png) [@Ed\_Bobkov](https://meta.discourse.org/u/Ed_Bobkov)
#### Post date: [August 1, 2020, 9:32am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503/3 "2020-08-01T09:32:15Z")

</div>

Thank you for very detailed answer! It’s not a simple way out. Strange that there is no a command to recompile without checking Discourse update.

---

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 1, 2020, 9:44am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503/4 "2020-08-01T09:44:43Z")

</div>

Hi @Ed_Bobkov

Well, there very well may be some “other method” that I do not know about 🙂 I defer to others for that.

I worked on this for many days a while back, and this was the “best I could come up with” after a lot of different “trial and errors”.

If there is an easier way, I would love to hear about it; but it does make sense if you work with Docker a lot.

First of all, the image must be built. Discourse starts with a base image and modifies it. When you add new plugins in production (Docker), you generally need to rebuild the container. Hence, that’s why I replied as I did above.

There are a lot of people here smarter than me on the topic of Discourse system admin, so maybe someone else has a better idea along the lines of what you are looking for.

Cheers!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [August 1, 2020, 10:03am UTC](https://meta.discourse.org/t/how-to-recompile-plugins-and-not-to-recompile-discourse/159503/5 "2020-08-01T10:03:01Z")

</div>

If your goal is just to update a plugin _without_ updating the Discourse version, then simply use the Docker Manager’s upgrade console accessed from the online dashboard and hit the relevant upgrade button for the specific plugin, e.g.:

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/3/63a29c972214c01c7b4a53bb2220d09e5d615952.png)

`https://your-site/admin/upgrade`

Caveat #1: I believe this will only work with public assets, e.g. open source plugins. For private assets  
accessed by deploy keys embedded in the build script you may need to rebuild the entire project.  
Caveat #2: A lot of plugin updates are deployed to add compatibility for the latest build of Discourse. In most cases it makes sense to upgrade _both_ to the latest version, because some upgrades can _break_ compatibility with older versions of Discourse, but depends on what you are doing.
