在 Ubuntu Server 18.04 LTS 上搭建 qBittorrent

  • Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64)

关于 qBittorent-nox 与 qBittorrent:

  • qbittorrent 是带有桌面图形用户界面
  • qbittorrent-nox 没有桌面图形用户界面,只有一个Web界面

安装 qBittorrent-nox

  • 检查配置 software-properties-common

    运行下面命令

    1
    sudo apt-get install -y software-properties-common

添加 PPA

qBittorrent stable 版本

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

更新源

1
sudo apt-get update

开始安装并配置

在更新源完成后,安装 qBittorrent-nox

1
sudo apt-get install qbittorrent-nox

/etc/systemd/system/ 创建服务

1
sudo vi /etc/systemd/system/qbittorrent.service

qbittorrent.service:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[Unit]
Description=qBittorrent Daemon Service
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=network-online.target nss-lookup.target

[Service]
# 如果systemd>=240,则可能需要改用 Type=exec
Type=simple
User=root # 替换成你运行的用户
ExecStart=/usr/bin/qbittorrent-nox
TimeoutStopSec=infinity

[Install]
WantedBy=multi-user.target

启动测试

1
qbittorrent-nox

您应该看到

1
2
3
4
5
6
*** Legal Notice ***
qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.

No further notices will be issued.

Press 'y' key to accept and continue...

按下 y 键

1
2
3
4
5
6
7
******** Information ********
To control qBittorrent, access the Web UI at http://localhost:8080
The Web UI administrator user name is: admin
The Web UI administrator password is still the default one: adminadmin
This is a security risk, please consider changing your password from program preferences.
03/02/2016 15:51:03 - The Web UI is listening on port 8080
03/02/2016 15:51:04 - qBittorrent is successfully listening on ...

这时候 Web 面板已经开启成功,访问 http://ip:8080 输入

1
2
User: admin
Password: adminadmin

运行启动 qBittorrent

1
sudo systemctl start qbittorrent

开机自启动

1
sudo systemctl enable qbittorrent

Web UI

官方 Github 文档说明