quinta-feira, 24 de dezembro de 2020

How to Install qBittorrent on Ubuntu 18.04 Server

0 comentários

 Fonte: How to Install qBittorrent on Ubuntu 18.04 Desktop or Server (linuxbabe.com)


ou can install qBittorrent command line client on a headless Ubuntu 18.04 server and manage it via the qBittorrent web interface (You control it in a web browser). SSH into your Ubuntu 18.04 server and use the same PPA to install qBittorrent daemon.

sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable

sudo apt install qbittorrent-nox

Note that we need to install qbittorrent-nox (without X), instead of qbittorrent. qBittorrent-nox is meant to be controlled via its feature-rich Web UI which is accessible as a default on http://localhost:8080. The Web UI access is secured and the default account username is “admin” with “adminadmin” as a password. You can start qBitorrent-nox with:

qbittorrent-nox

However, starting qBittorrent-nox this way isn’t recommended, because you can’t run other command while it’s running. Press Ctrl+C to quit it now. We can create a systemd service unit so it can run in the background and also start at system boot time.

Create the qbittorrent-nox user and group so that it can run as an unprivileged user, which will increase your server’s security.

sudo adduser --system --group qbittorrent-nox

The --system flag means we are creating a system user instead of normal user. A system user doesn’t have password and can’t login, which is what you would want for a torrent client. A home directory /home/qbittorent-nox will be created for this user. You might want to add your user account to group qbittorrent-nox with the following command so that the user account has access to the files downloaded by qBittorrent-nox. Files are downloaded to /home/qbittorrent-nox/Downloads/  by default. Note that you need to re-login for the groups change to take effect.

sudo adduser your-username qbittorrent-nox

Then create a systemd service file for qbittorrent-nox with your favourite text editor such as nano.

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

Copy and paste the following lines into the file. If there’s another service using port 8080, then you need to change the port number for qBitorrent to something else like 8081. Also note that the -d (daemonize) option is needed in this systemd service unit.

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

[Service]
#Do not change to "simple"
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

To save a file in Nano text editor, press Ctrl+O, then press Enter to confirm. Press Ctrl+X to exit. Now start qBittorrent-nox with the following command.

sudo systemctl start qbittorrent-nox

Note that if you change a systemd service file, you need to reload the systemd daemon for the change to take effect.

sudo systemctl daemon-reload

You might also want to enable auto start at system boot time.

sudo systemctl enable qbittorrent-nox

Check its status:

systemctl status qbittorrent-nox

qbittorrent ubuntu server

You can see that qBittorrent-nox is running and auto start at boot time is enabled.

Accessing qBittorrent Web UI

To access the qBittorrent Web UI from local network, enter the Ubuntu server’s private IP address followed by the port number like below.

192.168.0.102:8080

Username is admin. Default password is “adminadmin”.

install qbittorrent ubuntu server

The default web interface.

qbittorrent as a service ubuntu

It’s strongly recommended to change the default username and password. Go to Tools > Options and select the Web UI tab. Under the Authentication section, change both username and password.

qbittorrent-nox config file

And now you can start downloading torrents on your Ubuntu 18.04 server. You have the option to upload local torrents or add magnet links. Files are downloaded to /home/qbittorrent-nox/Downloads/  by default.


Leave a Reply