clmntbrd/qbittorrent-vpn

By clmntbrd

Updated about 2 years ago

Lightweight Docker container with qbittorrent and vpn

Image
Networking
Security
0

5.9K

clmntbrd/qbittorrent-vpn repository overview

docker-qbittorrent-vpn

Lightweight Docker container with qbittorrent and vpn

Based on the LinuxServer.io qBittorrent image.

This image allow to start an OpenVPN client before starting qBittorrent.

Version Tags

This image provides various versions that are available via tags. Please read the descriptions carefully and exercise caution when using unstable or development tags.

TagAvailableDescription
latestStable qbittorrent releases
devDevelopment image

Application Setup

The web UI is at <your-ip>:8080 and a temporary password for the admin user will be printed to the container log on startup.

You must then change username/password in the web UI section of settings. If you do not change the password a new one will be generated every time the container starts.

WEBUI_PORT variable

Due to issues with CSRF and port mapping, should you require to alter the port for the web UI you need to change both sides of the -p 8080 switch AND set the WEBUI_PORT variable to the new port.

For example, to set the port to 8090 you need to set -p 8090:8090 and -e WEBUI_PORT=8090

TORRENTING_PORT

A bittorrent client can be an active or a passive node. Running your client as an active node has the advantage of being able to connect to both active and passive peers, and can potentially increase the number of incoming connections. This requires an open port on the host machine which might differ from container's internal one.

Similarly to the WEBUI_PORT, to set the port to 6887 you need to pass -p 6887:6887, -p 6887:6887/udp and -e TORRENTING_PORT=6887 arguments to Docker.

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.

---
services:
  qbittorrent-vpn:
    image: clmntbrd/qbittorrent-vpn:latest
    container_name: qbittorrent-vpn
    cap_add:
      - NET_ADMIN
    dns:
      - 8.8.8.8
      - 8.8.4.4
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      - VPN_ENABLED=yes
      - LAN_NETWORK=192.168.1.0/24
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    volumes:
      - /path/to/qbittorrent-vpn/appdata:/config
      - /path/to/downloads:/downloads
    ports:
      - 8080:8080
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped

Parameters

Environment Variables
VariableRequiredFunctionExample
VPN_ENABLEDYesEnable VPN? (yes/no) Default:yesVPN_ENABLED=yes
VPN_USERNAMENoIf username and password provided, configures ovpn file automaticallyVPN_USERNAME=ad8f64c02a2de
VPN_PASSWORDNoIf username and password provided, configures ovpn file automaticallyVPN_PASSWORD=ac98df79ed7fb
LAN_NETWORKYesLocal Network with CIDR notationLAN_NETWORK=192.168.1.0/24
NAME_SERVERSNoComma delimited name serversNAME_SERVERS=8.8.8.8,8.8.4.4
PUIDNoUID applied to config files and downloadsPUID=99
PGIDNoGID applied to config files and downloadsPGID=100
WEBUI_PORTNoApplies WebUI port to qBittorrents config at boot (Must change exposed ports to match)WEBUI_PORT=8080
TORRENTING_PORTNoApplies Incoming port to qBittorrents config at boot (Must change exposed ports to match)TORRENTING_PORT=6881
OUTPUT_POLICYNoIf OUTPUT_POLICY = ACCEPT, the container wil not drop all IPv4 output traffic (usefull with some private trackers)OUTPUT_POLICY=ACCEPT
Volumes
VolumeRequiredFunctionExample
configYesqBittorrent and OpenVPN config files/your/config/path/:/config
downloadsNoDefault download path for torrents/your/downloads/path/:/downloads
Ports
PortProtoRequiredFunctionExample
8080TCPYesqBittorrent WebUI8080:8080
6881TCPYesqBittorrent listening port6881:6881
6881UDPYesqBittorrent listening port6881:6881/udp

How to use OpenVPN

The container will fail to boot if VPN_ENABLED is set to yes or empty and a .ovpn is not present in the /config/openvpn directory. Drop a .ovpn file from your VPN provider into /config/openvpn and start the container again. You may need to edit the ovpn configuration file to load your VPN credentials from a file by setting auth-user-pass.

Note: The script will use the first ovpn file it finds in the /config/openvpn directory. Adding multiple ovpn files will not start multiple VPN connections.

Example auth-user-pass option

auth-user-pass credentials.conf

Example credentials.conf
username
password

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Health check

You can add this in your docker-compose to add health check.

    restart: unless-stopped
    healthcheck:
      test: /etc/scripts/health.sh || exit 1
      interval: 40s
      timeout: 30s
      retries: 3
      start_period: 60s  

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose
  • Update images:

    • All images:

      docker-compose pull
      
    • Single image:

      docker-compose pull qbittorrent-vpn
      
  • Update containers:

    • All containers:

      docker-compose up -d
      
    • Single container:

      docker-compose up -d qbittorrent-vpn
      
  • You can also remove the old dangling images:

    docker image prune
    
Image Update Notifications - Diun (Docker Image Update Notifier)

tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Thanks & Credits

This project was inspired by LinuxServer.io and all their container.

For the OpenVPN part, this project was inspired by MarkusMcNugen/docker-qBittorrentvpn.

Tag summary

Content type

Image

Digest

sha256:ccd9d7c2a

Size

62.3 MB

Last updated

about 2 years ago

docker pull clmntbrd/qbittorrent-vpn