# WG-EASY VPN Installation Guide (Docker Run) ## 📌 Overview This guide explains how to install and run **wg-easy (WireGuard VPN)** on a VPS using Docker. ------------------------------------------------------------------------ ## ⚙️ 1. Update System ``` bash apt update && apt upgrade -y ``` ------------------------------------------------------------------------ ## 🐳 2. Install Docker ``` bash apt install -y docker.io docker-compose systemctl enable docker systemctl start docker ``` Check Docker: ``` bash docker --version ``` ------------------------------------------------------------------------ ## 🔥 3. Open Required Ports ``` bash ufw allow 51820/udp ufw allow 51821/tcp ufw enable ``` ------------------------------------------------------------------------ ## 🚀 4. Run wg-easy ``` bash docker run -d \ --name=wg-easy \ -e WG_HOST=193.124.57.125 \ -e PASSWORD_HASH='$2a$12$TXjvDufTG5P4ef6k7M0F..3z7NekUPoHnaNyHnY9XHrSIlxG5nPyO' \ -e WG_DEFAULT_DNS=1.1.1.1,1.0.0.1 \ -v /etc/wireguard:/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 ``` ------------------------------------------------------------------------ ## 📊 5. Check Logs ``` bash docker logs -f wg-easy ``` Expected output: Server Listening on http://0.0.0.0:51821 ------------------------------------------------------------------------ ## 🌐 6. Access Web Interface Open in browser: http://193.124.57.125:51821 - Login password = your original password (not the hash) ------------------------------------------------------------------------ ## ⚠️ 7. Fix No Internet Issue If VPN connects but has no internet: ``` bash sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE ``` ------------------------------------------------------------------------ ## 💡 Notes - Default DNS: Cloudflare (1.1.1.1) - Make sure your VPS provider allows UDP traffic - Use strong password ------------------------------------------------------------------------ ## ✅ Done Your WireGuard VPN server is now ready 🎉