How to install qbittorrent-nox [Note]

qBittorrent is a free, open-source, fast and lightweight P2P BitTorrent client written in C++ / Qt, available for Linux, FreeBSD, MacOS and Windows. qbittorrent-nox – bittorrent client based on libtorrent-rasterbar (without X support). I try to install on my Raspberry PI.

qBittorrent is included in the default Ubuntu software repository. You can easily install it by running the following command in a terminal window:

sudo apt install qbittorrent-nox

By default, the web UI is accessible on port 8080. If there’s another service using port 8080, you need to change the port number in qBittorrent.

Configuration

If you want to configure qBittorrent before you start it you this method

Create the default configuration directory.

mkdir -p ~/.config/qBittorrent

Create the configuration file.

touch ~/.config/qBittorrent/qBittorrent.conf

Edit the file

nano ~/.config/qBittorrent/qBittorrent.conf

Add this. Make sure to change your web ui port.

[LegalNotice]
Accepted=true
[Preferences]
WebUI\Port=PORT

Now you just run it and enjoy!

qbittorrent-nox

Default login:

username: admin 
password: adminadmin

Some key start-up arguments to help you along. Using the command above with no arguments will loads the defaults or the settings defined in the ~/.config/qBittorrent/qBittorrent.conf

Usage:
    ./qbittorrent-nox [options][(<filename> | <url>)...]
Options:
    \-v | --version                Display program version and exit
    \-h | --help                   Display this help message and exit
    \--webui-port=<port>           Change the Web UI port
    \-d | --daemon                 Run in daemon-mode (background)
    \--profile=<dir>               Store configuration files in <dir>
    \--configuration=<name>        Store configuration files in directories
                                   qBittorrent\_<name>
    \--relative-fastresume         Hack into libtorrent fastresume files and make
                                   file paths relative to the profile directory
    files or URLs                  Download the torrents passed by the user
Options when adding new torrents:
    \--save-path=<path>            Torrent save path
    \--add-paused=<true|false>  Add torrents as started or paused
    \--skip-hash-check             Skip hash check
    \--category=<name>             Assign torrents to category. If the category
                                   doesn't exist, it will be created.
    \--sequential                  Download files in sequential order
    \--first-and-last              Download first and last pieces first
    \--skip-dialog=<true|false> Specify whether the "Add New Torrent" dialog
                                   opens when adding a torrent.
Option values may be supplied via environment variables. For option named
'parameter-name', environment variable name is 'QBT_PARAMETER_NAME' (in upper
case, '-' replaced with '_'). To pass flag values, set the variable to '1' or
'TRUE'. For example, to disable the splash screen:
QBT_NO_SPLASH=1 ./qbittorrent-nox
Command line parameters take precedence over environment variables

Second instance

When you simply call the binary it will look for it’s configuration in ~/.config/qbittorrent.

If you would like to run a second instance using another configuration you can do so like this

~/bin/qbittorrent-nox --configuration=NAME

This will create a new configuration directory using this suffix.

~/.config/qbittorrent_NAME

And you can now configure this instance separately.

Systemd service

Location for the systemd service file:

/etc/systemd/system/qbittorrent.service

Modify the path to the binary and your local username.

[Unit] 
Description=qBittorrent-nox service
Wants=network-online.target
After=network-online.target
nss-lookup.target

[Service]
# if you have systemd < 240 (Ubuntu 18.10 and earlier, for example), you probably want to use Type=simple instead
Type=exec
# change user as needed
User=qbtuser
# The -d flag should not be used in this setup
ExecStart=/usr/bin/qbittorrent-nox
# uncomment this for versions of qBittorrent < 4.2.0 to set the maximum number of open files to unlimited
#LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target

After any changes to the services reload using this command.

systemctl daemon-reload

Now you can enable the service

systemctl enable --now qbittorrent.service

Now you can use these commands

systemctl stop qbittorrent 
systemctl start qbittorrent
systemctl restart qbittorrent

Done! 😉