If by any chance you need to have your port open/active to be able to connect to both active and inactive peers while torrenting or need to do some port forwarding. Add these changes to the gluetun (VPN) and app of choice (qbittorrent) compose.yaml configurations:
Before you start making the changes, make sure to use the Stop & Inactive button for both, qbittorrent and gluetun compose.yaml configurations.
Gluetun compose.yaml changes:
environment:
- VPN_PORT_FORWARDING=on
- VPN_PORT_FORWARDING_PROVIDER=CHANGE_WITH_VPN_PROVIDER
- VPN_PORT_FORWARDING_STATUS_FILE=/gluetun/qbittorrent/port.txt
Please note that not all VPN providers allow port forwarding, At this time, only private internet access
or protonvpn
have port forwarding. Check the list here: gluetun-wiki/setup/advanced/vpn-port-forwarding.md at main · qdm12/gluetun-wiki · GitHub
At this time, I have not find a way to automatically update the forwarded port in qbittorrent. If someone knows how to, please let us know.
You will have to copy the port either from the /gluetun/qbittorrent/port.txt file or from the gluetun log in Dockge.
gluetun | 2024-10-20T21:51:10Z INFO [port forwarding] port forwarded is 496404
and paste it, either in the qbitorrent compose.yaml file or directly replacing the Listening Port (Port used for incoming connections) in qbittorrent > Settings/Options > Connection.
qbittorrent compose.yaml changes:
environment:
- TORRENTING_PORT=496404
Restart gluetun and qbittorrent.
To test the port is open, type the VPN IP and Port in here:
If having issues restarting qbittorrent make sure to use the Stop & Inactive button for both, qbittorrent and gluetun compose.yaml files.
I have tested this configuration found at the link below, but it did not worked for me:
environment:
- VPN_PORT_FORWARDING_LISTENING_PORT