简介
qBittorrent 是一个免费开源的 BitTorrent 客户端,旨在替代 uTorrent。 它使用 C++ 编写,并基于 Qt 工具包构建,因此拥有跨平台支持,可以在 Linux、Windows、macOS、FreeBSD 和其他操作系统上运行。
核心功能
- 易于使用: 提供用户友好的图形界面 (GUI),即使是新手也能轻松上手。
- 开源免费: 完全免费使用,没有广告或恶意软件。
- 轻量级: 占用资源较少,即使在老旧的计算机上也能运行良好。
- 支持多种 BitTorrent 协议: 支持 DHT, Peer Exchange, Full encryption, Magnet links 等标准协议。
- 内置搜索引擎: 可以直接在 qBittorrent 界面中搜索种子,无需依赖外部网站。
- 高级下载控制:
- 按种子/Tracker/类别进行下载优先级设置
- 可以选择下载文件内容
- 支持顺序下载
- 可以限制全局和单个种子的上传/下载速度
- 远程控制: 可以通过 Web 界面进行远程管理,方便从其他设备控制下载。
- IP 过滤: 可以导入和更新 IP 过滤列表,阻止恶意或受监控的 IP 地址。
- Unicode 支持: 支持各种语言和字符集。
- UPnP / NAT-PMP 端口转发: 自动配置路由器,简化端口转发设置。
- IPv6 支持: 充分支持 IPv6 网络。
- Tracker 编辑器: 可以手动添加、编辑或删除 Tracker 地址。
- RSS 源支持: 可以订阅 RSS 源,自动下载最新的种子。
- 计划器: 可以设置下载计划,在特定时间段启动或停止下载。
- HTTP Tracker 支持: 支持使用 HTTP Tracker。
与其他 BitTorrent 客户端相比的优势:
- 无广告: 相比 uTorrent 等客户端,qBittorrent 没有广告,用户体验更好。
- 更强大的功能: 提供了更多高级功能,如内置搜索引擎、高级下载控制等。
- 更好的隐私保护: 开源特性意味着代码可以被审查,更容易发现和修复安全漏洞,从而更好地保护用户隐私。
- 跨平台支持: 可以在多种操作系统上运行。
安装
Linux 无图形化界面安装
家用小型 linux 服务器没有图形化界面,且是 armv7 结构,安装 qBittorrent
安装
1
|
apt install qbittorrent-nox
|
启动
- 默认端口: 8080
- 默认用户:admin
- 默认密码:adminadmin
配置文件夹所在位置
修改端口
1
|
qbittorrent-nox --webui-port=XXXX
|
创建系统服务
1
|
vim /etc/systemd/system/qbittorrent-nox.service
|
填入以下内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
[Unit]
Description=qBittorrent-nox service
Documentation=man:qbittorrent-nox(1)
Wants=network-online.target
After=local-fs.target network-online.target nss-lookup.target
[Service]
Type=simple
PrivateTmp=false
User=root
ExecStart=/usr/bin/qbittorrent-nox -config /root/.config/qBittorrent/qBittorrent.conf
TimeoutStopSec=1800
[Install]
WantedBy=multi-user.target
|
启动服务
1
|
systemctl start qbittorrent-nox.service
|
查看服务
1
|
systemctl status qbittorrent-nox.service
|
关闭服务
1
|
systemctl stop qbittorrent-nox.service
|
开机自启
1
|
systemctl enable qbittorrent-nox.service
|
Docker
使用 docker 可以方便的安装 qBittorrent
- linuxserver/qbittorrent:下载量大,最新版只支持 amd64 和 arm64
- gists/qbittorrent:支持多种架构,GitHub,测试有问题
- crazymax/qbittorrent:支持多种架构,GitHub,配置几乎都放在了一个目录下,打乱了原有的配置位置
这些镜像对应的目录都不一样,按照先后使用顺序添加
docker-compose
linuxserver/qbittorrent 推荐
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
services:
qbittorrent:
container_name: qbittorrent
image: linuxserver/qbittorrent:arm32v7-4.5.3
environment:
- PUID=0
- PGID=0
- TZ=Asia/Shanghai
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
volumes:
- ./qbittorrent_data:/config
# - ./downloads:/downloads #optional
- /mnt/p1:/root
ports:
- 8081:8080
- 6881:6881
- 6881:6881/udp
restart: unless-stopped
|
gists/qbittorrent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
services:
qbittorrent:
container_name: qbittorrent
image: gists/qbittorrent:5.0.2
ports:
- "8081:8080"
- "6881:6881"
- "6881:6881/udp"
volumes:
- ./qbittorrent_data:/data
environment:
- PUID=0
- PGID=0
- TZ=Asia/Shanghai
- WEB_PORT=8080
- PEER_PORT=6881
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
|
- username: admin
- password: randomly generated every start, use
docker logs qbittorrent
to see temporary password
crazymax/qbittorrent
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
services:
qbittorrent:
container_name: qbittorrent
image: crazymax/qbittorrent:5.0.3
ports:
- "8081:8080"
- "6881:6881"
- "6881:6881/udp"
volumes:
- ./qbittorrent_data/config:/data/config # qbittorrent 配置 categories.json ipc-socket lockfile qBittorrent.conf rss watched_folders.json
- ./qbittorrent_data/data:/data/data # qbittorrent 备份 BT_backup GeoDB rss
- /mnt/p1/bittorrent/qbittorrent/downloads:/data/downloads # 下载位置
- /mnt/p1/bittorrent/qbittorrent/temp:/data/temp # 临时下载位置
- /mnt/p1/bittorrent/qbittorrent/torrents:/data/torrents # torrent 位置
- /mnt/p1/bittorrent/qbittorrent/watch:/data/watch
- ./qbittorrent_data/webui:/data/webui
- /mnt/p1/film:/root/film
environment:
- UID=0
- GID=0
- TZ=Asia/Shanghai
- WEBUI_PORT=8080
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
|
docker-cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
docker run -d \
--name=qbittorrent \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e WEBUI_PORT=8080 \
-e TORRENTING_PORT=6881 \
-p 8080:8080 \
-p 6881:6881 \
-p 6881:6881/udp \
-v /path/to/qbittorrent/appdata:/config \
-v /path/to/downloads:/downloads `#optional` \
--restart unless-stopped \
lscr.io/linuxserver/qbittorrent:latest
|
支持的变量
Parameter |
Function |
-p 8080:8080 |
WebUI |
-p 6881:6881 |
tcp connection port |
-p 6881:6881/udp |
udp connection port |
-e PUID=1000 |
for UserID - see below for explanation |
-e PGID=1000 |
for GroupID - see below for explanation |
-e TZ=Etc/UTC |
specify a timezone to use, see this list |
-e WEBUI_PORT=8080 |
for changing the port of the web UI, see below for explanation |
-e TORRENTING_PORT=6881 |
for changing the port of tcp/udp connection, see below for explanation |
-v /config |
Contains all relevant configuration files. |
-v /downloads |
Location of downloads on disk. |
--read-only=true |
Run container with a read-only filesystem. Please read the docs |
--user=1000:1000 |
Run container with a non-root user. Please read the docs |
配置
unauthorized
如果是局域网远程设备,首次打开显示 Unauthorized
,
新增配置
1
2
3
4
|
WebUI\AuthSubnetWhitelist=192.168.68.0/24
WebUI\AuthSubnetWhitelistEnabled=true
WebUI\HostHeaderValidation=false
WebUI\CSRFProtection=false
|
invalid Username or Password
遇到这个问题,首先可以更换浏览器尝试,有的更换浏览器就可以正常登录了,如果不行,修改 config 文件,添加一行:
1
|
WebUI\Password_PBKDF2="@ByteArray(ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ==)"
|
这样用户名密码就初始化为 admin adminadmin
备份恢复
找到 qbittorrent 程序目录,复制 BT_backup 文件夹,里面包含了种子文件与状态信息,重新安装后覆盖还原即可。
1、以群晖为例,打开 winscp 连接上群晖,找到 qbittorrent 安装目录,
2、复制 BT_backup 文件夹到本地电脑上,
3 、重新安装 qbittorrent 后,使用 winscp 上传覆盖 BT_backup 文件夹,重启 qbittorrent,查看时候恢复之前的状态。