需要使用Docker Compose,安装方法参考Ubuntu 安装Docker
项目地址:https://github.com/linuxserver/docker-qbittorrent
Docker Hub:https://hub.docker.com/r/linuxserver/qbittorrent
docker-compose内容
# 创建文件目录
mkdir docker-qbittorrent
cd docker-qbittorrent
mkdir config
mkdir data
# 创建docker-compose.yml
vim docker-compose.yml
# 文件内容
---
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
volumes:
- /root/docker-qbittorrent/config:/config
- /root/docker-qbittorrent/data:/downloads #optional
ports:
- 8080:8080
- 6881:6881
- 6881:6881/udp
restart: unless-stopped
# 执行并后台运行
docker-compose -f docker-compose.yml up -d
[+] Running 10/10
✔ qbittorrent Pulled 7.2s
✔ 8fc9c306fc5e Pull complete 1.0s
✔ df25a931801a Pull complete 1.0s
✔ feae5bd8b9ac Pull complete 1.0s
✔ 9686e6c90895 Pull complete 1.0s
✔ 93a4a780530c Pull complete 1.6s
✔ 36e142dfda7b Pull complete 1.6s
✔ 7ab4db119fa1 Pull complete 6.1s
✔ fbc10580331c Pull complete 6.1s
✔ ab2d7173d3a3 Pull complete 6.1s
[+] Running 2/2
✔ Network docker-qbittorrent_default Created 0.1s
✔ Container qbittorrent Started 0.6s
# 查看运行状态
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9baf35b0e07f lscr.io/linuxserver/qbittorrent:latest "/init" About a minute ago Up About a minute 0.0.0.0:6881->6881/tcp, :::6881->6881/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:6881->6881/udp, :::8080->8080/tcp, :::6881->6881/udp qbittorrent
# 查看密码
docker logs -f qbittorrent
[migrations] started
[migrations] no migrations found
───────────────────────────────────────
██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝
Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID: 1000
User GID: 1000
───────────────────────────────────────
Linuxserver.io version: 5.0.0-r1-ls356
Build-date: 2024-10-06T06:52:43+00:00
───────────────────────────────────────
[custom-init] No custom files found, skipping...
WebUI will be started shortly after internal preparations. Please wait...
******** Information ********
To control qBittorrent, access the WebUI at: http://localhost:8080
The WebUI administrator username is: admin
The WebUI administrator password was not set. A temporary password is provided for this session: JYLIQ7Z2Z【密码】
You should set your own password in program preferences.
Connection to localhost (::1) 8080 port [tcp/http-alt] succeeded!
[ls.io-init] done.
Bad Http request method, closing socket. IP: ::ffff:80.75.212.9. Method: "CONNECT"
访问
WebUI: http://localhost:8080
password: JYLIQ7Z2Z
user: admin
其他问题
Unauthorized解决方案
需要先关闭容器,编辑完成后重新启动
# 进入配置路径
cd /root/docker-qbittorrent/config/qBittorrent
# 编辑配置文件
vim qBittorrent.conf
# 在文件最后加入下面两行
WebUI\CSRFProtection=false
WebUI\HostHeaderValidation=false
tracker list
https://cf.trackerslist.com/all.txt
https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt
正文完