The easiest way to run WireGuard VPN + Web-based Admin UI.
2.8K
You have found the easiest way to install & manage WireGuard on any Linux host!
nightly build)nightly build)If you haven't installed Docker yet, install it by running:
$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker $(whoami)
$ exit
And log in again.
To automatically install & run wg-easy, simply run:
$ docker run -d \
--name=wg-easy \
-e WG_HOST=<b>🚨YOUR_SERVER_IP</b> \
-e PASSWORD=<b>🚨YOUR_ADMIN_PASSWORD</b> \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--privileged=true \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--sysctl="net.ipv6.conf.all.forwarding=1" \
--sysctl="net.ipv6.conf.all.src_valid_mark=1" \
--restart unless-stopped \
rusian/wg-easy:latest
💡 Replace
YOUR_SERVER_IPwith your WAN IP, or a Dynamic DNS hostname.💡 Replace
YOUR_ADMIN_PASSWORDwith a password to log in on the Web UI.
The Web UI will now be available on http://0.0.0.0:51821.
💡 Your configuration files will be saved in
~/.wg-easy
Are you enjoying this project? Buy Emile a beer! 🍻
These options can be configured by setting environment variables using -e KEY="VALUE" in the docker run command.
| Env | Default | Example | Description |
|---|---|---|---|
PORT | 51821 | 6789 | TCP port for Web UI. |
WEBUI_HOST | 0.0.0.0 | localhost | IP address web UI binds to. |
PASSWORD | - | foobar123 | When set, requires a password when logging in to the Web UI. |
WG_HOST | - | vpn.myserver.com | The public hostname of your VPN server. |
WG_DEVICE | eth0 | ens6f0 | Ethernet device the wireguard traffic should be forwarded through. |
WG_PORT | 51820 | 12345 | The public UDP port of your VPN server. This will also change the port wireguard will listen to. |
WG_INTERFACE | wg0 | wg1 | The interface wireguard will use in the container. (Only needed if network_mode: host or --net=host is used) |
WG_MTU | null | 1420 | The MTU the clients will use. Server uses default WG MTU. |
WG_PERSISTENT_KEEPALIVE | 0 | 25 | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. |
WG_DEFAULT_ADDRESS | 10.8.0.x | 10.6.0.x | Clients IPv4 address range. |
WG_DEFAULT_ADDRESS6 | fd42:42:42::x | fd86:ea04:1115::x | Clients IPv6 address range. |
WG_DEFAULT_DNS | 84.200.69.80 | 84.200.69.80, 84.200.70.40 | DNS server clients will use. |
WG_DEFAULT_DNS6 | 2001:1608:10:25::1c04:b12f | 2001:1608:10:25::1c04:b12f, 2001:1608:10:25::9249:d69b | DNSv6 server clients will use. |
WG_ALLOWED_IPS | 0.0.0.0/0, ::/0 | 192.168.15.0/24, 10.0.1.0/24 | Allowed IPs clients will use. |
WG_PRE_UP | ... | - | See config.js for the default value. |
WG_POST_UP | ... | iptables ... | See config.js for the default value. |
WG_PRE_DOWN | ... | - | See config.js for the default value. |
WG_POST_DOWN | ... | iptables ... | See config.js for the default value. |
If you change
WG_PORT, make sure to also change the exposed port.
To update to the latest version, simply run:
docker stop wg-easy
docker rm wg-easy
docker pull rusian/wg-easy:latest
And then run the docker run -d \ ... command above again.
Content type
Image
Digest
sha256:105ee3515…
Size
84.7 MB
Last updated
about 2 months ago
docker pull rusian/wg-easy:development