a simple script for qbittorrent meant to be used with Gluetun.
Getting VPN port forwarding set up when using containers can be a pain since the port number is dynamic. This script automatically updates the incoming port for qbittorrent based on the current forwarded port.
- gluetun should create a file called forwarded_port.
- that file should be passed to the PIA-port-forward container in a folder called pia. the container will exit if the environment variables are incorrect or if it cant access qbittorrent's api.
services:
gluetun:
image: qmcgaw/gluetun
...
environment:
...
- PORT_FORWARDING=on
- PORT_FORWARDING_STATUS_FILE=/gluetun/forwarded_port
volumes:
- ./gluetun:/gluetun
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
...
environment:
- WEBUI_PORT=8080
network_mode: service:gluetun
depends_on:
- gluetun
qbittorrent-gluetun-PIA-port-forward:
image: ghcr.io/robonau/qbittorrent-gluetun-pia-portforward:latest
environment:
- QBITTORRENT_URL=http://gluetun:8080
- QBITTORRENT_USERNAME=username
- QBITTORRENT_PASSWORD=password
volumes:
- ./gluetun:/pia:ro
depends_on:
- gluetun
- qbittorrent
restart: unless-stopped
- Make sure you're using a VPN region that supports port forwarding.