2018-02-05 06:39:32 +00:00
[preview]: https://raw.githubusercontent.com/MarkusMcNugen/docker-templates/master/qbittorrentvpn/Screenshot.png "qBittorrent Preview"
2018-02-03 01:11:35 +00:00
2016-02-25 03:07:54 +00:00
# qBittorrent with WebUI and OpenVPN
2018-04-08 23:02:55 +00:00
Docker container which runs the latest headless qBittorrent client with WebUI while connecting to OpenVPN with iptables killswitch to prevent IP leakage when the tunnel goes down. This is an automated build linked with Ubuntu.
2014-11-09 15:23:18 +00:00
2018-02-05 06:39:32 +00:00
![alt text][preview]
2018-02-11 21:48:30 +00:00
## Docker Features
2018-02-11 21:43:02 +00:00
* Base: Ubuntu 18.04
2018-04-16 05:50:49 +00:00
* Latest qBittorrent
2018-04-06 10:10:04 +00:00
* Size: 403MB
2018-02-11 21:43:02 +00:00
* Selectively enable or disable OpenVPN support
* IP tables kill switch to prevent IP leaking when VPN connection fails
* Specify name servers to add to container
2018-10-07 03:28:12 +00:00
* Configure UID, GID, and UMASK for config files and downloads by qBittorrent
2018-10-07 03:14:03 +00:00
* WebUI\CSRFProtection set to false by default for Unraid users
2018-02-11 21:43:02 +00:00
2018-02-11 21:52:40 +00:00
# Run container from Docker registry
2015-09-10 20:37:03 +00:00
The container is available from the Docker registry and this is the simplest way to get it.
To run the container use this command:
2014-11-09 15:55:18 +00:00
2014-11-16 14:18:02 +00:00
```
2015-05-09 17:22:07 +00:00
$ docker run --privileged -d \
2019-12-30 19:50:37 +00:00
-v /your/qBittorrent/path/:/config/qBittorrent \
-v /your/openvpn/client.conf:/config/client.ovpn \
2018-02-03 00:59:48 +00:00
-v /your/downloads/path/:/downloads \
2018-02-03 12:17:48 +00:00
-e "VPN_ENABLED=yes" \
2018-02-03 04:40:49 +00:00
-e "LAN_NETWORK=192.168.1.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
2018-02-03 00:59:48 +00:00
-p 8080:8080 \
2018-02-03 04:40:49 +00:00
-p 8999:8999 \
2018-02-05 06:25:42 +00:00
-p 8999:8999/udp \
2018-02-03 00:59:48 +00:00
markusmcnugen/qbittorrentvpn
2015-05-09 17:22:07 +00:00
```
2015-05-10 20:25:43 +00:00
2018-04-07 18:51:20 +00:00
# Variables, Volumes, and Ports
2018-02-11 21:43:02 +00:00
## Environment Variables
2018-02-05 06:29:56 +00:00
| Variable | Required | Function | Example |
2018-02-04 04:13:02 +00:00
|----------|----------|----------|----------|
2018-04-06 10:11:16 +00:00
|`VPN_ENABLED`| Yes | Enable VPN? (yes/no) Default:yes|`VPN_ENABLED=yes`|
2019-12-30 19:50:37 +00:00
|`VPN_CONFIG`| No | Path to OpenVPN config file. Default: /config/client.ovpn| `VPN_CONFIG=/config/client.conf`
2018-05-01 01:26:15 +00:00
|`VPN_USERNAME`| No | If username and password provided, configures ovpn file automatically |`VPN_USERNAME=ad8f64c02a2de`|
|`VPN_PASSWORD`| No | If username and password provided, configures ovpn file automatically |`VPN_PASSWORD=ac98df79ed7fb`|
2018-02-04 04:24:42 +00:00
|`LAN_NETWORK`| Yes | Local Network with CIDR notation |`LAN_NETWORK=192.168.1.0/24`|
2018-02-04 04:13:02 +00:00
|`NAME_SERVERS`| No | Comma delimited name servers |`NAME_SERVERS=8.8.8.8,8.8.4.4`|
2018-02-04 04:19:50 +00:00
|`PUID`| No | UID applied to config files and downloads |`PUID=99`|
|`PGID`| No | GID applied to config files and downloads |`PGID=100`|
2018-10-07 03:33:00 +00:00
|`UMASK`| No | GID applied to config files and downloads |`UMASK=002`|
2018-05-01 01:27:47 +00:00
|`WEBUI_PORT_ENV`| No | Applies WebUI port to qBittorrents config at boot (Must change exposed ports to match) |`WEBUI_PORT_ENV=8080`|
|`INCOMING_PORT_ENV`| No | Applies Incoming port to qBittorrents config at boot (Must change exposed ports to match) |`INCOMING_PORT_ENV=8999`|
2015-05-09 19:49:07 +00:00
2018-02-11 21:43:02 +00:00
## Volumes
2018-02-05 06:29:56 +00:00
| Volume | Required | Function | Example |
2018-02-04 04:30:20 +00:00
|----------|----------|----------|----------|
2019-12-30 19:50:37 +00:00
| `qBittorrent` | Yes | qBittorrent and OpenVPN config files | `/your/config/path/:/config/qBittorrent` |
| `client.ovpn` | No | OpenVPN config file if `VPN_ENABLED=yes` | `/your/openvpn/client.conf:/config/client.ovpn` |
2018-02-04 04:38:02 +00:00
| `downloads` | No | Default download path for torrents | `/your/downloads/path/:/downloads` |
2018-02-11 21:43:02 +00:00
## Ports
2018-02-05 06:29:56 +00:00
| Port | Proto | Required | Function | Example |
|----------|----------|----------|----------|----------|
2018-02-05 06:29:23 +00:00
| `8080` | TCP | Yes | qBittorrent WebUI | `8080:8080` |
2018-02-09 01:50:03 +00:00
| `8999` | TCP | Yes | qBittorrent listening port | `8999:8999` |
| `8999` | UDP | Yes | qBittorrent listening port | `8999:8999/udp` |
2018-02-04 04:30:20 +00:00
2018-02-11 21:52:40 +00:00
# Access the WebUI
2018-05-01 01:52:59 +00:00
Access http://IPADDRESS:PORT from a browser on the same network.
2014-11-09 15:55:18 +00:00
2018-02-11 21:52:40 +00:00
## Default Credentials
2018-02-03 04:57:50 +00:00
| Credential | Default Value |
|----------|----------|
2018-05-01 01:49:56 +00:00
|`WebUI Username`| admin |
|`WebUI Password`| adminadmin |
2018-10-07 03:10:44 +00:00
## Origin header & Target origin mismatch
WebUI\CSRFProtection must be set to false in qBittorrent.conf if using an unconfigured reverse proxy or forward request within a browser. This is the default setting unless changed. This file can be found in the dockers config directory in /qBittorrent/config
2018-05-01 01:49:56 +00:00
## WebUI: Invalid Host header, port mismatch
2018-05-01 01:51:42 +00:00
qBittorrent throws a [WebUI: Invalid Host header, port mismatch ](https://github.com/qbittorrent/qBittorrent/issues/7641#issuecomment-339370794 ) error if you use port forwarding with bridge networking due to security features to prevent DNS rebinding attacks. If you need to run qBittorrent on different ports, instead edit the WEBUI_PORT_ENV and/or INCOMING_PORT_ENV variables AND the exposed ports to change the native ports qBittorrent uses.
2018-02-03 04:46:02 +00:00
2018-02-11 21:52:40 +00:00
# How to use OpenVPN
2018-02-05 03:07:45 +00:00
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` .
2018-02-03 16:25:44 +00:00
2018-02-05 06:36:03 +00:00
**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.
2018-02-11 21:52:40 +00:00
## Example auth-user-pass option
2018-02-03 16:25:44 +00:00
`auth-user-pass credentials.conf`
2018-02-11 21:52:40 +00:00
## Example credentials.conf
2018-04-06 10:10:04 +00:00
```
username
2018-02-03 16:25:44 +00:00
password
2018-04-06 10:10:04 +00:00
```
2018-02-03 16:25:44 +00:00
2018-02-03 04:57:50 +00:00
## PUID/PGID
2018-02-05 07:16:02 +00:00
User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as:
2018-02-03 04:44:27 +00:00
```
id < username >
```
2015-08-15 23:45:53 +00:00
2018-02-11 21:52:40 +00:00
# Issues
2015-09-10 20:37:03 +00:00
If you are having issues with this container please submit an issue on GitHub.
2016-02-09 20:55:20 +00:00
Please provide logs, docker version and other information that can simplify reproducing the issue.
2015-09-10 20:37:03 +00:00
Using the latest stable verison of Docker is always recommended. Support for older version is on a best-effort basis.
2015-08-15 23:45:53 +00:00
2018-02-11 21:52:40 +00:00
# Building the container yourself
2015-08-15 23:45:53 +00:00
To build this container, clone the repository and cd into it.
2018-02-11 21:52:40 +00:00
## Build it:
2015-08-15 23:45:53 +00:00
```
2018-02-03 01:50:54 +00:00
$ cd /repo/location/qbittorrentvpn
$ docker build -t qbittorrentvpn .
2015-08-15 23:45:53 +00:00
```
2018-02-11 21:52:40 +00:00
## Run it:
2015-08-15 23:45:53 +00:00
```
$ docker run --privileged -d \
2019-12-30 19:50:37 +00:00
-v /your/qBittorrent/path/:/config/qBittorrent \
-v /your/openvpn/client.conf:/config/client.ovpn \
2018-02-03 01:50:54 +00:00
-v /your/downloads/path/:/downloads \
2018-02-05 06:24:25 +00:00
-e "VPN_ENABLED=yes" \
2018-02-03 04:40:49 +00:00
-e "LAN_NETWORK=192.168.1.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
2018-02-03 01:50:54 +00:00
-p 8080:8080 \
2018-02-03 04:40:49 +00:00
-p 8999:8999 \
2018-02-05 06:25:42 +00:00
-p 8999:8999/udp \
2018-02-03 01:50:54 +00:00
qbittorrentvpn
2015-08-15 23:45:53 +00:00
```
2016-02-09 20:55:20 +00:00
This will start a container as described in the "Run container from Docker registry" section.