How to Install qBittorrent on Ubuntu 22.04 or 20.04


qBittorrent is a cross-platform free and open-source BitTorrent client. qBittorrent is a native application written in C++ which uses Boost, Qt 5 toolkit, and libtorrent-rasterbar library and is extremely lightweight and fast. qBittorrent is very popular amongst torrent users as the main alternative to UTorrent.In the following tutorial, you will learn how to install qBittorrent on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 LTS Focal Fossa desktop GUI and install qBittorrent on a headless server using the command line terminal.

Recommended Steps Before Installation

Before you begin, run an update on your system to ensure all packages are up-to-date to avoid any conflicts during the installation.

sudo apt update

Optionally, you can list the updates for users who require review or are curious.

sudo apt --list upgradable

Proceed to upgrade any outdated packages using the following command.

sudo apt upgrade

Method 1: Desktop Client

By default, qBittorrent is included in the default Ubuntu software repository. However, like most packages, this is often outdated for new features and bug improvements. If you use qBittorrent, you highly recommend using the PPA maintained by the qBittorrent team.

The PPA comes in two options, stable or nightly. I recommend the stable version for most users unless you prefer bleeding-edge software.

Before proceeding, run the install command below for packages. These are most likely installed but run the command to be safe.

sudo apt install dirmngr lsb-release ca-certificates software-properties-common apt-transport-https -y

For users who have not previously imported a GPG key from the Ubuntu keyserver, the command line terminal will often have issues importing GPG keys from LaunchPAD PPAs because the directories are not created. This is an easy fix. Use the following command that will, in turn, generate the directories.

sudo gpg --list-keys

Example output:

gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created

This can be skipped, but if you encounter an issue, just run the command and re-try.

The next task is to import the GPG key needed.

sudo gpg --no-default-keyring --keyring /usr/share/keyrings/qbittorrent.gpg --keyserver keyserver.ubuntu.com --recv-keys 401E8827DA4E93E44C7D01E6D35164147CA69FC4 > /dev/null

Example output:

gpg: keybox '/usr/share/keyrings/qbittorrent.gpg' created
gpg: key D35164147CA69FC4: public key "Launchpad PPA for qBittorrent Team" imported
gpg: Total number processed: 1
gpg:               imported: 1

With the GPG key now imported, you can import the LaunchPAD PPA.

Import qBittorrent Stable

echo "deb [signed-by=/usr/share/keyrings/qbittorrent.gpg] https://ppa.launchpadcontent.net/qbittorrent-team/qbittorrent-stable/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/qbittorrent.list

Import qBittorrent Unstable (Nightly)

echo "deb [signed-by=/usr/share/keyrings/qbittorrent.gpg] https://ppa.launchpadcontent.net/qbittorrent-team/qbittorrent-unstable/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/qbittorrent.list

Next, run a quick APT update to reflect the newly added PPA.

sudo apt update

Now you can install qBittorrent using the following command.

sudo apt install qbittorrent -y

How to Launch qBittorrent

To launch qBittorrent, type the following command into your current terminal session.

qbittorrent

Alternatively, you can find the program in your Ubuntu Desktop Application Menu.

Activities > Show Applications > qBittorrent

Example:

The first time you use the program, you will get a pop-up window with a Legal notice. This covers qBittorrent from legal responsibilities as most know torrents are still a significant part of illegal downloads today.

Example:

After agreeing to the Legal notice, you will see your newly installed torrent software window.

Example:

Method 2: Remote WebUI Method (Server)

qBittorrent can be installed on a headless Ubuntu server and efficiently managed on a WebUI interface accessed from your favorite Browser. If you have not imported the LaunchPAD PPA, please see the desktop client method without installing the actual client, then return to this section.

See also
How to Install balenaEtcher on Fedora Linux

Now you can install qBittorrent using the following command.

sudo apt install qbittorrent-nox -y

qBittorrent-nox is the default go-to for headless clients designed to run through a Web interface accessible on the default localhost location at http://localhost:8080. The Web UI access is secured by default, the default account username is (admin), and the password is (adminadmin).

Unlike the desktop version, using the terminal command (qbittorrent-nox) would not be advised as a headless server; you won’t be able to do anything while qBittorrent is running, which isn’t practical. Instead, you will create a systemd service unit to run in the background and start at system boot.

First, create (qbittorrent-nox) user and group so the service can run as an unprivileged user.

sudo adduser --system --group qbittorrent-nox

Example output:

If you were wondering what (–system) means, you created a system user instead of a typical user.

