# qBittorrent-Auto-Port-Forward

qBittorrent-Auto-Port-Forward is a self-hosted automation app. A shell script and Docker container that automatically sets qBittorrent's listening port from a text file. It is open source and self-hosted, installable on Docker Hub and Unraid.

Canonical page: https://ourlocalhost.com/app/1343/qbittorrent-auto-port-forward

## Description

A shell script and Docker container that automatically sets qBittorrent's listening port from a text file. It is useful when your qBittorrent container is bound to a VPN client (such as WireGuard-PIA or Gluetun) that writes its forwarded port to a file, keeping your client reachable without manual port changes.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

44/100 (Fair), based on 4 of 5 factors.
- Maintained: 38 (last commit 349 days ago)
- Popular: 29 (27 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Security check: 85 (no serious findings, CI)

## Links

- Docker Hub: https://hub.docker.com/r/charlocharlie/qbittorrent-port-forward-file/
- Unraid: https://ca.unraid.net/apps/qbittorrent-auto-port-forward-0khohvl07ir46t?q=qBittorrent-Auto-Port-Forward

## Common questions

### How do I configure this for use with docker-wireguard-pia?

Set docker-wireguard-pia to output the forwarded port by using PORT_FORWARDING=1, PORT_PERSIST=1, and PORT_FILE=/pia/forwarded_port.txt. Then make that PIA directory available to this container so it can read the port file.

### How does the app connect to qBittorrent?

Set QBT_ADDR to the qBittorrent Web UI HTTP URL, including the port. Also set QBT_USERNAME and QBT_PASSWORD to the qBittorrent Web UI login credentials.

### What volume should I mount for the forwarded port file?

Mount the host directory containing the port file to /config in the container as read-only. Set PORT_FILE to the container-side path of that file, such as /config/forwarded_port.txt.

## Alternatives

- BiglyBT: Source for BiglyBT, a feature filled, open source, ad-free, bittorrent client.
- Deluge: Deluge is a lightweight, free-software, cross-platform BitTorrent client for downloading and managing torrent files.
- Free Download Manager: Accelerates downloads by splitting files, supports dark mode, controls traffic, enhances speed, organizes downloads, and is ad-free.
- LibreTorrent: LibreTorrent is a Free as in Freedom torrent client for Android 4 and later, based on libtorrent.
- Motrix: Motrix is a full-featured download manager that supports downloading HTTP, FTP, BitTorrent, Magnet, Baidu Net Disk, etc.
- Rapidbay: Rapid bay is a self hosted video service/torrent client that makes playing videos from torrents dead simple.
- Tixati: Tixati is a peer-to-peer file sharing program that uses the popular BitTorrent protocol.
- Transmission: Transmission is a BitTorrent client for downloading and sharing files over the BitTorrent protocol.
- aria2: Aria2 is a lightweight, multi-protocol, multi-source, cross-platform command-line download utility that retrieves files over HTTP/HTTPS, FT…
- gopeed: Gopeed is a free, open-source download manager that handles web links, torrents, magnet links, and ed2k downloads on desktop and mobile pla…
- qBittorrent: qBittorrent is a free, open-source BitTorrent client that provides a self-hosted web-based interface for downloading, managing, and schedul…
- µTorrent: Desktop client for large-scale torrent downloads, offering simultaneous downloads, bandwidth optimization, and scheduling.

---
Source: Our Local Host (https://ourlocalhost.com/app/1343/qbittorrent-auto-port-forward), the self-hosted and open-source app directory.
