Docker安装qbittorrent

项目地址

Github:linuxserver/docker-qbittorrent

Docker:linuxserver/qbittorrent

Qbittorrent项目旨在提供一个开源软件替代的μTorrent。qBittorrent 基于 Qt 工具包和 libtorrent-rasterbar 库。

使用Docker-Compose快速部署

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
version: "2.1"
services:
qbittorrent:
image: ghcr.io/linuxserver/qbittorrent
container_name: qbittorrent
environment:
- PUID=0
- PGID=0
- TZ=Asia/Shanghai
- WEBUI_PORT=8080
volumes:
- /volume1/docker/qbittorrent:/config
- /volume1/downloads/qbittorrent:/downloads
networks:
- host
restart: always

使用Docker部署

1
2
3
4
5
6
7
8
9
10
11
docker run -d \
--name=qbittorrent \
-e PUID=0 \
-e PGID=0 \
--restart always \
--network host \
-e TZ=Asia/Shanghai \
-e WEBUI_PORT=8082 \
-v /volume1/docker/qbittorrent:/config \
-v /volume1/downloads/qbittorrent:/downloads \
linuxserver/qbittorrent:amd64-latest
  • 更新: docker pull linuxserver/qbittorrent
  • 停止正在运行的容器: docker stop qbittorrent
  • 删除容器: docker rm qbittorrent
  • 使用与上述相同的 docker run 参数重新创建一个新容器(如果正确映射到主机文件夹,您的/config文件夹和设置将被保留)

参数

例如,-p 8080:80将从80容器内部公开端口,以便从8080容器外部端口上的主机 IP 访问。

范围 功能
-p 6881 tcp连接端口
-p 6881/udp udp连接端口
-p 8080 图形用户界面
-e PUID=1000 用户 ID - 见下文解释
-e PGID=1000 对于 GroupID - 请参阅下面的说明
-e TZ=Asia/Shanghai 指定时区以使用 Asia/Shanghai
-e WEBUI_PORT=8080 更改webui的端口,见下文说明
-v /config 包含所有相关的配置文件。
-v /downloads 磁盘上的下载位置。

用户/组标识符

-v主机操作系统和容器之间可能会出现使用卷(标志)权限问题时,我们通过允许您指定用户PUID和组来避免这个问题PGID

确保主机上的任何卷目录都归您指定的同一用户所有。

在这种情况下PUID=1000PGID=1000,找到你的用法id user如下:

1
2
$ id 用户名
uid=1000(dockeruser) gid=1000(dockergroup) 组=1000(dockergroup)