WireGuard to Shadowsocks Tunnel — ready-to-use Docker setup for a site-to-site VPN
This repository contains a minimal, practical docker-compose configuration to run a WireGuard server behind a Shadowsocks tunnel.
It’s tested for stable site-to-site connections from a secured perimeter (country) through an overseas VPS.
This setup includes only the inside-country part. To use it, you also need another server abroad running Shadowsocks — this repo does not provide that, but you can find it in the official Shadowsocks project.
docker-compose.yml— main entry pointwireguard/— WireGuard Docker build contexttunnel/— Shadowsocks tunnel Docker build contextconfig/— stores generated WireGuard configs
-
Clone the repository
git clone https://github.com/zloom/ss-wg-tunnel.git cd ss-wg-tunnel -
Adjust environment variables
SERVER_HOST— your public IP for WireGuardPEER_COUNT— number of WireGuard clients to generateSS_SERVER— Shadowsocks server IPSS_PASSWORD— Shadowsocks passwordSS_PORT— Shadowsocks port
Edit these directly in
docker-compose.yml. -
Run
docker compose up --build -
Retrieve WireGuard configs
Generated configs will appear in the
./configfolder.
- Works best on Docker Desktop because of stricter network isolation.
- Designed for personal site-to-site tunnels with Shadowsocks as stealth transport.
- All parts except kernel WireGuard are written in Golang — I plan to merge them into a single binary later.
- For usage details and the full context, see the blog post.