wg-easy Deployment Tutorial

5,778 Views
1 Comment

Total 2086 characters, estimated reading time: 6 minutes.

Reminder: This article was last updated on May 16, 2026, at 8:27 PM. The information referenced in the article may have changed since then. Please be aware of this!

What is wg-easy?

wg-easy can easily configure the wireguard server
Features:
All-in-One: WireGuard Web UI
Simple to install, simple to use
List, create, edit, delete, enable, and disable clients
Display the customer's QR code
Download the client's configuration file
Statistics for connected clients
Display Tx/Rx chart for each connected client

Github download address

GitHub - wg-easy/wg-easy: The easiest way to run WireGuard VPN Web-based Admin UI.

Install wg-easy using Docker

Preparations before installation

Load the specified module on the local system first
modprobe ip_tables && modprobe iptable-nat

Note: This method will become invalid after each restart. The following methods will take effect permanently.

# 在/etc/sysconfig/modules/下创建个xxx.modules文件
touch /etc/sysconfig/modules/iptables.modules
# 然后设置755权限
chmod 755 /etc/sysconfig/modules/iptables.modules

The document reads as follows:

#!/bin/sh
modprobe ip_tables
modprobe iptable-nat

Docker Run

Run the docker container:

docker run -d \
  --name=wg-easy \
  -e WG_HOST=🚨YOUR_SERVER_IP \
  -e PASSWORD=🚨YOUR_ADMIN_PASSWOR \
  -e WG_DEFAULT_ADDRESS=10.0.0.x \
  -e WG_DEFAULT_DNS=114.114.114.114 \
  -e WG_PERSISTENT_KEEPALIVE=30 \
  -e WG_ALLOWED_IPS=10.0.0.0/24 \
  -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=always \
  weejewel/wg-easy

Must be modified:
WG_HOST=xxx It needs to be modified to the external network IP of the server, which can be https://ip138.com/queried.
PASSWORD=xxx Set password for management wg-easy
Optional modifications:
WG_DEFAULT_ADDRESS= and WG_ALLOWED_IPS= It can be modified to wireguard the IP segment of the local area network, such 192.168.1.x``192.168.1.0/24

Enter the webpage management page

Access after successfully running docker http://xxx:51821 You can enter the corresponding management page (xxx is the IP of the intranet where you deploy the service or the address of the configured WG_HOST)

Enter the password just configured here to enter

<!– wp:image {"id":318,"sizeSlug":"large","linkDestination":"none"} –>

<img src="https://oss.mcso.top/wp-content/uploads/2024/08/20250308065343633.png"alt="" class="wp-image-318"/>

<!– /wp:image –>

Click New in the upper right corner to create a new client configuration

<!– wp:image {"id":318,"sizeSlug":"large","linkDestination":"none"} –>

<img src="https://www.mcso.top/wp-content/uploads/2024/08/image-1740724819037.png"alt="" class="wp-image-318"/>

<!– /wp:image –>

After creation, you can click this to download the configuration file.

Update wg-easy

docker stop wg-easy
docker rm wg-easy
docker pull weejewel/wg-easy

Connect to wireguard

<!– wp:image {"id":318,"sizeSlug":"large","linkDestination":"none"} –>

<img src="https://www.mcso.top/wp-content/uploads/2024/08/image-1740724756868.png"alt="" class="wp-image-318"/>

<!– /wp:image –>

windows use the client to import the configuration to connect

END
 1
Comment(1 Comment)
Captcha