A lightweight Go implementation of WireGuard VPN management with web UI, designed to work behind nginx in subdirectories.
This is a minimal port of wg-easy focusing on core functionality with the crucial addition of proper reverse proxy subdir support.
The original wg-easy doesn't work properly when hosted behind nginx in a subdirectory (e.g., http://server.com/wgeasy). This Go port fixes that issue while providing:
- ✅ Subdir Support - Works perfectly at any path (
/wgeasy,/vpn, etc.) - ✅ Lightweight - Single 12MB binary vs 500MB+ Node.js installation
- ✅ Fast - Instant startup, low memory usage (~10-20MB)
- ✅ Simple - Easy to deploy, modify, and understand
- 🔐 Admin authentication with session management
- 👥 Create/delete WireGuard clients
- 🌐 IPv4 and IPv6 dual-stack support
- 📱 Download client configuration files
- 🎨 Simple, functional HTML interface
- 🔄 Nginx reverse proxy support (subdir or root)
- 🐳 Docker support
- Go 1.21+
- WireGuard installed (
wgandwg-quickcommands) - Root/sudo access for WireGuard management
Create config.json:
{
"admin_password": "your-secure-password",
"base_path": "/wgeasy",
"listen_addr": ":8080",
"wg_interface": "wg0",
"wg_address_v4": "10.8.0.1/24",
"wg_address_v6": "fd00::1/64",
"wg_port": 51820,
"wg_endpoint": "your-server.com:51820"
}# Build
go build -o wg-easy-go
# Run (requires root for WireGuard management)
sudo ./wg-easy-go
# Access at http://localhost:8080/wgeasylocation /wgeasy/ {
proxy_pass http://localhost:8080/wgeasy/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007