A lightweight Docker container running sing-box with TUN interface for VLESS-Reality protocol.
Allows other containers to route traffic through the VPN without affecting the host system.
- Full TUN-based VPN inside Docker
- VLESS + Reality support (compatible with 3x-ui / X-UI panels)
- Simple
network_mode: service:vpn_servicesharing - Works on Docker Desktop for Windows / Linux
- Docker and Docker Compose
- Valid VLESS-Reality configuration from your 3x-ui panel
- Clone or create the project directory.
- Place your
sing-box.jsonconfiguration file in thedata/config/folder. - Start the services:
docker compose up -d- Verify the VPN is working:
docker logs vpn_service
docker logs other_containerThe other_container should display your VPS public IP.
You can also check it by opening http://localhost:8088.
To route any container through the VPN, add it with:
services:
your_service:
image: your-image
network_mode: service:vpn_service
depends_on:
- vpn_serviceNote: If your service needs to be accessible from the host, don't forget to expose the ports in the
vpn_servicesection (it acts as the network entrypoint).
- The container requires elevated privileges (
privileged: true) for TUN interface creation. - Works best on Docker Desktop (Windows) when run as Administrator.
- For production use, consider mounting configuration from a dedicated directory.
- Check
docker logs vpn_servicefor configuration errors. - Ensure UUID, Public Key, and Short ID in
sing-box.jsonare correct. - If TUN fails to create, verify Docker has necessary permissions.