Synology NAS: Run qBittorrent Behind a VPN Container (Gluetun + Container Manager)
A Container Manager project that routes only your torrent client through a VPN on Synology DSM 7.2+, with a built-in kill switch.
The short answer
- 1.Gluetun is a VPN client container; qBittorrent joins its network, so it physically can't reach the internet without the tunnel.
- 2.On DSM 7.2 use Container Manager → Project and paste a compose file.
- 3.The rest of the NAS (backups, Plex, DSM updates) keeps using your normal connection.
How the stack fits together
The compose file
Create a shared folder like /docker/torrent, then in Container Manager → Project → Create, paste this and fill in the values from your provider:
services:
gluetun:
image: qmcgaw/gluetun
cap_add: [NET_ADMIN]
devices: ["/dev/net/tun:/dev/net/tun"]
environment:
- VPN_SERVICE_PROVIDER=your_provider
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=xxxxx
- WIREGUARD_ADDRESSES=10.64.0.2/32
- SERVER_COUNTRIES=Netherlands
- TZ=Europe/Amsterdam
ports:
- 8080:8080 # qBittorrent web UI
restart: unless-stopped
qbittorrent:
image: lscr.io/linuxserver/qbittorrent
network_mode: "service:gluetun"
environment:
- PUID=1026
- PGID=100
- WEBUI_PORT=8080
volumes:
- /volume1/docker/torrent/config:/config
- /volume1/downloads:/downloads
depends_on: [gluetun]
restart: unless-stoppedIf Gluetun won't start
- →'/dev/net/tun not found': some DSM versions need the tun module loaded at boot via a Task Scheduler script running 'insmod /lib/modules/tun.ko'.
- →Check the Gluetun log in Container Manager — it prints the public IP once connected.
- →Inside qBittorrent, set the network interface to 'tun0' as a second safety net.
Questions people also ask
+Does this need port forwarding?
No, but seeding is much better with it. See our port forwarding guides for providers that support it.
+Can I use Synology's built-in VPN client instead?
That routes the whole NAS through the VPN, which can break remote access and updates. The container approach isolates it.
Provider features, prices and streaming compatibility change often. We don't run lab benchmarks; confirm details on the provider's own site before buying. Read our responsible-use stance.
Keep reading
Proton VPN vs Mullvad for qBittorrent Port Forwarding
Mullvad removed port forwarding in 2023; Proton VPN supports it via NAT-PMP. How to set it up for qBittorrent and what each does well.
ExpressVPN Alternatives With Port Forwarding for Torrenting
ExpressVPN doesn't offer port forwarding. Which providers do, how it improves seeding and what to check before switching.