ArrowLeft Icon

Effortlessly Manage Torrent Downloads with Headless qBittorrent on Linux

📆 · ⏳ 2 min read · · 👀

Introduction

qBittorrent is a popular and open-source torrent client that can be installed on a wide range of operating systems including Linux.

A headless mode means running a program without a GUI (Graphical User Interface), which is ideal for a server setup where a GUI is not required.

In this blog, we will guide you through the process of installing qBittorrent in a headless mode on a Linux server.

Installing qBittorrent in Headless mode

The first step is to update the package list and install the required packages:

Terminal window
sudo apt update
sudo apt install qbittorrent-nox

Once the installation is complete, start the qbittorrent-nox service with the following command:

Terminal window
qbittorrent-nox

You can access the qBittorrent interface by visiting the following URL in your web browser: http://localhost:8080

Running qBittorrent in Background with SystemD

Running the command on the terminal directly is fine for testing it out, However, we don’t want to block the terminal window whenever we are running qBittorrent.

To run qBittorrent in the background, we can use SystemD, the init system used in modern Linux distributions. Here’s how you can do it:

Create a service file by using the following command:

Terminal window
sudo vi /etc/systemd/system/qbittorrent.service

Add the following content to the file:

Terminal window
[Unit]
Description=qBittorrent Daemon
[Service]
User=your_username
ExecStart=/usr/bin/qbittorrent-nox
Restart=on-failure
[Install]
WantedBy=multi-user.target

Replace your_username with your system user who would have read/write access (preferably non-root user).

Save and close the file.

Reload the SystemD configuration with the following command:

Terminal window
sudo systemctl daemon-reload

Start the qBittorrent service and enable it to start at boot time with the following commands:

Terminal window
sudo systemctl start qbittorrent
sudo systemctl enable qbittorrent

If you are curious, you can read more in detail about SystemD and how to use it for running background services in one of my previous blog

Conclusion

In this blog, we showed you how to install qBittorrent in a headless mode on a Linux server and how to run it in the background with SystemD. The steps are straightforward and easy to follow, making it convenient for you to set up qBittorrent on your server.

EnvelopeOpen IconStay up to date

Get notified when I publish something new, and unsubscribe at any time.

Need help with your software project? Let’s talk

You may also like

  • # linux

    SystemD Timers vs. Cron Jobs

    Explore the world of task scheduling in Linux as we compare the classic Cron Jobs with the modern SystemD Timers. Learn when to use each method and how to set them up to automate your Linux system tasks effectively.

  • # linux

    Mastering Intermediate Linux Commands for Efficient Server Management

    As a Linux server administrator, you may have already learned the basics of Linux commands. However, to manage your server more efficiently, you need to dive deeper into the lesser-known, but equally important intermediate-level commands. In this article, we will cover some of the intermediate-level Linux commands that will help you become a more proficient Linux sysadmin.

  • # linux

    Essential Linux Commands for Server Maintenance at Home

    As a Linux system administrator, it's essential to have a good grasp of the command-line interface. In this blog, we'll explore some of the most common and useful commands used for maintaining a Linux server at home. From handling files to networking, these commands will help you streamline your work and keep your server running smoothly.