Install qBittorrent Inside Docker Container in Linux

Install qBittorrent Inside Docker Container in Linux

qBittorrent is a BitTorrent client for downloading files. It is an open-source project released under the GPLv3+ license.

This tutorial explains how to install qBittorrent inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install qBittorrent

  • Host network

Run the following command to create a container for qBittorrent that uses host network:

docker run -d --name=qbittorrent --restart=always --network=host \
    -v /opt/qbittorrent/config:/config \
    -v /opt/qbittorrent/downloads:/downloads \
    linuxserver/qbittorrent
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, qBittorrent service is listening for TCP and UDP connections on port 6881. Web interface is available on port 8080. Ports can be changed with -p option.

docker network create app-net
docker run -d --name=qbittorrent --restart=always --network=app-net \
    -p 8081:8081 -p 8082:6881 -p 8082:6881/udp \
    -e WEBUI_PORT=8081 \
    -v /opt/qbittorrent/config:/config \
    -v /opt/qbittorrent/downloads:/downloads \
    linuxserver/qbittorrent

Note: if you want to change the port of the web interface, you need to change both sides of the -p option to new port and assign new port to WEBUI_PORT environment variable. It should be done due to issues with CSRF and port mapping.

Testing qBittorrent

Open a web browser and go to http://<IP_ADDRESS>:8080, where <IP_ADDRESS> is the IP address of the system. Log in to the web interface with the default username (admin) and password (adminadmin).

qBittorrent Inside Docker Container in Linux

Uninstall qBittorrent

To completely remove qBittorrent, remove its container:

docker rm --force qbittorrent

Remove qBittorrent image:

docker rmi linuxserver/qbittorrent

You can also remove qBittorrent data:

sudo rm -rf /opt/qbittorrent

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.