# Environment (.env) and config (.json) files on QNAP

**URL:** <https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954>\
**Category:** Third Party Help\
**Created:** [June 21, 2021, 7:18pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954 "2021-06-21T19:18:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viking](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/viking/32/513_2.png) [@Viking](https://vaultwarden.discourse.group/u/Viking)\
**Post date:** [June 21, 2021, 7:18pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954/1 "2021-06-21T19:18:18Z")

</div>

My understanding is that initial configuration of VaultWarden (BitWarden) can be done using an Environment file. So, I found this samle file online: [VaultWarden Env file - Pastebin.com](https://pastebin.com/uDErxfMT)  
I saved this file to the bt\_data folder, but I do not know how to point to this file during installation of the container, so that VaultWarden picks it up as default.  
I’m using the Container Station GUI on my QNAP NAS, and I assume I need to define an environment variable during creation - pointing to this file. I just don’t know the syntax to be used. I’m guessing it should be something like this (but it doesn’t work - VaultWarden complains that no file is found):

 ![image](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/444ad29600997e3d22fc631c1949ccb10ee62bed.png)

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [June 21, 2021, 9:28pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954/2 "2021-06-21T21:28:32Z")

</div>

Just configure the env values you want directly within the qnap interface, no need for an .env file here.

Also, there is the original file for the .env here: [vaultwarden/.env.template at main · dani-garcia/vaultwarden · GitHub](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template)

---

<div class="post-metadata">

**Author:** ![Viking](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/viking/32/513_2.png) [@Viking](https://vaultwarden.discourse.group/u/Viking)\
**Post date:** [June 21, 2021, 9:34pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954/3 "2021-06-21T21:34:31Z")

</div>

Again, thanks for helping out. 👍  
I figured I could do that, yes - but using an external environment file seemed like a terrific option since using the QNAP GUI to define environment variables implies that each time there is a need for a change, the container has to be killed an rebuilt. That a tedious process.  
I know that can use docker compose to solve that, but in the latest version of Container Station, using compose results in the building of an App type container, and I don’t want that.  
But thanks anyway. I will experiment a littel while longer before I choose my final approach.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [June 21, 2021, 9:41pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954/4 "2021-06-21T21:41:05Z")

</div>

If you want to use the .env file you also need to restart, so no difference there.

Also some env vars are read-only while running and those need to be configured via env values and then restarted. All other values can just be changed via the /admin interface. Never try to manually modify the config.json file, this will only lead to issues.

---

<div class="post-metadata">

**Author:** ![Viking](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/viking/32/513_2.png) [@Viking](https://vaultwarden.discourse.group/u/Viking)\
**Post date:** [June 21, 2021, 9:44pm UTC](https://vaultwarden.discourse.group/t/environment-env-and-config-json-files-on-qnap/954/5 "2021-06-21T21:44:19Z")

</div>

That I have read and understand. Thank you for pointing it out.  
I will follow your advise.
