---
title: qBittorrent
description: Quick overview of qBittorrent and setup
date: 2025-02-04
lastmod: 2025-02-04
author: wompmacho
showHero: false # needed to hide "hero banner"
---

## What is qBittorrent?

`qBittorrent` is a awesome, simple app that allows you to use classic QBittorrent in a docker
container. I use QBittorrent because I can set it up with a VPN that only
connects via the container directly. Effectively separating it from the rest of
my network and allowing me to continue as normal while it is downloading. It
will automatically stop the network if the VPN is not functioning correctly. 

## Docker Compose Example

``` yaml
# qbittorrentvpn - docker compose
# https://hub.docker.com/r/dyonr/qbittorrentvpn
---
version: "2"
services :
  qbittorrentvpn:
    container_name: qbittorrentvpn
    privileged: true
    image: dyonr/qbittorrentvpn
    environment :
      - VPN_ENABLED=true
      - VPN_USERNAME=VPN_USERNAME
      - VPN_PASSWORD=VPN_PASSWORD
      - LAN_NETWORK=10.0.0.0/24
      - WEBUI_PORT_ENV=8080
      - INCOMING_PORT_ENV=8999
    ports :
      - 8080:8080
      - 8999:8999
      - 8999:8999/udp	
    volumes :
      - /app/QBittorrent/config:/config
      - /mnt/store/MediaServer/torrent:/downloads	
    restart: unless-stopped
```
To set up the VPN you will need to have an existing account with a VPN service.
Username & Password for the vpn will be provided as a key by your vpn service.
In my case I use Surfshark and have to go log into my account, navigate to the
linux setup page and grab my generated Username key and Password key there.

A credentials file on my docker host was generated by QBittorrent when running
the first time. 
```
# download all availble server conf
sudo wget https://my.surfshark.com/vpn/api/v1/server/configurations

# cp the server you want to use into config folder
/app/QBittorrent/config/openvpn 
```

Once you restart your qbittorrentvpn docker container you can test your vpn
service with a torrent leak test. Use the + add torrent link button to Download
the torrent and test that your VPN service is connected and working.

- [torrent-leak-test](https://bash.ws/torrent-leak-test)

### Magnet links

Use magnet link and item hash to avoid logins

```
magnet:?xt=urn:btih:${HASH}
```