Environment variables
Location
- Docker : in the
.envfile (referenced bydocker-compose.yml). - Baremetal installation :
.env.localfile at the root of the app directory.
Docker environment variables
| Variables to create (all required) | Value |
|---|---|
BETTER_AUTH_URL | URL as https://borgwarehouse.com |
BETTER_AUTH_SECRET | Secret key : openssl rand -base64 32 |
UNIX_USER | The user of your server as borgwarehouse |
FQDN | FQDN as borgwarehouse.com |
SSH_SERVER_PORT | SSH port as 22 |
PUID | UID of the host user owning the volumes |
PGID | GID of the host user owning the volumes |
| Optional variables | Value |
|---|---|
FQDN_LAN | Hostname or IP for backup through LAN repository |
SSH_SERVER_PORT_LAN | SSH port for backup through LAN repository |
SMTP variables | See the documentation here |
NEXT_TELEMETRY_DISABLED | Value 1 will disable NextJS telemetry |
CRONJOB_KEY | Secret key : openssl rand -base64 32 |
HOSTNAME | Value :: will force the app to start on IPv6 if needed |
DISABLE_INTEGRATIONS | Value true will disable the integrations (API tokens to CRUD repositories) (≥v2.4.0) |
DISABLE_DELETE_REPO | Value true will globally disable the possibility to delete a repository (≥v2.4.0) |
HIDE_SSH_PORT | Value true will hide the SSH port in the UI : quickcommands & wizard (≥v2.4.0) |
SETUP_SECRET | Secret passphrase required to complete the first-run setup wizard — protects /setup on exposed instances (≥v3.2.0) |
SESSION_EXPIRY_SECONDS | Session lifetime in seconds. Defaults to 3600 (1 hour). Example: 28800 for 8 hours (≥v3.2.0) |
BETTER_AUTH_TRUSTED_ORIGINS | Comma-separated list of trusted origins for reverse-proxy / multi-domain setups. Example: https://bw.example.com,https://bw.local (≥v3.2.0) |
OAuth / OIDC variables | See the OAuth/OIDC documentation |
DISABLE_PASSWORD_LOGIN | Value true disables username/password login — only valid if at least one OAuth/OIDC provider is configured (≥v3.2.0) |
For the
BETTER_AUTH_URL, be sure to specify the right protocol : http or https. Indicating an https URL when using http will make login impossible.Migrating from v3.1.x?
NEXTAUTH_SECRET and NEXTAUTH_URL are still accepted as fallbacks so existing installs keep working. Renaming them to BETTER_AUTH_SECRET / BETTER_AUTH_URL is recommended but not urgent.Of course, don't use HTTP if you can, use HTTPS, especially if you use BorgWarehouse over the Internet.
Important details about docker environment variables :
- The SSH fingerprints are automatically injected in the container.
- The
CRONJOB_KEYis automatically generated if not provided. But, if you want to trigger a job from outside the container, you must provide it to know the key. - The
SSH_SERVER_PORTis the port exposed by the container. It must match the port used in thedocker-compose.ymlfile. - If the
BETTER_AUTH_SECRETis not provided, it will be automatically generated. But, at each restart of your borgwarehouse container, a new secret will be generated and all users will be disconnected. So, it’s better to provide it.
Baremetal environment variables
| Variables to create (all required) | Value |
|---|---|
BETTER_AUTH_URL | URL as https://borgwarehouse.com |
BETTER_AUTH_SECRET | Secret key : openssl rand -base64 32 |
CRONJOB_KEY | Secret key : openssl rand -base64 32 |
UNIX_USER | The user of your server as borgwarehouse |
FQDN | FQDN as borgwarehouse.com |
SSH_SERVER_PORT | SSH port as 22 |
SSH_SERVER_FINGERPRINT_RSA | Your server SSH fingerprint for RSA |
SSH_SERVER_FINGERPRINT_ED25519 | Your server SSH fingerprint for ED25519 |
| Optional variables | Value |
|---|---|
FQDN_LAN | Hostname or IP for backup through LAN repository |
SSH_SERVER_PORT_LAN | SSH port for backup through LAN repository |
SMTP variables | See the documentation here |
NEXT_TELEMETRY_DISABLED | Value 1 will disable NextJS telemetry |
DISABLE_INTEGRATIONS | Value true will disable the integrations (API tokens to CRUD repositories) (≥v2.4.0) |
DISABLE_DELETE_REPO | Value true will globally disable the possibility to delete a repository (≥v2.4.0) |
HIDE_SSH_PORT | Value true will hide the SSH port in the UI : quickcommands & wizard (≥v2.4.0) |
SETUP_SECRET | Secret passphrase required to complete the first-run setup wizard (≥v3.2.0) |
SESSION_EXPIRY_SECONDS | Session lifetime in seconds. Defaults to 3600 (1 hour) (≥v3.2.0) |
BETTER_AUTH_TRUSTED_ORIGINS | Comma-separated trusted origins for reverse-proxy setups (≥v3.2.0) |
OAuth / OIDC variables | See the OAuth/OIDC documentation |
DISABLE_PASSWORD_LOGIN | Value true disables username/password login (OAuth-only mode) (≥v3.2.0) |
For the
BETTER_AUTH_URL, be sure to specify the right protocol : http or https. Indicating an https URL when using http will make login impossible.Of course, don't use HTTP if you can, use HTTPS, especially if you use BorgWarehouse over the Internet.