Next, add your username to the qbittorrent-nox user group.

sudo adduser your-username qbittorrent-nox

An example is my username, “joshua” so the command would be.

sudo adduser joshua qbittorrent-nox

Example output if successful:

Adding user `joshua' to group `qbittorrent-nox' ...
Adding user joshua to group qbittorrent-nox
Done.

Second, create a systemd service file for qbittorrent-nox.

sudo nano /etc/systemd/system/qbittorrent-nox.service

Thirdly, you must copy and paste the following lines into the file.

[Unit]
Description=qBittorrent Command Line Client
After=network.target

[Service]
Type=forking
User=qbittorrent-nox
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure

[Install]
WantedBy=multi-user.target

Example:

Hint you can change the WebUI-port=8080 to another port if you wish.

Save the file (CTRL+O), then exit (CTRL+X). Now, reload your systemd daemon for changes to be active with the daemon-reload command.

sudo systemctl daemon-reload

Now you can start qBittorrent-nox with the following command.

sudo systemctl start qbittorrent-nox

If you want qBittorrent-nox to be started on boot, use the following.

sudo systemctl enable qbittorrent-nox

Example output if successful:

Created symlink /etc/systemd/system/multi-user.target.wants/qbittorrent-nox.service → /etc/systemd/system/qbittorrent-nox.service.

Before you continue, it would be ideal for checking the status to ensure everything is working correctly.

systemctl status qbittorrent-nox

If there are no errors and status in the green, proceed to the next part of the tutorial.

Accessing qBittorrent Web UI on Ubuntu Server

qBittorrent can be accessed through your favorite Internet Browser on its Web UI from your local network. To do this type, the server’s internal IP address is followed by the port number (8080), for example, 192.168.55.156:8080, or use if hosted locally, use the localhost address 127.0.0.1:8080 then you should see the following page.

Example:

The default username is (admin), and the default password is (adminadmin).

Once entered, the application will start as below.

Example:

example of qbittorrent webui on ubuntu 22.04 or 20.04 linuxPin

Before you do anything else, you should immediately change the default username and password, which can be found following the path.

Tools > Options > Web UI > Authentication.

From here, you can change the username and password.

Example:

change admin password on qbittorrent webui on ubuntu 22.04 or 20.04 linuxPin

Congratulations, you have installed qBittorrent on your Ubuntu server.

Additional Commands & Tips

How to Update qBittorrent or qBittorrent-nox

Using the command line terminal may be more work but is often the most efficient way to update your system. All you need to do is run the apt update command as follows.

sudo apt update

If an update is available for qBittorrent or qBittorent-nox, use the following upgrade command.

sudo apt upgrade

How to Remove (Uninstall) qBittorrent or qBittorrent-nox

If you would like to remove qBittorrent, this is an easy process. First, you must remove the custom PPA if you have installed this as per the above tutorial.

Remove the PPA that you imported with the following command.

sudo rm /etc/apt/sources.list.d/qbittorrent.list

Next, remove qBittorrent using the command below.

sudo apt autoremove qbittorrent --purge

Users that have installed qBittorrent-nox use the following command.

sudo apt autoremove qbittorrent-nox --purge

And that is it; repeat the tutorial to re-install qBittorrent if you wish it back on your system.

See also
How to Install CPU-X on Manjaro Linux

Conclusion

qBittorrent is a great torrent client that will work excellently on Ubuntu-based distributions. It has more features than Transmission, but without the bloatware and ads. If you are looking for a good torrent client, qBittorrent is worth considering.

5 thoughts on “How to Install qBittorrent on Ubuntu 22.04 or 20.04”

  1. Hi, when I create user qbittorrent-nox it does not have access to external drive mounted under my account. What can I do about it?

    Reply
    • Thanks for the message Jakub,

      You can set permissions with chown, either with username or group depending on what you prefer.

      sudo chown -R qbittorrent-nox:qbittorrent-nox /directory/location or others such as
      sudo chown -R qbittorrent-nox:root /directory/location

      Can be done in a few variations.

      Reply
  2. If anyone are having problems with permissions after the download finished. Change Umask setings on /etc/systemd/system/qbittorrent-nox.service

    000 – full access for all users and groups.
    007 – only user and group that ‘qbit’ is running as with no access from any other accounts.
    002 – user and group ‘qbit’ is running as with read-only for all other accounts.
    022 – user ‘qbit’ is running as with read-only for all other accounts.

    Reply

Leave a Comment

Share to...