Home

Awesome

WireGuard Easy

Build & Publish Docker Image to Docker Hub Lint Docker Sponsor GitHub Stars

You have found the easiest way to install & manage WireGuard on any Linux host!

<p align="center"> <img src="./assets/screenshot.png" width="802" /> </p>

Features

Requirements

Installation

1. Install Docker

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.

2. Run WireGuard Easy

To automatically install & run wg-easy, simply run:

<pre> $ 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 \ --cap-add=NET_ADMIN \ --cap-add=SYS_MODULE \ --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ --sysctl="net.ipv4.ip_forward=1" \ --restart unless-stopped \ ghcr.io/wg-easy/wg-easy </pre>

💡 Replace YOUR_SERVER_IP with your WAN IP, or a Dynamic DNS hostname.

💡 Replace YOUR_ADMIN_PASSWORD with 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

3. Sponsor

Are you enjoying this project? Buy me a beer! 🍻

Options

These options can be configured by setting environment variables using -e KEY="VALUE" in the docker run command.

EnvDefaultExampleDescription
PASSWORD-foobar123When set, requires a password when logging in to the Web UI.
WG_HOST-vpn.myserver.comThe public hostname of your VPN server.
WG_DEVICEeth0ens6f0Ethernet device the wireguard traffic should be forwarded through.
WG_PORT5182012345The public UDP port of your VPN server. WireGuard will always listen on 51820 inside the Docker container.
WG_MTUnull1420The MTU the clients will use. Server uses default WG MTU.
WG_PERSISTENT_KEEPALIVE025Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive.
WG_DEFAULT_ADDRESS10.8.0.x10.6.0.xClients IP address range.
WG_DEFAULT_DNS1.1.1.18.8.8.8, 8.8.4.4DNS server clients will use.
WG_ALLOWED_IPS0.0.0.0/0, ::/0192.168.15.0/24, 10.0.1.0/24Allowed 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.

Updating

To update to the latest version, simply run:

docker stop wg-easy
docker rm wg-easy
docker pull ghcr.io/wg-easy/wg-easy

And then run the docker run -d \ ... command above again.

Common Use Cases