Back to Blog
Guide
9 min readOct 31, 2026

qBittorrent with Proton VPN: Port Forwarding Setup, Docker and Firewalled Fixes

Set up qBittorrent with Proton VPN: P2P servers, port forwarding, the right qBittorrent settings, binding the interface, auto-updating the random port on Linux and Docker (Gluetun), and fixing firewalled or stalled torrents.

Quick Answer

On a paid Proton VPN plan, connect to a P2P server and turn on Port forwarding in the app. In qBittorrent, go to Tools → Options → Connection, enter Proton’s port in “Port used for incoming connections”, and untick UPnP / NAT-PMP. Under Advanced, bind the network interface to the Proton adapter. Proton’s port is random and usually changes when you reconnect, so update qBittorrent each time, or automate it on Linux or with Gluetun in Docker.

To use qBittorrent with Proton VPN at full speed, connect to a P2P server on a paid plan, turn on port forwarding in the Proton app, and type the port it shows into qBittorrent’s Port used for incoming connections. Untick UPnP / NAT-PMP, and bind qBittorrent to the Proton network interface so it stops downloading if the VPN drops.

The one catch: Proton gives you a random port that usually changes when you reconnect. If qBittorrent still has the old port, it shows firewalled and finds fewer peers. This guide covers the manual setup on Windows and macOS, an automatic port sync on Linux, a Docker setup with Gluetun, and the fixes for firewalled and stalled torrents.

Before you start

What You Need

Proton planAny paid plan. The free plan has no P2P servers or port forwarding
ServerA P2P server (double-arrow icon)
Proton settingPort forwarding on; Moderate NAT off (the two cannot run together)
Apps with port forwardingWindows, Linux, macOS (early access); manual WireGuard/OpenVPN elsewhere
qBittorrent settingsListening port = Proton’s port, UPnP/NAT-PMP off, bound to the Proton interface

qBittorrent Proton VPN Setup (Windows and macOS): 6 Steps

  1. 1

    Connect to a P2P server

    Windows: Countries → P2P tab → connect. macOS: pick a server with the P2P icon. Port forwarding only works on P2P servers.

  2. 2

    Turn on port forwarding

    Windows: click Port forwarding in the right sidebar, switch it on and click Apply. macOS: click the Port forwarding shortcut and choose On. Note the port number the app shows.

  3. 3

    Enter the port in qBittorrent

    Tools → Options → Connection. Type Proton’s number into “Port used for incoming connections” and untick “Use different port on each startup”.

  4. 4

    Untick UPnP / NAT-PMP

    In the same tab, untick “Use UPnP / NAT-PMP port forwarding from my router”. Proton says it can conflict with the VPN’s own port mapping.

  5. 5

    Bind to the Proton interface

    Tools → Options → Advanced → Network interface: choose the Proton adapter (on Windows it is named ProtonVPN), and set “Optional IP address to bind to” to All addresses. qBittorrent then cannot leak traffic outside the tunnel.

  6. 6

    Restart qBittorrent and check the icon

    The connection icon in the status bar should turn into a green globe within a few minutes of an active torrent. A flame icon means firewalled; see the fixes below.

Testing the port: Proton notes that online checkers test the VPN server’s IP and only show “open” while qBittorrent is running and listening on that port. Your home IP will stay closed, which is correct.

More on what each qBittorrent setting does: qBittorrent port forwarding and binding qBittorrent to a VPN.

The random port

When the Proton Port Changes

Proton’s server picks the port, and it usually changes after a reconnect, a server switch or a sleep cycle. On Windows and macOS, check the number in the app after every reconnect and update qBittorrent if it differs. On Linux, the Proton app writes the active port to /run/user/$UID/Proton/VPN/forwarded_port, so a small script can keep qBittorrent in sync:

Linux: sync qBittorrent with the Proton app
#!/bin/sh
# Keeps qBittorrent's listening port in sync with the Proton VPN Linux app.
# Needs the qBittorrent Web UI on port 8080 with "Bypass authentication for clients on localhost" ticked.
PORT_FILE="/run/user/$(id -u)/Proton/VPN/forwarded_port"
LAST=""
while true; do
  PORT=$(cat "$PORT_FILE" 2>/dev/null)
  if [ -n "$PORT" ] && [ "$PORT" != "$LAST" ]; then
    curl -s --data "json={\"listen_port\":$PORT,\"upnp\":false,\"random_port\":false}" \
      http://127.0.0.1:8080/api/v2/app/setPreferences && LAST="$PORT" && echo "qBittorrent port set to $PORT"
  fi
  sleep 30
done

Turn on the Web UI first (Tools → Options → Web UI) and tick “Bypass authentication for clients on localhost”. Run the script at login, for example as a systemd user service.

Headless Linux or a Manual WireGuard Config

