qBittorrent-nox Service Setup
qBittorrent-nox Service Setup
This note records a qbittorrent-nox setup for a VPS.
Example values:
- service user:
qbittorrent - config home:
/var/lib/qbittorrent - download directory:
/data/downloads - Web UI port:
18080 - BT listen port:
45000
Caddy reverse proxy is covered in the separate Caddy note. This article only covers qBittorrent itself.
Install
1 | sudo apt install qbittorrent-nox |
On Arch Linux:
1 | sudo pacman -S qbittorrent-nox |
Do Not Run It As Root
Running a network-facing P2P daemon as root is asking for pain. If qBittorrent ever has an RCE or a bad plugin/script interaction, root turns that bug into full machine compromise.
Create a dedicated user:
1 | sudo useradd -r -m -d /var/lib/qbittorrent -s /usr/sbin/nologin qbittorrent |
systemd Unit
Create /etc/systemd/system/qbittorrent-nox.service:
1 | [Unit] |
Enable it:
1 | sudo systemctl daemon-reload |
Web UI Binding
Stop the service before editing the config, otherwise qBittorrent may overwrite your changes:
1 | sudo systemctl stop qbittorrent-nox |
Edit the config file, usually under:
1 | /var/lib/qbittorrent/qBittorrent/config/qBittorrent.conf |
Force the Web UI to localhost:
1 | [Preferences] |
Start it again:
1 | sudo systemctl start qbittorrent-nox |
On recent qBittorrent versions, the initial random password may appear in logs:
1 | journalctl -u qbittorrent-nox -e | grep -i password |
Change it immediately after logging in.