This page covers common configuration steps for DefGuard deployments.
Use the same configuration file referenced in the setup guide for your installation.
Typical self-hosted deployments use an environment file and service definition:
/opt/defguard/.env
docker-compose.yml
# App URL
DEFGUARD_URL=https://defguard.example.com
# Database
DATABASE_URL=postgres://defguard:change-me@127.0.0.1:5432/defguard
# Secrets
SECRET_KEY=replace-with-long-random-secret
AUTH_SECRET=replace-with-random-auth-secret
# WireGuard core settings
WG_DEFAULT_ADDRESS_POOL=10.200.0.0/24
WG_DEFAULT_DNS=1.1.1.1
# Logging
RUST_LOG=info
Restart service stack after config updates:
docker compose up -d
or when managed by systemd:
sudo systemctl restart defguard
Restart the service or reload the configuration using your init system or container manager.
Confirm the service is healthy, then test connectivity from a client.
docker compose ps
docker logs --tail=100 defguard
Then validate in the portal: