2025-01-23 08:06:55 +01:00
Below are some sample YAML configurations demonstrating how to override some default values.
## Basic
2025-01-18 11:55:56 +01:00
```yaml
core :
admin_user : test@example.com
admin_password : password
2025-02-07 22:42:48 +01:00
admin_api_token : super-s3cr3t-api-token-or-a-UUID
2025-01-18 11:55:56 +01:00
import_existing : false
2026-04-16 21:55:41 +02:00
create_default_peer_on_login : true
2025-01-18 11:55:56 +01:00
self_provisioning_allowed : true
2025-01-23 08:06:55 +01:00
2025-09-09 21:43:16 +02:00
backend :
# default backend decides where new interfaces are created
default : mikrotik
2025-10-12 14:31:19 +02:00
# A prefix for resolvconf. Usually it is "tun.". If you are using systemd, the prefix should be empty.
local_resolvconf_prefix : "tun."
2025-09-09 21:43:16 +02:00
mikrotik :
- id : mikrotik # unique id, not "local"
display_name : RouterOS RB5009 # optional nice name
api_url : https://10.10.10.10/rest
api_user : wgportal
api_password : a-super-secret-password
api_verify_tls : false # set to false only if using self-signed during testing
api_timeout : 30s # maximum request duration
concurrency : 5 # limit parallel REST calls to device
debug : false # verbose logging for this backend
ignored_interfaces : # ignore these interfaces during import
- wgTest1
- wgTest2
2025-01-18 11:55:56 +01:00
web :
site_title : My WireGuard Server
site_company_name : My Company
listening_address : : 8080
2025-05-04 14:48:34 +02:00
external_url : https://my.external-domain.com
2025-01-18 11:55:56 +01:00
csrf_secret : super-s3cr3t-csrf
session_secret : super-s3cr3t-session
request_logging : true
advanced :
log_level : trace
log_pretty : true
log_json : false
config_storage_path : /etc/wireguard
expiry_check_interval : 5m
database :
debug : true
type : sqlite
dsn : data/sqlite.db
2025-05-02 18:48:35 +02:00
encryption_passphrase : change-this-s3cr3t-encryption-passphrase
2025-05-12 22:53:43 +02:00
auth :
webauthn :
enabled : true
2025-01-18 11:55:56 +01:00
```
2025-01-23 08:06:55 +01:00
## LDAP Authentication and Synchronization
2025-01-18 11:55:56 +01:00
```yaml
# ... (basic configuration)
auth :
ldap :
# a sample LDAP provider with user sync enabled
2025-11-18 23:23:49 +01:00
- provider_name : ldap
2025-01-18 11:55:56 +01:00
url : ldap://srv-ad1.company.local:389
bind_user : ldap_wireguard@company.local
bind_pass : super-s3cr3t-ldap
base_dn : DC=COMPANY,DC=LOCAL
login_filter : (&(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))
sync_interval : 15m
sync_filter : (&(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))
disable_missing : true
field_map :
user_identifier : sAMAccountName
email : mail
firstname : givenName
lastname : sn
phone : telephoneNumber
department : department
memberof : memberOf
admin_group : CN=WireGuardAdmins,OU=Some-OU,DC=COMPANY,DC=LOCAL
registration_enabled : true
2026-03-19 23:13:19 +01:00
# Restrict interface access based on LDAP filters
interface_filter :
wg0 : "(memberOf=CN=VPNUsers,OU=Groups,DC=COMPANY,DC=LOCAL)"
2025-01-18 11:55:56 +01:00
log_user_info : true
```
2025-01-23 08:06:55 +01:00
## OpenID Connect (OIDC) Authentication
2025-01-18 11:55:56 +01:00
```yaml
# ... (basic configuration)
auth :
oidc :
2025-05-05 18:33:05 +02:00
# A sample Entra ID provider with environment variable substitution.
# Only users with an @outlook.com email address are allowed to register or login.
2025-11-18 23:23:49 +01:00
- provider_name : azure
2025-01-23 08:06:55 +01:00
display_name : Login with</br>Entra ID
registration_enabled : true
base_url : "https://login.microsoftonline.com/${AZURE_TENANT_ID}/v2.0"
client_id : "${AZURE_CLIENT_ID}"
client_secret : "${AZURE_CLIENT_SECRET}"
2025-05-05 18:33:05 +02:00
allowed_domains :
- "outlook.com"
2025-01-23 08:06:55 +01:00
extra_scopes :
- profile
- email
# a sample provider where users with the attribute `wg_admin` set to `true` are considered as admins
2025-11-18 23:23:49 +01:00
- provider_name : google
2025-01-18 11:55:56 +01:00
display_name : Login with</br>Google
base_url : https://accounts.google.com
client_id : the-client-id-1234.apps.googleusercontent.com
client_secret : A_CLIENT_SECRET
extra_scopes :
- https://www.googleapis.com/auth/userinfo.email
- https://www.googleapis.com/auth/userinfo.profile
field_map :
user_identifier : sub
email : email
firstname : given_name
lastname : family_name
phone : phone_number
department : department
is_admin : wg_admin
admin_mapping :
2025-02-07 17:59:58 +01:00
admin_value_regex : ^true$
2025-01-18 11:55:56 +01:00
registration_enabled : true
log_user_info : true
2025-01-23 08:06:55 +01:00
# a sample provider where users in the group `the-admin-group` are considered as admins
2025-11-18 23:23:49 +01:00
- provider_name : google2
2025-01-18 11:55:56 +01:00
display_name : Login with</br>Google2
base_url : https://accounts.google.com
client_id : another-client-id-1234.apps.googleusercontent.com
client_secret : A_CLIENT_SECRET
extra_scopes :
- https://www.googleapis.com/auth/userinfo.email
- https://www.googleapis.com/auth/userinfo.profile
2026-04-11 09:24:18 -07:00
allowed_user_groups :
- the-admin-group
- vpn-users
2025-01-18 11:55:56 +01:00
field_map :
user_identifier : sub
email : email
firstname : given_name
lastname : family_name
phone : phone_number
department : department
user_groups : groups
admin_mapping :
2025-02-07 17:59:58 +01:00
admin_group_regex : ^the-admin-group$
2025-01-18 11:55:56 +01:00
registration_enabled : true
log_user_info : true
```
2025-01-23 08:06:55 +01:00
## Plain OAuth2 Authentication
2025-01-18 11:55:56 +01:00
```yaml
# ... (basic configuration)
auth :
oauth :
# a sample provider where users with the attribute `this-attribute-must-be-true` set to `true` or `True`
2025-01-23 08:06:55 +01:00
# are considered as admins
2025-11-18 23:23:49 +01:00
- provider_name : google3
2025-01-18 11:55:56 +01:00
display_name : Login with</br>Google3
client_id : another-client-id-1234.apps.googleusercontent.com
client_secret : A_CLIENT_SECRET
auth_url : https://accounts.google.com/o/oauth2/v2/auth
token_url : https://oauth2.googleapis.com/token
user_info_url : https://openidconnect.googleapis.com/v1/userinfo
scopes :
- openid
- email
- profile
field_map :
user_identifier : sub
email : email
firstname : name
is_admin : this-attribute-must-be-true
admin_mapping :
2025-02-07 17:59:58 +01:00
admin_value_regex : ^(True|true)$
2025-01-18 11:55:56 +01:00
registration_enabled : true
# a sample provider where either users with the attribute `this-attribute-must-be-true` set to `true` or
2025-01-23 08:06:55 +01:00
# users in the group `admin-group-name` are considered as admins
2025-11-18 23:23:49 +01:00
- provider_name : google4
2025-01-18 11:55:56 +01:00
display_name : Login with</br>Google4
client_id : another-client-id-1234.apps.googleusercontent.com
client_secret : A_CLIENT_SECRET
auth_url : https://accounts.google.com/o/oauth2/v2/auth
token_url : https://oauth2.googleapis.com/token
user_info_url : https://openidconnect.googleapis.com/v1/userinfo
scopes :
- openid
- email
- profile
- i-want-some-groups
2026-04-11 09:24:18 -07:00
allowed_user_groups :
- admin-group-name
- vpn-users
2025-01-18 11:55:56 +01:00
field_map :
email : email
firstname : name
user_identifier : sub
is_admin : this-attribute-must-be-true
user_groups : groups
admin_mapping :
admin_value_regex : ^true$
admin_group_regex : ^admin-group-name$
registration_enabled : true
log_user_info : true
2025-01-23 08:06:55 +01:00
```
2025-09-09 21:43:16 +02:00
For more information, check out the usage documentation (e.g. [General Configuration ](../usage/general.md ) or [Backends Configuration ](../usage/backends.md )).