Config file breakdown (#565)

This commit is contained in:
shuuri-labs
2026-01-22 16:38:32 +01:00
committed by GitHub
parent b5ce088750
commit 4b5f9b58dc
5 changed files with 889 additions and 17 deletions

View File

@@ -2,7 +2,7 @@ import {Note} from "@/components/mdx";
# Environment Variables Configuration
This page provides a comprehensive reference for all environment variables available when self-hosting NetBird. Environment variables allow you to configure the Management Server, Signal Server, Relay Server, Dashboard, and Coturn (TURN) services.
This page provides a comprehensive reference for all environment variables available when self-hosting NetBird. Environment variables allow you to configure the Management Server, Signal Server, Relay Server (including the embedded STUN server), and Dashboard services.
<Note>
Environment variables set in your `setup.env` file are used by the `configure.sh` script to generate the final configuration files. Changes to `setup.env` require re-running `./configure.sh` to take effect.
@@ -36,15 +36,17 @@ These variables are set in your `setup.env` file before running the configuratio
| `NETBIRD_RELAY_PORT` | `33080` | Relay server port |
| `NGINX_SSL_PORT` | `443` | Dashboard HTTPS port |
### TURN Server
### STUN Configuration
<Note>
The default quickstart deployment uses the relay service's embedded STUN server. The variables below configure STUN functionality within the relay container via `relay.env`.
</Note>
| Variable | Default | Description |
|----------|---------|-------------|
| `TURN_DOMAIN` | Same as `NETBIRD_DOMAIN` | TURN server domain |
| `TURN_USER` | Auto-generated | TURN authentication username |
| `TURN_PASSWORD` | Auto-generated | TURN authentication password |
| `TURN_MIN_PORT` | `49152` | Minimum TURN relay port |
| `TURN_MAX_PORT` | `65535` | Maximum TURN relay port |
| `NB_ENABLE_STUN` | `true` | Enable embedded STUN server in relay |
| `NB_STUN_PORTS` | `3478` | STUN server UDP ports |
| `NB_STUN_LOG_LEVEL` | `info` | STUN server log level |
## Management Server Variables
@@ -178,6 +180,9 @@ These variables can override CLI flags at runtime. The naming convention is `NB_
| `NB_LETSENCRYPT_DOMAINS` | - | Let's Encrypt domains |
| `NB_LETSENCRYPT_EMAIL` | - | Let's Encrypt email |
| `NB_HEALTH_LISTEN_ADDRESS` | - | Health check listen address |
| `NB_ENABLE_STUN` | `false` | Enable embedded STUN server |
| `NB_STUN_PORTS` | `3478` | STUN server UDP ports (comma-separated) |
| `NB_STUN_LOG_LEVEL` | `info` | STUN server log level |
## Dashboard Variables
@@ -192,7 +197,11 @@ These variables can override CLI flags at runtime. The naming convention is `NB_
Dashboard authentication is automatically configured when using the embedded identity provider. The dashboard connects to the management server's built-in OAuth2 endpoints.
</Note>
## Coturn (TURN Server) Variables
## Coturn (TURN Server) Variables (Legacy)
<Note>
The default quickstart deployment no longer uses a separate Coturn container. STUN functionality is now embedded in the relay service. The variables below are only relevant for legacy deployments or advanced configurations that still use Coturn.
</Note>
Coturn configuration is generated from templates using these variables:
@@ -205,9 +214,7 @@ Coturn configuration is generated from templates using these variables:
| `TURN_MAX_PORT` | `65535` | Maximum relay port |
| `TURN_EXTERNAL_IP_CONFIG` | - | External IP configuration |
<Note>
The Coturn service uses static ports: `3478` (STUN/TURN) and `5349` (TLS TURN).
</Note>
## Configuration Examples
@@ -268,5 +275,6 @@ Configuration values are applied in the following order (later values override e
- [Self-hosting Quickstart Guide](/selfhosted/selfhosted-quickstart)
- [Advanced Self-hosting Guide](/selfhosted/selfhosted-guide)
- [Configuration Files Reference](/selfhosted/configuration-files) - Detailed documentation for docker-compose.yml, management.json, and other config files
- [Management SQLite Store](/selfhosted/sqlite-store)
- [Management Postgres Store](/selfhosted/postgres-store)