Headless qBittorrent Over I2P With Docker
Since I’d like to use a newer version of qBittorrent (>4.6) than is available in the Debian repos (4.5), I have to use the Docker install. If you don’t care about I2P, you can install without Docker - there is a good tutorial in [https://github.com/qbittorrent/qBittorrent/wiki/Running-qBittorrent-without-X-server-(WebUI-only,-systemd-service-set-up,-Ubuntu-15.04-or-newer)](https://github.com/qbittorrent/qBittorrent/wiki/Running-qBittorrent-without-X-server-(WebUI-only,-systemd-service-set-up,-Ubuntu-15.04-or-newer))
Here, I’ll be using docker compose, with a tutorial in https://github.com/qbittorrent/docker-qbittorrent-nox.
First, download the github repo: git clone qbittorrent-nox
. You then have to edit the .env
file: vim docker-qbittorrent-nox/.env
and edit the variables accordingly - if you want to use I2P mode, you need to use version 4.6.x.
If we want our instance to be available from the internet, we should create an nginx reverse proxy and use certbot to set up HTTPS.
Create the configuration file /etc/nginx/sites-available/qbittorrent
.
server {
listen 80;
server_name qbittorrent.example.com;
#access_log /var/log/nginx/access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:8080; # change it to a different port if non-default is used
proxy_read_timeout 90;
proxy_redirect http://127.0.0.1:8080 https://qbittorrent.example.com;
}
}
Now you need to configure certbot by sudo certbot -d qbittorrent.example.com --nginx
To log in, you’ll need to get a temporary password from the standard output of the docker container. Execute this command and you’ll get something like this:
$ sudo docker logs qbittorrent-nox
WebUI will be started shortly after internal preparations. Please wait...
******** Information ********
To control qBittorrent, access the WebUI at: http://localhost:8080
The WebUI administrator username is: admin
The WebUI administrator password was not set. A temporary password is provided for this session: qdTdGyRH8
You should set your own password in program preferences.
You can then go to https://qbittorrent.example.com
and login using the given credentials. You can set your password in the settings. Then check the connections
tab and check I2P (experimental)
. It should be working now