PIA + qBittorrent in Dockge help (25.04.2.4)

I feel like getting a VPN running for torrents should be the easiest fucking thing in the world but apparently not. With the amount of people using TrueNAS boxes for “linux iso’s” I’m astonished there isn’t a better solution for this. The only tutorials I’ve found for establishing a killswitch VPN for a torrent client involve custom apps or Dockge as outlined here.

I used a script to generate a .conf file for PIA since they apparently don’t give you one, but it’s missing the Preshared Key and MTU lines from the template. I dumped it into the config folder but there was no wiregaurd subfolder so I made one and created a wg0.conf file in both places. Still killswitch boot loops. I’d like to use wireguard. Please help!

My compose for Dockge is here:

services:
  qbittorrent:
    container_name: qbittorrent
    image: ghcr.io/hotio/qbittorrent
    restart: unless-stopped
    ports:
      - 8080:8080
    hostname: container-name.internal
    environment:
      - PUID=568
      - PGID=568
      - UMASK=002
      - TZ=America/New_York # adjust
      - WEBUI_PORTS=8080/tcp,8080/udp
      - VPN_ENABLED=true
      - VPN_CONF=wg0
      - VPN_PROVIDER=pia
      - VPN_LAN_NETWORK=192.168.1.0/24 # adjust
      - VPN_LAN_LEAK_ENABLED=false
      - VPN_EXPOSE_PORTS_ON_LAN=8080/tcp,8080/udp
      - VPN_AUTO_PORT_FORWARD=true
      - VPN_AUTO_PORT_FORWARD_TO_PORTS=43450/tcp # I have 43450 set in qbittorent
      - VPN_KEEP_LOCAL_DNS=false
      - VPN_FIREWALL_TYPE=auto
      - VPN_HEALTHCHECK_ENABLED=false
      - VPN_PIA_USER=removed # adjust
      - VPN_PIA_PASS=removed # adjust
      - VPN_PIA_PREFERRED_REGION=us_florida
      - VPN_PIA_DIP_TOKEN=no
      - VPN_PIA_PORT_FORWARD_PERSIST=true
      - PRIVOXY_ENABLED=false
      - UNBOUND_ENABLED=false
    volumes:
      - ./configs/qbittorrent/:/config # adjust
      - ${DOWNLOADS_PATH}:/Media # adjust DOWNLOADS_PATH=/mnt/pool/Downloads in the .env portion of dockge
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv6.conf.all.disable_ipv6=1
networks: {}

And in .env: DOWNLOADS_PATH=/mnt/Data/NAS/Media

Attempted to get this working with mullvad but see the config file has the same variables so don’t expect anything different. Not sure how to adjust the compose for that though.

Anyone have any luck with getting a VPN going for torrenting? This can’t be an uncommon issue…

Did you try this guide? It should be pretty easy to follow along

Yes, I used this guide but the problem really is just I don’t know what I’m doing. :upside_down_face: I added the paths to Dockge as “additional storage” for configs and the torrent downloads folder, and while the VPN appears to be working (checked with the sample torrent from ipleak.net), my test torrents error out. I check the qbittorrent log and found File error alert. Torrent: "Big Buck Bunny". File: "/mnt/Data/Media/Downloads/temp/Big Buck Bunny/Big Buck Bunny.mp4". Reason: "Big Buck Bunny file_open (/mnt/Data/Media/Downloads/temp/Big Buck Bunny/Big Buck Bunny.mp4) error: Permission denied"
Dockge has access to that dataset as best I can tell so I have no idea why its erroring out like that. Also, I’d really prefer to be using wireguard but haven’t yet attempted that. Also I’ve heard of some people having issues with Gluetun and found this but have not tried to figure that out yet.

Did you check if user 568 has the correct permissions set on the mountpaths, and if user 568 has permissions on the toplvl datases as well? If you’ve only set permissions on the child dataset but not on the datase one level above, user 568 can’t traverse the datasets and it will error out.

I don’t have a user with the UID 568 in credentials?



Don’t know what I’m doing wrong. Originally I had granted it to the full path /mnt/Data/Media/Downloads but changing it to /mnt/Data did not help.

build in users are hidden by default, there should be a slide button on the top right corner “show build-in users”

ah thats just the apps thing yea that should be set right…

This works fine with the native qbittorrent app. Just wont work inside Dockge