ksantd/wg-gateway

By ksantd

Updated 4 days ago

WireGuard VPN gateway with rule-based proxy routing via Mihomo. Web UI for peers & proxy management.

Image
Networking
Security
0

3.2K

ksantd/wg-gateway repository overview

wg-gateway

WireGuard VPN gateway with intelligent proxy routing. Deploy a single container that gives you:

  • 🔐 WireGuard VPN server — connect clients via UDP 51820
  • 🌐 Rule-based proxy routing — all client traffic passes through Mihomo (Clash Meta), which decides per-connection whether to go DIRECT or through a proxy
  • 🖥️ Two web UIs — manage WireGuard peers at :51821 and proxy rules/subscriptions at :51888/ui/ Perfect for self-hosting a VPN that exits through your proxy subscriptions, with fine-grained control over which traffic gets tunneled.

Quick Start

docker run -d \
  --name wg-gateway \
  --network host \
  --cap-add NET_ADMIN \
  --cap-add SYS_MODULE \
  --device /dev/net/tun \
  -e WG_HOST=YOUR_PUBLIC_IP \
  -e WG_EASY_INIT_PASSWORD=YOUR_ADMIN_PASSWORD \
  -v /path/to/wireguard:/data/wireguard \
  -v /path/to/mihomo:/data/mihomo \
  ksantd/wg-gateway:latest
See GitHub (https://github.com/sers88/wg-gateway) for full docs, docker-compose, and Unraid template.
What's inside
Component	Purpose
wg-easy v15	WireGuard server + peer management UI
Mihomo v1.19.25	Proxy/routing engine (TUN mode)
metacubexd v1.248.1	Modern web dashboard for Mihomo
Architecture
WireGuard Client → wg0 → Policy Routing → Mihomo TUN → PROXY or DIRECT → Internet
                          (table 666)
Only WireGuard client traffic enters the proxy engine — host traffic is unaffected.
Key features
Host networking — required for WireGuard kernel module + TUN device + policy routing
Policy routing — custom ip rule / ip route table isolates WG traffic to Mihomo TUN
Auto-restore — routing daemon re-applies rules if services restart
Unraid ready — includes Community Applications template
License
MIT. Bundles wg-easy (AGPL-3.0), Mihomo (GPL-3.0), metacubexd (MIT).

Tag summary

Content type

Image

Digest

sha256:09a58d7e5

Size

145.6 MB

Last updated

4 days ago

docker pull ksantd/wg-gateway:26.07.16.18.22