Need help setting up Gluetun and qbittorrent with ProtonVPN

Hi, I have a older PC that I installed ZimaOS on that I want to make into a media server with Jellyfin. After seeing other people’s setups, I want to be able to add the ARR stack working with Gluetun and qbittorrent, but I’m having issues getting Gluetun to work. I’m using Proton as my VPN, but I’ve never set it up before, especially with a docker app. I’ve looked into different youtube tutorials, reddit threads, and forum posts trying to get my Gluetun to install properly, but it’s always greyed out and won’t open properly. I want to set this up right, and I want to understand what is happening. Please help…

For some details about what I have now, I’m using an AT&T modem that is using IP pass-through to a TP-Link router that is using Pi-hole on the ZimaOS PC. I have already excluded the ZimaOS PC from the Pi-hole in case that is effecting the setup.

If you use Hotio qBittorrent container you can have that embedded into Docker with built-in port forwarding logic. This is far cleaner than using Linux IO’s and I’ve been using it for years now without any problem.

  1. Does this get rid of the need for Gluetun?
  2. I’m guessing this needs me to set up a WireGuard Configuration, but I’m not seeing a space to put a private key. Does this need a configuration and private key?

Here’s a working example for gluetun/qBittorrent :

First, create two subfolders where your the compose file will sit : env/ and secrets/
In the secrets folder, you will save three files with your own (sensitive) informations :

  • secrets/wireguard_private_key.secret
  • secrets/bittorrent-user.secret
  • secrets/bittorrent-password.secret

Then, you save the two files below in the env folder (edit with your own informations of course) :

# qBittorrent.env
PUID: $(id -u)
PGID: $(id -g)
UMASK: 002
TZ: Europe/Paris
WEBUI_PORT: 9080
TORRENTING_PORT: 8694
# Bittorrent Port Forwarder
QBT_USERNAME: /run/secrets/bittorrent-user
QBT_PASSWORD: /run/secrets/bittorrent-passowrd
QBT_ADDR: http://gluetun:9080
GTN_ADDR: http://gluetun:8000
# gluetun.env
PUID: $(id -u)
PGID: $(id -g)
TZ: Europe/Paris
VPN_SERVICE_PROVIDER: protonvpn
VPN_TYPE: wireguard
VPN_PORT_FORWARDING_STATUS_FILE: ./gluetun/forwarded_port
UPDATER_PERIOD: 24h
DOT_PROVIDERS: cloudflare,google
PUBLICIP_API: ip2location
# Wireguard Settings : get these from your protonvpn account
WIREGUARD_PRIVATE_KEY: /run/secrets/wireguard_private_key
WIREGUARD_ADDRESSES: 10.2.0.2/32
SERVER_COUNTRIES: France
VPN_AUTO_PORT_FORWARD: true
# UNBLOCK:  # list urls that need unblocking here

Next, save the compose file below (again, edit with your own informations wherever it’s needed)

# docker-compose.yaml
services:
 # Gluetun - Manage VPN
 gluetun:
   image: qmcgaw/gluetun:latest
   container_name: gluetun
   hostname: gluetun
   cap_add:
     - NET_ADMIN
   restart: unless-stopped
   secrets:
     - wireguard_private_key
   env_file: ./env/gluetun.env
   volumes:
     - wireguard:/gluetun
   networks:
     - gluetun _network
   ports:
     - 8100:8000 # Remote Control VPN
     - 2648:2648/tcp # cross-seed
     - 9080:9080/tcp # qBit
     - 8694:8694/tcp # qBit
     - 6881:6881/udp # qBit
     - 8191:8191/tcp # flaresolverr
   devices:
     - /dev/net/tun:/dev/net/tun

 # Qbittorent - torrenting software
 qbittorrent:
   image: lscr.io/linuxserver/qbittorrent:latest
   container_name: qbittorrent
   network_mode: "service:gluetun"
   restart: unless-stopped
   secrets:
     - bittorrent-user
     - bittorrent-password
   env_file: ./env/qBittorrent.env
   volumes:
     - qbittorent:/config
     - torrents:/data/torrents
   healthcheck:
     test: curl -f http://localhost:9080 || exit 1
     interval: 10s
     timeout: 3s
     start_period: 60s
   depends_on:
     gluetun:
       condition: service_healthy
       restart: true

volumes:
 wireguard: {}
 qbittorent: {}
 torrents: {}
 
secrets:
 wireguard_private_key:
   file: ./secrets/wireguard_private_key.secret
 bittorrent-user:
   file: ./secrets/bittorrent-user.secret
 bittorrent-password:
   file: ./secrets/bittorrent-password.secret

networks:
 gluetun_network:
   name: gluetun_network
   driver: bridge
   attachable: true

At this point you should be ready to fire it all up :slight_smile:

PS : if you wish to have more services using gluetun’s network, you just need to add all the necessary ports to gluetun (usually the default ports are ok but always double-check as there could be some conflicts) and to tell your service(s) to use gluetun’s network (network_mode: “service:gluetun”).

Cheers, and happy torrenting :slight_smile:

Yes it does, it removes the need for Gluetun altogether. Check the link that I’ve previously shared, it supports 3 VPN providers you just gotta make sure you fill in the env variables.

I particularly use PIA and I only need to type in the user and password, no crazy wireguard files or keys need to be generated. It’s as easy as it gets. I believe that it’s pretty much the same way for Proton.

How would I be able to make the .secret file and put my information in those files, and how would I make the .env files? Using the ssh command line?

You could add their content inside your compose file but it is usually recommended to store sensitive informations and variables in separate files, which are basically text files that you can create using your “usual” editor of choice :slight_smile: