Overview
Unattended setup allows you to configure WireGuard Easy automatically on first startup without any user interaction. This is particularly useful when:- Deploying with automation tools like Ansible, Terraform, or Puppet
- Running in CI/CD pipelines
- Provisioning multiple instances with consistent configuration
- Implementing infrastructure as code
Unattended setup variables are only used during the first start of the container. After the initial configuration is complete, these variables are ignored.
Environment Variables
All unattended setup variables are grouped by dependency. Variables in the same group must be set together.Group 0: Enable Unattended Setup
Enable unattended setup mode.This must be set to
true to activate the other INIT_* environment variables.Example:Group 1: Required Configuration
These variables must all be set together to skip the initial setup wizard.Admin username for the web UI.Example:
Admin password for the web UI.Example:
Public hostname or IP address that clients will use to connect to the WireGuard server.This should be:
- Your server’s public IP address, or
- A domain name pointing to your server (e.g.,
vpn.example.com)
UDP port that clients will connect to and WireGuard will listen on.This is the WireGuard port (default: 51820), not the web UI port.Example:
Group 2: DNS Configuration
Comma-separated list of DNS servers for clients.Sets the global DNS configuration that will be used by all clients by default. You can specify multiple DNS servers.Popular DNS options:
- Cloudflare:
1.1.1.1,1.0.0.1 - Google:
8.8.8.8,8.8.4.4 - Quad9:
9.9.9.9,149.112.112.112
Group 3: IP Address Configuration
IPv4 address range for the WireGuard network in CIDR notation.This defines the private IP address space that will be used for the VPN tunnel.Common ranges:
10.8.0.0/24(254 usable addresses)10.8.0.0/16(65,534 usable addresses)192.168.99.0/24(254 usable addresses)
IPv6 address range for the WireGuard network in CIDR notation.This defines the IPv6 address space for the VPN tunnel.Example:
Group 4: Allowed IPs
Comma-separated list of IP ranges that clients can access through the VPN.This sets the global “Allowed IPs” configuration. Common configurations:
- Full tunnel (all traffic through VPN):
0.0.0.0/0,::/0 - Split tunnel (only VPN network):
10.8.0.0/24,fd00:db8::/64 - Custom ranges: Specify exact networks clients should route through VPN
Complete Example
Here’s a complete docker-compose.yml with unattended setup:Minimal Example
The minimum configuration required to skip the setup wizard:Security Best Practices
1. Remove Credentials After Setup
Once WireGuard Easy has been initialized, remove theINIT_PASSWORD variable from your configuration:
2. Use Strong Passwords
The password is not validated for complexity. Use:- At least 16 characters
- Mix of uppercase, lowercase, numbers, and special characters
- Password manager to generate and store credentials
3. Secure Environment Variables
When using environment variables in production:- Use Docker secrets or external secret management
- Avoid committing credentials to version control
- Use
.envfiles with appropriate permissions (mode 600)
4. Use Long Usernames
Don’t use common usernames likeadmin. Use something unique:
Automation Examples
Ansible Playbook
Terraform Example
Troubleshooting
Setup Not Running
Problem: The setup wizard still appears even withINIT_ENABLED=true.
Solutions:
- Verify all Group 1 variables are set correctly
- Check container logs for error messages
- Ensure the volume is empty (setup only runs on first start)
Cannot Login
Problem: Login fails with the configured credentials. Solutions:- Verify password meets minimum complexity (length)
- Check for typos in username/password
- Look for special characters that might need escaping in YAML
Variable Grouping Errors
Problem: Setup fails with missing variable errors. Solutions:- Ensure all variables in the same group are set together
- Check the group requirements in the documentation above
- Review container logs for specific error messages
Next Steps
Environment Variables
View all available environment variables
Docker Compose
Complete installation guide with reverse proxy setup