# Config as code options for Discourse?

**URL:** https://meta.discourse.org/t/config-as-code-options-for-discourse/279036
**Category:** Feature
**Tags:** migrations-tooling
**Created:** [September 14, 2023, 5:05pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036 "2023-09-14T17:05:31Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![jrack](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrack/32/326934_2.png) [@jrack](https://meta.discourse.org/u/jrack)
#### Post date: [September 14, 2023, 5:05pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/1 "2023-09-14T17:05:31Z")

</div>

So not talking about the instance deployment with db etc.

Is there a pattern out there for maintaining an instance using some declarative format? Categories, tags, policies, etc. Was thinking it would be nice for our technical users to recommend changes via PR vs topic threads and manual fulfillment, but didn’t see a plugin or other “as code” tool out there focused on the organizational config of Discourse.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [September 14, 2023, 6:06pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/2 "2023-09-14T18:06:16Z")

</div>

> [@jrack](#):
>
> Is there a pattern out there for maintaining an instance using some declarative format? Categories, tags, policies, etc.

I think the expectation is that sites will use the pre-seeded #Contribute > Site feedback category for this. Its description is: “Discussion about this site, its organization, how it works, and how we can improve it.”

> [@jrack](#):
>
> Was thinking it would be nice for our technical users to recommend changes via PR vs topic threads and manual fulfillment,

That’s an interesting idea. What benefit would it have over just having users suggest changes in regular topics? Is the goal to have a way of keeping track of changes that have been made to the site’s configuration over time?

Site settings, categories, tags, policies etc, can be configured with the Discourse API. It might be possible to have a script that managed your site’s configuration via the API in a git repo. The script could be run when a PR on the repo is accepted. From my point of view this would be more difficult than manually making changes to the site’s config via the UI though.

---

<div class="post-metadata">

### Author: ![jrack](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrack/32/326934_2.png) [@jrack](https://meta.discourse.org/u/jrack)
#### Post date: [September 14, 2023, 7:13pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/3 "2023-09-14T19:13:24Z")

</div>

10-4 on the Category. For now I was crowdsourcing a bit on an existing pattern. For me its getting that gitops style community engagement so landed with this one, but can punt it over to the other if it helps.

And yeah we use a bit of config as code for a lot of things so you get the clean revision control, deterministic roll back, clear change review, etc. GUI based changes are not bad (and what we do today via community feedback loops) but its a manual operation and the decision context can be lost to time. And the org constructs exist in the middle between the infra and the actual dialog so its not a deployment or rehydration thing.

And yeah PR based triggers (or even an Issue) can fire off a runbook that figures out the proposed change and does the operation. Doing the diff analysis and linting can be difficult which is why i was poking around to see if anyone had tried it yet. The ask is definitely square in the nice to have camp and only might resonate with a certain demographic.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [July 10, 2025, 3:55pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/4 "2025-07-10T15:55:59Z")

</div>

I (and I’m quite certain our programming language community) would absolutely love this ability. In particular, I would love to be able to manage themes, components, and site texts on a GitHub repository where folks can easily submit pull requests. General site settings would also be nice, but it’s those three things that are most painful to maintain in a web UI.

If this isn’t possible today — and I don’t think it is, at least not for a paid/hosted instance — could this be re-categorized into a feature request? In particular, it’d be amazing if themes and components could just point at a git repo.

Or, alternatively, has anyone built out the GitHub trigger integrations proposed above?

---

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [July 10, 2025, 4:02pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/5 "2025-07-10T16:02:24Z")

</div>

> [@mbauman](#):
>
> In particular, it’d be amazing if themes and components could just point at a git repo.

Immediately after writing that, I thought to double check the UI. It seems this is possible — at least to create/import a theme from a git repo! How does this work for updates? Is it able to pull new commits? I found [Installing a theme from a private Git repository](https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584), but that doesn’t discuss update.

 ![Admin UI screenshot for installing a new theme that has the "From a git repository" option selected](https://global.discourse-cdn.com/meta/original/4X/e/9/9/e9943a100c1b2b270d18c19c2b1868a875ee3cf3.png)

Is it possible to convert an existing theme or component to track a git repository?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [July 10, 2025, 4:59pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/6 "2025-07-10T16:59:02Z")

</div>

You can export a theme, upload it to a repository, and install that.

All remote themes have a section at the top where you can decide if you want it to update automatically when Discourse is updated. Furthermore, there is a background job that checks if a more recent version is available, and you can check for new updates manually too. When a new version is available, the button offers to update the component.

You can also find that information in the guide about [Installing a theme or theme component](https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682).

In case you haven’t already found it, there is also a tutorial about [theme development](https://meta.discourse.org/t/theme-developer-tutorial-2-creating-a-remote-theme/357797)

---

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [July 15, 2025, 3:36pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/7 "2025-07-15T15:36:41Z")

</div>

That’s great, thanks @Moin! That covers two big sources of our site’s customization.

I’d still really like to use git to manage the **Site Texts** as many of those (like the guidelines and FAQ and such) are long, non-trivial, and can be open source for community input and review.

The other site settings would be nice to have, but definitely not as crucial.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [July 15, 2025, 4:21pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/8 "2025-07-15T16:21:33Z")

</div>

> [@mbauman](#):
>
> like the guidelines and FAQ and such

Those are usually base on a topic in the staff category. I think you can move them to a different category and make the post a wiki. Then your members can edit them.

You can also use the `FAQ URL`, `Privacy policy URL` and `ToS URL` site settings and host these somewhere else

---

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [July 17, 2025, 1:33pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/9 "2025-07-17T13:33:25Z")

</div>

Yeah, but the `FAQ URL` setting unfortunately has other behaviors that makes its use very much self-defeating for this purpose.

> [@Option for custom "Guidelines" URL (not FAQ)?](https://meta.discourse.org/t/option-for-custom-guidelines-url-not-faq/95038/5):
>
> Well, it’s been another 4 years. This behavior (or lack thereof) is now at least documented: It is definitely odd that choosing to host the default /guidelines page externally makes another internal-only /guidelines page pop up.

---

<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: [July 17, 2025, 2:11pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/10 "2025-07-17T14:11:37Z")

</div>

Just to point out that it is clear that it is already possible to manage content in source control, take a look at this topic, it’s maintained on GitHub:

> [@Controlling site settings with themes](https://meta.discourse.org/t/controlling-site-settings-with-themes/374376):
>
> Themeable site settings allow a theme (not components) to override a small subset of core site settings, which generally control parts of the UI and other minor functionality. This allows themes to have a greater control over the full site experience. heavy_plus_sign Adding themeable site settings All themeable site settings are defined in the core config/site\_settings.yml file. Any setting with themeable: true will be available to themes. To override the default site setting value when the …

at the bottom:

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/5/5/955abee859bc52566953e1b5dccb7e132ab5fc4e.png)

though I’m not sure if this functionality has yet been released or announced (or if that’s intended)

---

<div class="post-metadata">

### Author: ![mbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbauman/32/139835_2.png) [@mbauman](https://meta.discourse.org/u/mbauman)
#### Post date: [July 26, 2025, 4:21pm UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/11 "2025-07-26T16:21:02Z")

</div>

I’ve started fiddling around a GitHub action that submits updates to the `site_texts` section of the admin panel via API. It’s pretty rudimentary at the moment (and is failing for big values with a 422 for some reason), but it’s promising.

[https://github.com/JuliaDiscourse/customize](https://github.com/JuliaDiscourse/customize)

Definitely needs more work.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 28, 2025, 8:32am UTC](https://meta.discourse.org/t/config-as-code-options-for-discourse/279036/12 "2025-07-28T08:32:03Z")

</div>

> [@merefield](#):
>
> though I’m not sure if this functionality has yet been released or announced (or if that’s intended)

We don’t currently have any plans to release it as a re-usable tool. But you can check the code for our sync [here](https://github.com/discourse/discourse-developer-docs/blob/main/sync_docs). It leans on all the normal Discourse REST APIs, including a data-explorer query (details [here](https://github.com/discourse/discourse-developer-docs?tab=readme-ov-file#contributing)).
