Back to Wg Easy

Unattended Setup

docs/content/advanced/config/unattended-setup.md

15.2.22.1 KB
Original Source

If you want to run the setup without any user interaction, e.g. with a tool like Ansible, you can use these environment variables to configure the setup.

These will only be used during the first start of the container. After that, the setup will be disabled.

EnvExampleDescriptionGroup
INIT_ENABLEDtrueEnables the below env vars0
INIT_USERNAMEadminSets admin username1
INIT_PASSWORDSe!ureP%sswSets admin password1
INIT_HOSTvpn.example.comHost clients will connect to1
INIT_PORT51820Port clients will connect to and wireguard will listen on1
INIT_DNS1.1.1.1,8.8.8.8Sets global dns setting2
INIT_IPV4_CIDR10.8.0.0/24Sets IPv4 cidr3
INIT_IPV6_CIDR2001:0DB8::/32Sets IPv6 cidr3
INIT_ALLOWED_IPS10.8.0.0/24,2001:0DB8::/32Sets global Allowed IPs4

/// warning | Variables have to be used together

If variables are in the same group, you have to set all of them. For example, if you set INIT_IPV4_CIDR, you also have to set INIT_IPV6_CIDR.

If you want to skip the setup process, you have to configure group 1 ///

/// note | Security

The initial username and password is not checked for complexity. Make sure to set a long enough username and password. Otherwise, the user won't be able to log in.

It's recommended to remove the variables after the setup is done to prevent the password from being exposed. ///