# プラグインを再ビルドせずにインストールする方法（またはメンテナンスメッセージを設定する方法）

**URL:** https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742
**Category:** Support
**Created:** [2018 年 5 月 30 日午後 2:13 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742 "2018-05-30T14:13:23Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Sir\_Reyowski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sir_reyowski/32/174908_2.png) [@Sir\_Reyowski](https://meta.discourse.org/u/Sir_Reyowski)
#### Post date: [2018 年 5 月 30 日午後 2:13 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/1 "2018-05-30T14:13:23Z")

</div>

Hi.

I’m searching for a solution that don’t make me rebuild my Discourse when I install a new plugin, which cause a long downtime.  
On some forum scripts (like PHPBB, FluxBB, etc…), we can install a plugin without causing a downtime.

I’m also looking for a solution to set a message when the users visits my rebuilding Discourse who says that the forum is currently in maintainance (instead of the web browser error).

Thanks!

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2018 年 5 月 30 日午後 2:14 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/2 "2018-05-30T14:14:11Z")

</div>

It’s really not possible to install a plugin without rebuilding afaik.

> [@Sir\_Reyowski](#):
>
> I’m also looking for a solution to set a message when the users visits my rebuilding Discourse who says that the forum is currently in maintainance (instead of the web browser error).

This can be done by setting up an offline page while rebuilding here is a guide:

> [@Add an offline page to display when Discourse is rebuilding or starting up](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238):
>
> warning This guide is intended for advanced users, who are already using nginx outside the docker container. By following this guide you make your setup more complicated and will lose some speed benefits like HTTP2 if you’re not running Ubuntu 16.04 or later. Proceed with caution! When Discourse is rebuilding or starting up, your users will usually either see an error message from their browser… …or a not-so-nice 502 error message from Nginx: If you’re a perfectionist …

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018 年 5 月 30 日午後 2:32 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/3 "2018-05-30T14:32:45Z")

</div>

The solution is to use a two-container install. This will let you build a new image while the old one keeps running. The amount of downtime is just what it takes to shutdown the old container and start the new one.

---

<div class="post-metadata">

### Author: ![Sir\_Reyowski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sir_reyowski/32/174908_2.png) [@Sir\_Reyowski](https://meta.discourse.org/u/Sir_Reyowski)
#### Post date: [2018 年 5 月 30 日午後 4:36 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/4 "2018-05-30T16:36:26Z")

</div>

Thanks, I will follow your solution.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2018 年 5 月 30 日午後 4:42 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/5 "2018-05-30T16:42:53Z")

</div>

A more advanced version can include a load balancer in front of the application container(s) to reduce downtime to a bare minimum right?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018 年 5 月 31 日午後 6:46 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/6 "2018-05-31T18:46:30Z")

</div>

Yes, I’ve experimented with having HAproxy in front of two containers, so it should be possible to leave the old server running, crank up the new one, shut down the old one with no downtime. I’ve not yet gotten it working correctly, however.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2018 年 6 月 1 日午前 1:32 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/7 "2018-06-01T01:32:25Z")

</div>

Can you tell me what kind of issues you had?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2018 年 6 月 1 日午前 3:57 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/8 "2018-06-01T03:57:23Z")

</div>

I’ll need to crank it up again and document it. It’ll take a while to figure it out again. ☹

---

<div class="post-metadata">

### Author: ![klh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klh/32/184826_2.png) [@klh](https://meta.discourse.org/u/klh)
#### Post date: [2020 年 7 月 22 日午後 12:01 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/9 "2020-07-22T12:01:50Z")

</div>

スレッドの掘り起こしで申し訳ありませんが、この投稿が Google で上位に表示されているため、私も同じ「問題」に直面しました。Docker コンテナ内での操作が必要になるため、何をしているか分からない場合は本番環境での実施はお勧めしません。サーバーに SSH で接続した後の手順は以下の通りです：  
**サポートされていない操作を行います。いかなる保証もいたしません！**

```plaintext
# cd /var/discourse
# ./launcher enter app
# su discourse
$ cd /var/www/discourse/plugins
$ git clone <plugin_git_url>
$ exit
# exit
# docker restart app

```

コンテナの起動中は少しダウンタイムが発生しますが、フルリビルドに比べるとはるかに高速です（最小構成の DigitalOcean ドロップレットでも数分ではなく数秒）。

---

<div class="post-metadata">

### Author: ![MakaryGo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/makarygo/32/187426_2.png) [@MakaryGo](https://meta.discourse.org/u/MakaryGo)
#### Post date: [2020 年 7 月 22 日午後 2:34 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/10 "2020-07-22T14:34:16Z")

</div>

こんにちは！  
おそらく、こちらをお探しのようです：

> [@Benefits of running discourse in separate containers for data and web](https://meta.discourse.org/t/benefits-of-running-discourse-in-separate-containers-for-data-and-web/36109/4):
>
> Per [Advanced Troubleshooting with Docker](https://meta.discourse.org/t/advanced-troubleshooting-with-docker/15927), the database is actually stored outside the container(s). AFAIK the main advantage of separating containers (if you’re changing nothing else about the default install) is reducing downtime when you’re running ./launcher rebuild app. However it’s a bit outside my knowledge and not something I’ve attempted doing, so I wouldn’t be surprised if there were more reasons to do it.

> [@Move from standalone container to separate web and data containers](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413/73):
>
> As far as I can tell, this guide is lots of words around: back up create a completely new discourse instance, with more words but the same results as just running discourse\_setup 2container restore Why wouldn’t you just move or copy /var/discourse/shared/standalone/{postgres,redis}\* into /var/discourse/shared/data after a clean shutdown and before starting up two new containers from separate containers/\*.yml files? A backup/restore seems like a really heavy-weight way to move all that data ac…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020 年 7 月 22 日午後 2:34 UTC](https://meta.discourse.org/t/how-to-install-a-plugin-without-rebuilding-or-set-a-maintainance-message/88742/11 "2020-07-22T14:34:36Z")

</div>

コンテナ内で

```
  sv restart unicorn

```

を実行することもできます。これはコンテナ自体を再起動するよりもわずかに高速です。

また、一部のプラグインではデータベースのマイグレーションが必要になります。
