├── docs └── qbittorrent-logo.png ├── .editorconfig ├── latest ├── qBittorrent.conf ├── docker-compose.test.yml ├── entrypoint.sh └── Dockerfile ├── stable ├── qBittorrent.conf ├── docker-compose.test.yml ├── entrypoint.sh └── Dockerfile ├── docker-compose.yml ├── LICENSE └── README.md /docs/qbittorrent-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wernight/docker-qbittorrent/HEAD/docs/qbittorrent-logo.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /latest/qBittorrent.conf: -------------------------------------------------------------------------------- 1 | [Preferences] 2 | General\Locale=C 3 | WebUI\Enabled=true 4 | Downloads\SavePath=/downloads 5 | Connection\PortRangeMin=6881 6 | 7 | [LegalNotice] 8 | Accepted=true 9 | 10 | [General] 11 | ported_to_new_savepath_system=true -------------------------------------------------------------------------------- /stable/qBittorrent.conf: -------------------------------------------------------------------------------- 1 | [Preferences] 2 | General\Locale=C 3 | WebUI\Enabled=true 4 | Downloads\SavePath=/downloads 5 | Connection\PortRangeMin=6881 6 | 7 | [LegalNotice] 8 | Accepted=true 9 | 10 | [General] 11 | ported_to_new_savepath_system=true -------------------------------------------------------------------------------- /latest/docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | sut: 2 | build: . 3 | command: sh -c '(qbittorrent-nox &) && sleep 5 && curl --max-time 10 --retry 10 --retry-max-time 60 --retry-connrefused --connect-timeout 5 --silent --show-error --fail http://localhost:8080/ >/dev/null || exit 1' 4 | -------------------------------------------------------------------------------- /latest/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Default configuration file 4 | if [ ! -f /config/qBittorrent.conf ] 5 | then 6 | cp /default/qBittorrent.conf /config/qBittorrent.conf 7 | fi 8 | 9 | # Allow groups to change files. 10 | umask 002 11 | 12 | exec "$@" 13 | -------------------------------------------------------------------------------- /stable/docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | sut: 2 | build: . 3 | command: sh -c '(qbittorrent-nox &) && sleep 5 && curl --max-time 10 --retry 10 --retry-max-time 60 --retry-connrefused --connect-timeout 5 --silent --show-error --fail http://localhost:8080/ >/dev/null || exit 1' 4 | -------------------------------------------------------------------------------- /stable/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Default configuration file 4 | if [ ! -f /config/qBittorrent.conf ] 5 | then 6 | cp /default/qBittorrent.conf /config/qBittorrent.conf 7 | fi 8 | 9 | # Allow groups to change files. 10 | umask 002 11 | 12 | exec "$@" 13 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | latest: 5 | image: docker.io/wernight/qbittorrent:latest 6 | build: 7 | context: latest 8 | stable: 9 | image: docker.io/wernight/qbittorrent:stable 10 | build: 11 | context: stable 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Werner Beroux 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /stable/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://hub.docker.com/_/debian 2 | FROM debian:bookworm-slim 3 | 4 | RUN set -x \ 5 | # Install qBittorrent-NoX 6 | && apt-get update \ 7 | && apt-get install -y qbittorrent-nox dumb-init curl \ 8 | && apt-get clean \ 9 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 10 | 11 | RUN set -x \ 12 | # Add non-root user 13 | && useradd --system --uid 520 -m --shell /usr/sbin/nologin qbittorrent \ 14 | # Create symbolic links to simplify mounting 15 | && mkdir -p /home/qbittorrent/.config/qBittorrent \ 16 | && chown qbittorrent:qbittorrent /home/qbittorrent/.config/qBittorrent \ 17 | && ln -s /home/qbittorrent/.config/qBittorrent /config \ 18 | \ 19 | && mkdir -p /home/qbittorrent/.local/share/data/qBittorrent \ 20 | && chown qbittorrent:qbittorrent /home/qbittorrent/.local/share/data/qBittorrent \ 21 | && ln -s /home/qbittorrent/.local/share/data/qBittorrent /torrents \ 22 | \ 23 | && mkdir /downloads \ 24 | && chown qbittorrent:qbittorrent /downloads \ 25 | # Check it works 26 | && su qbittorrent -s /bin/sh -c 'qbittorrent-nox -v' 27 | 28 | 29 | # Default configuration file. 30 | COPY qBittorrent.conf /default/qBittorrent.conf 31 | COPY entrypoint.sh / 32 | 33 | VOLUME ["/config", "/torrents", "/downloads"] 34 | 35 | ENV HOME=/home/qbittorrent 36 | 37 | USER qbittorrent 38 | 39 | EXPOSE 8080 6881 40 | 41 | ENTRYPOINT ["dumb-init", "/entrypoint.sh"] 42 | CMD ["qbittorrent-nox"] 43 | 44 | HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD curl --connect-timeout 15 --silent --show-error --fail http://localhost:8080/ >/dev/null || exit 1 45 | -------------------------------------------------------------------------------- /latest/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://hub.docker.com/_/alpine 2 | FROM alpine:3.20 3 | 4 | # Install required packages 5 | RUN apk add --no-cache \ 6 | boost \ 7 | ca-certificates \ 8 | curl \ 9 | dumb-init \ 10 | icu \ 11 | libtool \ 12 | openssl \ 13 | python3 \ 14 | qt6-qtbase \ 15 | qt6-qtsvg \ 16 | qt6-qttools \ 17 | re2c \ 18 | zlib 19 | 20 | # Compiling qBitTorrent following instructions on 21 | # https://github.com/qbittorrent/qBittorrent/wiki/Compilation-Alpine-Linux 22 | RUN set -x \ 23 | # 24 | # Install build dependencies 25 | && apk add --no-cache -t .build-deps \ 26 | autoconf \ 27 | automake \ 28 | boost-dev \ 29 | build-base \ 30 | cmake \ 31 | git \ 32 | jq \ 33 | libtool \ 34 | linux-headers \ 35 | ninja-build \ 36 | ninja-is-really-ninja \ 37 | perl \ 38 | pkgconf \ 39 | python3 \ 40 | python3-dev \ 41 | re2c \ 42 | tar \ 43 | icu-dev \ 44 | openssl-dev \ 45 | qt6-qtbase-dev \ 46 | qt6-qttools-dev \ 47 | zlib-dev \ 48 | qt6-qtsvg-dev \ 49 | xz \ 50 | # 51 | # Boost 52 | # https://github.com/boostorg/boost/releases 53 | && mkdir -p ~/boost-dev \ 54 | && curl -L https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-b2-nodocs.tar.xz | tar xJf - --strip-components=1 -C ~/boost-dev \ 55 | # 56 | # Libtorrent 57 | && git clone --shallow-submodules --recurse-submodules https://github.com/arvidn/libtorrent.git /tmp/libtorrent \ 58 | && cd /tmp/libtorrent \ 59 | && git checkout "$(git tag -l --sort=-v:refname | awk '/v2/' | head -1)" \ 60 | && cmake -Wno-dev -G Ninja -B build \ 61 | -D CMAKE_BUILD_TYPE="Release" \ 62 | -D CMAKE_CXX_STANDARD=20 \ 63 | -D BOOST_INCLUDEDIR="$HOME/boost-dev/" \ 64 | -D CMAKE_INSTALL_LIBDIR="lib" \ 65 | -D CMAKE_INSTALL_PREFIX="/usr/local" \ 66 | && cmake --build build \ 67 | && cmake --install build \ 68 | # 69 | # Build qBittorrent 70 | && git clone --shallow-submodules --recurse-submodules https://github.com/qbittorrent/qBittorrent.git /tmp/qbittorrent \ 71 | && cd /tmp/qbittorrent \ 72 | && git checkout "$(git tag -l --sort=-v:refname | awk '!/[0-9][a-zA-Z]/' | head -1)" \ 73 | && cmake -Wno-dev -G Ninja -B build \ 74 | -D CMAKE_BUILD_TYPE="release" \ 75 | -D CMAKE_CXX_STANDARD=20 \ 76 | -D BOOST_INCLUDEDIR="$HOME/boost-dev/" \ 77 | -D CMAKE_INSTALL_PREFIX="/usr/local" \ 78 | -D GUI=OFF \ 79 | && cmake --build build \ 80 | && cmake --install build \ 81 | # 82 | # Clean-up 83 | && cd / \ 84 | && apk del --purge .build-deps \ 85 | && rm -rf ~/boost-dev/ \ 86 | && rm -rf /tmp/* 87 | 88 | RUN set -x \ 89 | # Add non-root user 90 | && adduser -S -D -u 520 -g 520 -s /sbin/nologin qbittorrent \ 91 | # Create symbolic links to simplify mounting 92 | && mkdir -p /home/qbittorrent/.config/qBittorrent \ 93 | && mkdir -p /home/qbittorrent/.local/share/qBittorrent \ 94 | && mkdir /downloads \ 95 | && chmod go+rw -R /home/qbittorrent /downloads \ 96 | && ln -s /home/qbittorrent/.config/qBittorrent /config \ 97 | && ln -s /home/qbittorrent/.local/share/qBittorrent /torrents \ 98 | # Check it works 99 | && su qbittorrent -s /bin/sh -c 'qbittorrent-nox -v' 100 | 101 | # Default configuration file. 102 | COPY qBittorrent.conf /default/qBittorrent.conf 103 | COPY entrypoint.sh / 104 | 105 | VOLUME ["/config", "/torrents", "/downloads"] 106 | 107 | ENV HOME=/home/qbittorrent 108 | 109 | USER qbittorrent 110 | 111 | EXPOSE 8080 6881 112 | 113 | ENTRYPOINT ["dumb-init", "/entrypoint.sh"] 114 | CMD ["qbittorrent-nox"] 115 | 116 | HEALTHCHECK --interval=5s --timeout=2s --retries=20 CMD curl --connect-timeout 15 --silent --show-error --fail http://localhost:8080/ >/dev/null || exit 1 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Supported tags and respective `Dockerfile` links 2 | ================================================ 3 | 4 | * [`latest` is the latest release built from source code on Alpine Linux (currently >4.1.x)](https://github.com/wernight/docker-qbittorrent/blob/master/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 5 | * [`stable` is the latest packaged stable Debian packaged version (currently 3.3.x)](https://github.com/wernight/docker-qbittorrent/blob/stable/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:stable.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 6 | * [`4`, `4.2`, `4.2.5` tagged version built from source code (based on Alpine)](https://github.com/wernight/docker-qbittorrent/blob/v4.2.5/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:4.2.5.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 7 | * [`4.1`, `4.1.0` tagged version built from source code (based on Alpine)](https://github.com/wernight/docker-qbittorrent/blob/v4.1.0/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:4.1.0.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 8 | * [`3`, `3.3`, `3.3.13` tagged version built from source code (based on Alpine)](https://github.com/wernight/docker-qbittorrent/blob/v3.3.13/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:3.3.13.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 9 | * [`3.3.7` tagged version built from source code (based on Alpine)](https://github.com/wernight/docker-qbittorrent/blob/v3.3.7/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:3.3.7.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 10 | * [`3.3.3` tagged version built from source code (based on Debian)](https://github.com/wernight/docker-qbittorrent/blob/v3.3.3/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:3.3.3.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 11 | * [`3.3.1` tagged version built from source code (based on Debian)](https://github.com/wernight/docker-qbittorrent/blob/v3.3.1/Dockerfile) [![](https://images.microbadger.com/badges/image/wernight/qbittorrent:3.3.1.svg)](http://microbadger.com/images/wernight/qbittorrent "Get your own image badge on microbadger.com") 12 | 13 | 14 | What is qBittorrent? 15 | ==================== 16 | 17 | [qBittorrent](http://www.qbittorrent.org/) NoX is the headless with remote web interface version of qBittorrent BitTorrent client. 18 | 19 | ![qBittorrent logo](https://github.com/wernight/docker-qbittorrent/blob/master/docs/qbittorrent-logo.png?raw=true) 20 | 21 | 22 | How to use this image 23 | ===================== 24 | 25 | This image is: 26 | 27 | * **Small**: `:latest` is based on official [Alpine](https://registry.hub.docker.com/_/alpine/) Docker image. 28 | * **Simple**: Exposes correct ports, configured for remote access... 29 | * **Secure**: Runs as non-root user with random UID/GID `520`, and handles correctly PID 1 (using dumb-init). 30 | 31 | Usage 32 | ----- 33 | 34 | All mounts and ports are optional and qBittorrent will work even with only: 35 | 36 | $ docker run wernight/qbittorrent 37 | 38 | ... however that way some ports used to connect to peers are not exposed, accessing the 39 | web interface requires you to proxy port 8080, and all settings as well as downloads will 40 | be lost if the container is removed. So start it using this command: 41 | 42 | $ mkdir -p config torrents downloads 43 | $ docker run -d --user $UID:$GID \ 44 | -p 8080:8080 -p 6881:6881/tcp -p 6881:6881/udp \ 45 | -v $PWD/config:/config \ 46 | -v $PWD/torrents:/torrents \ 47 | -v $PWD/downloads:/downloads \ 48 | wernight/qbittorrent 49 | 50 | ... to run as yourself and have WebUI running on [http://localhost:8080](http://localhost:8080) 51 | (username: `admin`, password: `adminadmin`) with config in the following locations mounted: 52 | 53 | * `/config`: qBittorrent configuration files 54 | * `/torrents`: Torrent files 55 | * `/downloads`: Download location 56 | 57 | Note: By default it runs as UID 520 and GID 520, but can run as any user/group. 58 | 59 | It is probably a good idea to add `--restart=always` so the container restarts if it goes down. 60 | 61 | You can change `6881` to some random port number (also change in the settings). 62 | 63 | _Note: For the container to run, the legal notice had to be automatically accepted. By running the container, you are accepting its terms. Toggle the flag in `qBittorrent.conf` to display the notice again._ 64 | 65 | _Note: `520` was chosen randomly to prevent running as root or as another known user on your system; at least until [issue #11253](https://github.com/docker/docker/pull/11253) is fixed._ 66 | 67 | Image Variants 68 | -------------- 69 | 70 | ### `wernight/qbittorrent:latest` 71 | 72 | Latest release of qBittorrent (No X) compiled on Alpine Linux from source code. 73 | 74 | ### `wernight/qbittorrent:` 75 | 76 | Those are tagged versions built from source code. Older versions are based on Debian while newer ones are based on Alpine Linux (just like `:latest`). 77 | 78 | ### `wernight/qbittorrent:stable` 79 | 80 | Works like `:latest` but based on Debian using only the package manager to install it. It's **more tested**, by Debian and package manager, but the image is *larger* than the one based on Alpine and it's an *older* version. 81 | 82 | 83 | User Feedbacks 84 | ============== 85 | 86 | Having more issues? [Report a bug on GitHub](https://github.com/wernight/docker-qbittorrent/issues). 87 | --------------------------------------------------------------------------------