> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/hosting/environment-variables/configuration-methods.md).

# Manage Duaer settings with environment variables

Configure self-hosted Duaer from the process environment, a .env file, or container injection.
## Three places, one startup

When you run the process directly, export the variables or place a .env file in the working directory. In a container, inject the same names from the orchestrator. Do not bake a .env file into an image layer. When a name is set twice, the value the process actually receives is the one that counts.

Duaer does not re-read .env mid-run. Restart the main process after a change. In queue mode, restart workers too. The dotenv parse change in 2.0 is [upgrade dotenv](/2-0-breaking-changes.md#upgrade-dotenv).

## Encryption key <a href="#encryption-key" id="encryption-key"></a>

Credential encryption uses the environment variable DUAER_ENCRYPTION_KEY. On first launch Duaer can also generate a key into the instance data directory. In queue mode every worker must use the same key. Refer to [Set a custom encryption key](/hosting/configuration/configuration-examples/encryption-key.md).
## Questions

### Where can you set environment variables in Duaer?

Process environment, .env, or container injection. Read at startup; restart after changes. After 2.0, recheck dotenv parsing.

