镜像来源:https://hub.docker.com/r/linuxserver/qbittorrent
先安装 Docker,然后执行以下命令:

  1. docker-compose:
---
services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    volumes:
      - /path/to/qbittorrent/appdata:/config
      - /path/to/downloads:/downloads #optional
    ports:
      - 8080:8080
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped
  1. docker cli:
docker run -d \
  --name=qbittorrent \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Asia/Shanghai \
  -e WEBUI_PORT=8080 \
  -e TORRENTING_PORT=6881 \
  -p 8080:8080 \
  -p 6881:6881 \
  -p 6881:6881/udp \
  -v /opt/qbittorrent/appdata:/config \
  -v /opt/qbittorrent/downloads:/downloads `#optional` \
  --restart unless-stopped \
  lscr.io/linuxserver/qbittorrent:latest

安装完成后,相关信息如下:

qbittorrent地址:http://ip:8080
用户名:admin
密码:用户的临时密码admin将在启动时打印到容器日志中
配置和/下载目录:~/qbittorrent

卸载命令:

#删掉容器
ContainerID=`docker ps|grep linuxserver/qbittorrent|awk '{print $1}'`
docker kill ${ContainerID}
docker rm ${ContainerID}
docker rmi `docker images|grep linuxserver/qbittorrent|awk '{print $3}'`
#删掉下载文件夹
rm -rf ~/qbittorrent