@ -23,46 +23,45 @@ This option can be removed in the future, as more devices support IPv6.
## Configuration Overrides
## Configuration Overrides
These environment variables allow you to override settings that would normally be configured through the Admin Panel. When set, these values take precedence over database settings and cannot be changed through the Web UI .
These environment variables allow you to override settings that would normally be configured through the Admin Panel. When set, these values take precedence over database settings at runtime .
### Interface Settings
### Interface Settings
| Env | Example | Description |
| Env | Example | Description |
| -------------- | ----------------- | ---------------------------------- |
| -------------- | ------------- | ------------------------- |
| `WG_PORT` | `51820` | WireGuard interface listening port |
| `WG_PORT` | `51820` | WireGuard interface port |
| `WG_DEVICE` | `eth0` | Network device/interface |
| `WG_DEVICE` | `eth0` | Network device/interface |
| `WG_MTU` | `1420` | Maximum Transmission Unit |
| `WG_MTU` | `1420` | Maximum Transmission Unit |
| `WG_IPV4_CIDR` | `10.8.0.0/24` | IPv4 CIDR range |
| `WG_IPV4_CIDR` | `10.8.0.0/24` | IPv4 CIDR range |
| `WG_IPV6_CIDR` | `fdcc::/112` | IPv6 CIDR range |
| `WG_IPV6_CIDR` | `fdcc::/112` | IPv6 CIDR range |
| `WG_ENABLED` | `true` or `false` | Whether the interface is enabled |
### Client Connection Settings
### Client Connection Settings
| Env | Example | Description |
| Env | Example | Description |
| --------------------------------- | ----------------- | ---------------------------------------- |
| --------------------------------- | ----------------- | ------------------------------- |
| `WG_HOST` | `vpn.example.com` | Host clients will connect to |
| `WG_HOST` | `vpn.example.com` | Host clients will connect to |
| `WG_CLIENT_PORT` | `51820` | Port clients will connect to |
| `WG_CLIENT_PORT` | `51820` | Port clients will connect to |
| `WG_DEFAULT_DNS` | `1.1.1.1,8.8.8.8` | Default DNS servers for clients |
| `WG_DEFAULT_DNS` | `1.1.1.1,8.8.8.8` | Default DNS servers for clients |
| `WG_DEFAULT_ALLOWED_IPS` | `0.0.0.0/0,::/0` | Default allowed IPs for clients |
| `WG_DEFAULT_ALLOWED_IPS` | `0.0.0.0/0,::/0` | Default allowed IPs for clients |
| `WG_DEFAULT_MTU` | `1420` | Default MTU for clients |
| `WG_DEFAULT_MTU` | `1420` | Default MTU for clients |
| `WG_DEFAULT_PERSISTENT_KEEPALIVE` | `25` | Default persistent keepalive for clients |
| `WG_DEFAULT_PERSISTENT_KEEPALIVE` | `25` | Default persistent keepalive |
### General Settings
### General Settings
| Env | Example | Description |
| Env | Example | Description |
| ----------------------- | ----------------- | -------------------------- |
| ----------------------- | ----------------- | ------------------------- |
| `WG_SESSION_TIMEOUT` | `3600` | Session timeout in seconds |
| `WG_SESSION_TIMEOUT` | `3600` | Session timeout (seconds) |
| `WG_METRICS_PROMETHEUS` | `true` or `false` | Enable Prometheus metrics |
| `WG_METRICS_PROMETHEUS` | `true` or `false` | Enable Prometheus metrics |
| `WG_METRICS_JSON` | `true` or `false` | Enable JSON metrics |
| `WG_METRICS_JSON` | `true` or `false` | Enable JSON metrics |
/// warning | Override Behavior
/// warning | Override Behavior
When these override environment variables are set:
When these override environment variables are set:
- The specified values will be used instead of database settings
- The specified values will be used at runtime instead of database settings
- Changes made through the Web UI to these fields will not take effect
- You can still update these fields through the Web UI and they will be saved to the database
- The Web UI will still display the overridden values
- However, the overridden values from environment variables will always take precedence
- Updates to these fields via the API will be ignored
- The Web UI will display the overridden (effective) values
These overrides are useful for containerized environments where configuration should be controlled externally.
These overrides are useful for containerized environments where configuration should be controlled externally.