Go to file
adrien a082a40bf6 config: Add support for custom client port configuration
This commit introduces the ability to specify a custom port for the client
configuration. This feature is particularly useful when the WireGuard server
is behind a port forwarding setup, allowing clients to connect using the
correct port number.

With this change, users can now define the desired client port in the
configuration file, ensuring seamless connectivity even in scenarios where
the client's listening port differs from the standard WireGuard port.
2024-06-07 12:53:54 +02:00
.github Everyting owned by WeeJeWel 2024-06-02 15:19:29 +02:00
assets update screenshot to @2x 2021-11-22 22:38:10 +01:00
docs [fixup] Grammar 2024-04-05 19:02:44 +02:00
src config: Add support for custom client port configuration 2024-06-07 12:53:54 +02:00
.dockerignore Added nodemon as a dev dependency and removed unnecessary instructions from the Dockerfile 2024-04-30 17:03:48 +02:00
.gitignore [combine] gitignore 2024-04-14 19:16:41 +02:00
Dockerfile Dockerfile: remove unused parts 2024-05-23 09:45:37 +02:00
LICENSE Rename LICENSE.md to LICENSE 2024-01-12 00:11:42 +01:00
README.md fixup: add UI_CHART_TYPE docs 2024-05-24 21:32:17 +02:00
contributing.md contributing.md: remove stackoverflow link 2024-01-07 20:06:43 +01:00
docker-compose.dev.yml docker-compose: `version` is obsolete 2024-05-04 13:18:20 +00:00
docker-compose.yml config: Add support for custom client port configuration 2024-06-07 12:53:54 +02:00
package-lock.json npm: package updates 2023-12-21 21:05:31 +00:00
package.json Use the newer Docker Compose 2024-04-30 17:04:33 +02:00
wg-easy.service Revert "feat: cidr notation" 2024-03-27 14:41:31 +01:00

README.md

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!

Features

  • All-in-one: WireGuard + Web UI.
  • Easy installation, simple to use.
  • List, create, edit, delete, enable & disable clients.
  • Show a client's QR code.
  • Download a client's configuration file.
  • Statistics for which clients are connected.
  • Tx/Rx charts for each connected client.
  • Gravatar support.
  • Automatic Light / Dark Mode
  • Multilanguage Support
  • UI_TRAFFIC_STATS (default off)

Requirements

  • A host with a kernel that supports WireGuard (all modern kernels).
  • A host with Docker installed.

Versions

We provide more then 1 docker image to get, this will help you decide which one is best for you.

tag Branch Example Description
latest production ghcr.io/wg-easy/wg-easy:latest or ghcr.io/wg-easy/wg-easy stable as possbile get bug fixes quickly when needed, deployed against production.
13 production ghcr.io/wg-easy/wg-easy:13 same as latest, stick to a version tag.
nightly master ghcr.io/wg-easy/wg-easy:nightly mostly unstable gets frequent package and code updates, deployed against master.
development pull requests ghcr.io/wg-easy/wg-easy:development used for development, testing code from PRs before landing into master.

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:

  docker run -d \
  --name=wg-easy \
  -e LANG=de \
  -e WG_HOST=<🚨YOUR_SERVER_IP> \
  -e PASSWORD=<🚨YOUR_ADMIN_PASSWORD> \
  -e PORT=51821 \
  -e WG_PORT=51820 \
  -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

💡 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

WireGuard Easy can be launched with Docker Compose as well - just download docker-compose.yml, make necessary adjustments and execute docker compose up --detach.

3. Sponsor

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

Options

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. WireGuard will listen on that (othwise default) inside the Docker container.
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 IP address range.
WG_DEFAULT_DNS 1.1.1.1 8.8.8.8, 8.8.4.4 DNS server clients will use. If set to blank value, clients will not use any DNS.
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.
LANG en de Web UI language (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th, hi).
UI_TRAFFIC_STATS false true Enable detailed RX / TX client stats in Web UI
UI_CHART_TYPE 0 1 UI_CHART_TYPE=0 # Charts disabled, UI_CHART_TYPE=1 # Line chart, UI_CHART_TYPE=2 # Area chart, UI_CHART_TYPE=3 # Bar chart

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.

With Docker Compose WireGuard Easy can be updated with a single command: docker compose up --detach --pull always (if an image tag is specified in the Compose file and it is not latest, make sure that it is changed to the desired one; by default it is omitted and defaults to latest).
The WireGuared Easy container will be automatically recreated if a newer image was pulled.

Common Use Cases

For less common or specific edge-case scenarios, please refer to the detailed information provided in the Wiki.