Install Dependencies

  • Get Libtorrent Rasterbar sources (1.0.x)

  • Get qBittorrent sources (3.3.x)

  • Install OS build tools and deps

    sudo apt-get build-essential install libboost-dev libboost-system-dev build-essential qtbase5-dev qttools5-dev-tools python
    geoip-database libgeoip-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev git pkg-config automake libtool

Compile libtorrent-rasterbar

  • Configure project

    ./configure --disable-debug --enable-encryption --prefix=/usr --with-libgeoip=system CXXFLAGS=-std=c++11
  • Compile and install

    make clean
    make
    sudo make install

After librasterbar is finished and installed you can start with compiling qbittorrent-nox

Compile qBittorrent

 ./configure --prefix=/usr --disable-gui
make
sudo make install

Set up daemon service

Start qBittorrent once to create the config directory

qbittorrent-nox

Install service file for systemd

Create a file:

/etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
Type=forking
User=maggus
ExecStart=/usr/bin/qbittorrent-nox -d

[Install]
WantedBy=multi-user.target

Then run

sudo systemctl daemon-reload
sudo systemctl start qbittorrent.service
You can create the service file in a Dropbox and then link the file into the respective directory to migrate it to other machines with the same installation or for easy backup.

Install Torrent Filetype handler

Make sure you update the mime type definitions of gvfs-open and xdg-open after adding the

To make life easier with using qBittorrent-nox and the Webui you can define a handlers for the torrent files and magnet links. Create new files:

qbittorrent-nox-add-file.desktop
[Desktop Entry]
Version=3.3.12
Type=Application
Encoding=UTF-8
Name=qBittorrent-nox
Comment=Headless qBittorrent
Exec=qbittorrent-nox --webui-port=8112 %F %U
Mimetype=application/x-bittorrent;
Terminal=true
qbittorrent-nox-add-link.desktop
[Desktop Entry]
Version=3.3.12
Type=Application
Encoding=UTF-8
Name=qBittorrent-nox
Comment=Headless qBittorrent
Exec=qbittorrent-nox --webui-port=8112 %U
Mimetype=x-scheme-handler/magnet;
Terminal=true

Create symlinks to these files in "/usr/share/applications"

A terminal will pop up shortly because the option Terminal=true is set. This can serve as an indicator that something has actually happened. If you find this annoying simply set Terminal=false.

Update Mime type

GNOME
gvfs-mime --set application/x-bittorrent qbittorrent-nox-add-file.desktop
gvfs-mime --set x-scheme-handler/magnet qbittorrent-nox-add-link.desktop
XDG
xdg-mime default qbittorrent-nox-add-link.desktop x-scheme-handler/magnet
xdg-mime default qbittorrent-nox-add-file.desktop application/x-bittorrent

Sources