# Settings order of precedence with ENV vs DB?

**URL:** https://meta.discourse.org/t/settings-order-of-precedence-with-env-vs-db/248965
**Category:** Support
**Created:** [December 14, 2022, 9:51pm UTC](https://meta.discourse.org/t/settings-order-of-precedence-with-env-vs-db/248965 "2022-12-14T21:51:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fearlessfrog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fearlessfrog/32/119653_2.png) [@fearlessfrog](https://meta.discourse.org/u/fearlessfrog)
#### Post date: [December 14, 2022, 9:51pm UTC](https://meta.discourse.org/t/settings-order-of-precedence-with-env-vs-db/248965/1 "2022-12-14T21:51:38Z")

</div>

If I set an ENV VAR value in my container app.yml ENV section then does it override existing DB Site or GlobalSettings values? I think I’m finding it doesn’t by default?

E.g. DISCOURSE\_S3\_BUCKET I think needs to be blank in the DB to be picked up by app.yml ENV section?

Is there a way to force taking values from the env’s rather than the DB or is it best just to reset all the existing values? I was just doing a quick config test, so wanted to leave the site settings alone and just override in the app.yml.

Thanks for any insights.

---

<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: [December 15, 2022, 2:07pm UTC](https://meta.discourse.org/t/settings-order-of-precedence-with-env-vs-db/248965/2 "2022-12-15T14:07:56Z")

</div>

> [@fearlessfrog](#):
>
> DISCOURSE\_S3\_BUCKET I think needs to be blank in the DB to be picked up by app.yml ENV section?

No. The env settings override the database and how the setting from the UX.
