107 lines
4.1 KiB
Markdown
Raw Permalink Normal View History

2018-02-05 01:39:32 -05:00
[preview]: https://raw.githubusercontent.com/MarkusMcNugen/docker-templates/master/qbittorrentvpn/Screenshot.png "qBittorrent Preview"
2018-02-02 20:11:35 -05:00
2016-02-24 22:07:54 -05:00
# qBittorrent with WebUI and OpenVPN
2018-02-07 17:41:38 -05:00
Docker container which runs a headless qBittorrent v4.3 client with WebUI while connecting to OpenVPN with iptables killswitch to prevent IP leakage when the tunnel goes down.
2018-02-05 01:39:32 -05:00
![alt text][preview]
2015-05-24 21:09:00 +02:00
## Run container from Docker registry
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 16:55:18 +01:00
```
2015-05-09 19:22:07 +02:00
$ docker run --privileged -d \
2018-02-03 23:38:02 -05:00
-v /your/config/path/:/config \
2018-02-02 19:59:48 -05:00
-v /your/downloads/path/:/downloads \
2018-02-03 07:17:48 -05:00
-e "VPN_ENABLED=yes" \
2018-02-02 23:40:49 -05:00
-e "LAN_NETWORK=192.168.1.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
2018-02-02 23:41:30 -05:00
-e "PUID=99" \
-e "PGID=100" \
2018-02-02 19:59:48 -05:00
-p 8080:8080 \
2018-02-02 23:40:49 -05:00
-p 8999:8999 \
2018-02-05 01:25:42 -05:00
-p 8999:8999/udp \
2018-02-02 19:59:48 -05:00
markusmcnugen/qbittorrentvpn
2015-05-09 19:22:07 +02:00
```
2015-05-10 22:25:43 +02:00
2018-02-03 11:25:44 -05:00
### Environment Variables
2018-02-05 01:29:56 -05:00
| Variable | Required | Function | Example |
2018-02-03 23:13:02 -05:00
|----------|----------|----------|----------|
|`VPN_ENABLED`| Yes | Enable VPN? (yes\|no) Default:yes|`VPN_ENABLED=yes`|
2018-02-03 23:24:42 -05:00
|`LAN_NETWORK`| Yes | Local Network with CIDR notation |`LAN_NETWORK=192.168.1.0/24`|
2018-02-03 23:13:02 -05:00
|`NAME_SERVERS`| No | Comma delimited name servers |`NAME_SERVERS=8.8.8.8,8.8.4.4`|
2018-02-03 23:19:50 -05:00
|`PUID`| No | UID applied to config files and downloads |`PUID=99`|
|`PGID`| No | GID applied to config files and downloads |`PGID=100`|
2018-02-03 23:30:20 -05:00
### Volumes
2018-02-05 01:29:56 -05:00
| Volume | Required | Function | Example |
2018-02-03 23:30:20 -05:00
|----------|----------|----------|----------|
2018-02-03 23:38:02 -05:00
| `config` | Yes | qBittorrent and OpenVPN config files | `/your/config/path/:/config`|
| `downloads` | No | Default download path for torrents | `/your/downloads/path/:/downloads`|
### Ports
2018-02-05 01:29:56 -05:00
| Port | Proto | Required | Function | Example |
|----------|----------|----------|----------|----------|
2018-02-05 01:29:23 -05:00
| `8080` | TCP | Yes | qBittorrent WebUI | `8080:8080`|
| `8999` | TCP | Yes | Default download path for torrents | `8999:8999`|
| `8999` | UDP | Yes | Default download path for torrents | `8999:8999/udp`|
2018-02-03 23:30:20 -05:00
2018-02-02 23:57:50 -05:00
## Access the WebUI
2018-02-02 23:46:02 -05:00
Access http://IPADDRESS:8080 from a browser on the same network.
2014-11-09 16:55:18 +01:00
2018-02-03 11:25:44 -05:00
### Default Credentials
2018-02-02 23:57:50 -05:00
| Credential | Default Value |
|----------|----------|
|`WebUI Username`|admin |
|`WebUI Password`|adminadmin |
2018-02-02 23:46:02 -05:00
2018-02-03 11:25:44 -05:00
## How to use OpenVPN
2018-02-04 22:07:45 -05: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 11:25:44 -05:00
2018-02-05 01:36:03 -05: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-03 11:25:44 -05:00
### Example auth-user-pass option
`auth-user-pass credentials.conf`
### Example credentials.conf
2018-02-04 22:07:45 -05:00
username<br>
2018-02-03 11:25:44 -05:00
password
2018-02-02 23:57:50 -05:00
## PUID/PGID
2018-02-05 02:16:02 -05: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-02 23:44:27 -05:00
```
id <username>
```
2015-08-16 01:45:53 +02:00
2018-02-02 23:57:50 -05:00
## Issues
If you are having issues with this container please submit an issue on GitHub.
2016-02-09 18:55:20 -02:00
Please provide logs, docker version and other information that can simplify reproducing the issue.
Using the latest stable verison of Docker is always recommended. Support for older version is on a best-effort basis.
2015-08-16 01:45:53 +02:00
## Building the container yourself
To build this container, clone the repository and cd into it.
### Build it:
```
2018-02-02 20:50:54 -05:00
$ cd /repo/location/qbittorrentvpn
$ docker build -t qbittorrentvpn .
2015-08-16 01:45:53 +02:00
```
### Run it:
```
$ docker run --privileged -d \
2018-02-03 23:38:02 -05:00
-v /your/config/path/:/config \
2018-02-02 20:50:54 -05:00
-v /your/downloads/path/:/downloads \
2018-02-05 01:24:25 -05:00
-e "VPN_ENABLED=yes" \
2018-02-02 23:40:49 -05:00
-e "LAN_NETWORK=192.168.1.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
2018-02-02 23:41:30 -05:00
-e "PUID=99" \
-e "PGID=100" \
2018-02-02 20:50:54 -05:00
-p 8080:8080 \
2018-02-02 23:40:49 -05:00
-p 8999:8999 \
2018-02-05 01:25:42 -05:00
-p 8999:8999/udp \
2018-02-02 20:50:54 -05:00
qbittorrentvpn
2015-08-16 01:45:53 +02:00
```
2016-02-09 18:55:20 -02:00
This will start a container as described in the "Run container from Docker registry" section.