# Rebuild the forum using code?

**URL:** https://meta.discourse.org/t/rebuild-the-forum-using-code/352173
**Category:** Development
**Tags:** code
**Created:** [February 13, 2025, 11:04pm UTC](https://meta.discourse.org/t/rebuild-the-forum-using-code/352173 "2025-02-13T23:04:36Z")
**Posts on this page:** 1
**Showing post:** 8

<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: [February 14, 2025, 6:44pm UTC](https://meta.discourse.org/t/rebuild-the-forum-using-code/352173/8 "2025-02-14T18:44:37Z")

</div>

> [@NateDhaliwal](#):
>
> Is there a way to rebuild using Ruby?

You can do something like this inside the container to add a plugin to an existing container:

```plaintext
cd /var/www/discourse/plugins
git clone my-plugin-url
rake db:migrate assets:precompile
sv restart unicorn

```

But the problems of keeping the plugins in the container and in the `app.yml` for when you rebuild next are there.

I’ve been burned a number of times doing a `./launcher destroy app;./launcher start app` to apply new ENV variables from `app.yml` only to find that the “new” container is behind the version that the database is. It’s even worse if someone has upgrade only some plugins in the container that worked with the version of Discourse that was in the old container, but not with the one that you get when you rebuild. . .

---

_[View the full topic](https://meta.discourse.org/t/rebuild-the-forum-using-code/352173)._
