1. 取 qBittorrent 镜像

首先,我们需要拉取 qBittorrent 镜像。可以使用以下命令:

    docker pull helloz/qbittorrent

    2.创建并启动 qBittorrent 容器

    接下来,我们需要创建并启动 qBittorrent 容器。可以使用以下命令:

    Copy

    • 01
    • 02
    • 03
    • 04
    • 05
    • 06
    • 07
    • 08
    docker run -d \ --name=qBittorrent \ -p 7881:7881 \ -p 7881:7881/udp \ -p 18080:18080 \ -v /home/Data/qBittorrent/config:/etc/qBittorrent \ -v /home/Data/HDD1/Downloads:/downloads \ --restart unless-stopped \ helloz/qbittorrent

    在这个命令中,我们:

    • 使用 --name=qBittorrent 指定容器的名称。

    • 使用 -p 7881:7881-p 7881:7881/udp 将容器中的 7881 端口映射到主机的 7881 端口。这将允许我们通过 http://localhost:7881/ 访问 qBittorrent 的 Web UI。

    • 使用 -p 18080:18080 将容器中的 18080 端口映射到主机的 18080 端口。 另一个端口映射,可根据需要使用。

    • 使用 -v /home/Data/qBittorrent/config:/etc/qBittorrent-v /home/Data/HDD1/Downloads:/downloads 将主机的目录挂载到容器中。这将允许我们访问 qBittorrent 的配置文件和下载的文件。

    • 使用 --restart unless-stopped 标志,这意味着当容器停止时,它将在下次 Docker 启动时自动重新启动。

    3:配置 qBittorrent

    qBittorrent 容器启动后,我们可以通过以下 URL 访问它的 Web UI:

      http://localhost:7881/

      使用默认的用户名和密码登录(用户名:admin,密码:adminadmin)。

      配置 qBittorrent 的下载位置、端口、速度限制等设置。

      单击“保存”按钮以保存您的更改。

      注意:

      • 在运行上面的命令之前,请确保你已经安装了 Docker 并且创建了一个 Docker 网络。

      • 你需要将 /home/Data/qBittorrent/config/home/Data/HDD1/Downloads 替换为你自己的目录。