VPN Tactics

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.

Reviewed 2026-10-192 min read“synology nas docker vpn torrent container”How-to

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

Synology NAS · Container Managershared network namespaceqBittorrentweb UI :8080GluetunVPN + firewallVPN serverinternetYour browserNAS-IP:8080
Fig.qBittorrent shares Gluetun's network. If the VPN drops, torrent traffic has nowhere to go.

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:

compose.yaml
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-stopped

If 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