Without the Proton app, generate a WireGuard config for a P2P server with NAT-PMP (port forwarding) ticked, or add +pmp to your OpenVPN username. Then request the port with natpmpc (version 20230423 or newer) and keep renewing it, because the mapping expires after 60 seconds:

Proton’s natpmpc renewal loop
# Manual WireGuard/OpenVPN connection to a Proton P2P server (NAT-PMP enabled)
while true ; do date ; natpmpc -a 1 0 udp 60 -g 10.2.0.1 && natpmpc -a 1 0 tcp 60 -g 10.2.0.1 || { echo -e "ERROR with natpmpc command \a" ; break ; } ; sleep 45 ; done

The output prints the public port; put it in qBittorrent. Closing the terminal stops the loop and the port closes a minute later, so run it as a service. Background on the protocol: what NAT-PMP is.

qBittorrent + Proton VPN in Docker (Gluetun)

Gluetun has Proton port forwarding built in and can push each new port straight into qBittorrent through its Web UI API. PORT_FORWARD_ONLY=on limits Gluetun to P2P servers, and the up-command sets the port and network interface every time the port changes:

docker-compose.yml
services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8080:8080 # qBittorrent Web UI
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=your_proton_wireguard_key # config generated with NAT-PMP on
      - SERVER_COUNTRIES=Netherlands
      - PORT_FORWARD_ONLY=on
      - VPN_PORT_FORWARDING=on
      - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'wget -O- -nv --retry-connrefused --post-data "json={\"listen_port\":{{PORT}},\"current_network_interface\":\"{{VPN_INTERFACE}}\",\"random_port\":false,\"upnp\":false}" http://127.0.0.1:8080/api/v2/app/setPreferences'
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent
    network_mode: service:gluetun
    environment:
      - WEBUI_PORT=8080
    volumes:
      - ./config:/config
      - ./downloads:/downloads

In qBittorrent’s Web UI settings, tick “Bypass authentication for clients on localhost” so Gluetun can reach the API. TrueNAS, Unraid and Synology users can use the same two containers. Full walkthroughs: Gluetun port forwarding and qBittorrent VPN in Docker.

Troubleshooting

qBittorrent Firewalled or Stalled on Proton VPN

Firewalled after a reconnect

The port changed. Copy the new number from the Proton app into qBittorrent, or automate it with the Linux script or Gluetun.

Firewalled from the start

Check you are on a P2P server, port forwarding is on, and Moderate NAT is off: Proton cannot run Moderate NAT and port forwarding together.

Port shows closed in a checker

Test while a torrent is active and qBittorrent is listening. The checker must test the VPN IP, not your home IP.

Stalled with no peers

qBittorrent is bound to an interface that no longer exists, often after the adapter name changed. Re-select the Proton interface under Advanced → Network interface.

No downloads when the VPN is off

That is the binding working as intended: qBittorrent will not use your normal connection. Reconnect Proton first.

Slow even when connectable

Pick a P2P server nearer to you, try WireGuard, and check that the torrent has enough seeds. Proton’s own load per server is shown in the app.

Deeper fixes: qBittorrent firewalled, qBittorrent stalled, qBittorrent slow download.

Not on Proton yet?

Proton VPN or PureVPN for qBittorrent

For torrenting, one forwarded port is all qBittorrent needs, so Proton’s included port forwarding is usually enough. If you would rather never update the port, PureVPN can forward a port number you choose, at the cost of a paid add-on.

Port forwarding on all paid plans

Proton VPN

P2P servers in many countries, one forwarded port with no add-on, and a Linux port file that makes automation easy.
  • Port forwarding included with every paid plan
  • P2P servers marked in the app
  • Native Gluetun support for Docker setups
  • 30-day money-back guarantee
−75%
Black Friday

2-year plan

Fixed port of your choice

PureVPN

The port forwarding add-on opens the exact port you set in qBittorrent, so it does not change when you reconnect.
  • Choose the port number yourself
  • Up to 15 specific ports, or all ports
  • Paid add-on on top of the plan
  • 31-day money-back guarantee
−87%
Black Friday

5-year plan·$1.69/mo $12.95/mo

This page contains affiliate links. If you sign up through them, NAT Checker may earn a commission at no extra cost to you.

How PureVPN’s add-on works: PureVPN port forwarding. NordVPN users cannot forward ports; see qBittorrent with NordVPN.

Related Torrent Guides

Sources (checked October 31, 2026):

qBittorrent with Proton VPN FAQ

Yes. Every paid Proton VPN plan includes port forwarding on P2P servers, in the Windows and Linux apps and in early access on macOS. Turn it on in the app and enter the port it shows in qBittorrent.

Not properly. The free plan does not include P2P servers or port forwarding, so torrenting is not supported there. You need a paid plan such as VPN Plus.

Share this article