qBittorrent WebUI Prometheus Metrics Exporter
  • TypeScript 97.6%
  • Dockerfile 2.4%
Find a file
2026-07-05 23:48:30 +03:00
src initial commit 2026-07-05 23:12:26 +03:00
.gitignore initial commit 2026-07-05 23:12:26 +03:00
Dockerfile initial commit 2026-07-05 23:12:26 +03:00
package.json initial commit 2026-07-05 23:12:26 +03:00
pnpm-lock.yaml initial commit 2026-07-05 23:12:26 +03:00
readme.md add port mapping and fix indentation in readme 2026-07-05 23:48:30 +03:00
tsconfig.json initial commit 2026-07-05 23:12:26 +03:00

Prometheus Exporter for qBittorrent

Running

Create .env and fill it's contents like shown below:

QBIT_WEBUI_URL=<Your qBittorrent WebUI URL (with schema)>
QBIT_WEBUI_USER=<WebUI username>
QBIT_WEBUI_PASSWORD=<WebUI password>

Example with actual values:

QBIT_WEBUI_URL=http://192.168.67.15:8080
QBIT_WEBUI_USER=admin
QBIT_WEBUI_PASSWORD=qwerty12345

Then run:

pnpm build && pnpm start

Exporter will now listen on port 9167 by default on all interfaces

You can go to your browser and check the metrics at http://127.0.0.1:9167/metrics

After running you can setup your prometheus like with any other exporter:

# assuming you are running both prometheus and this exporter on the same machine
# without containers and etc. otherwise change the target address

...
scrape_configs:
    ...
  - job_name: 'qbittorrent'
    scrape_interval: 15s
    scrape_timeout: 15s
    static_configs:
      - targets: ['127.0.0.1:9167']

Docker

Build the image

sudo docker buildx build -t qbt_exporter:0.0.1 .

Run non-persistent container for testing


sudo docker run --rm --env-file .env -p 9167:9167 -it qbt_exporter:0.0.1

Persistent setup with compose (build the image before running)

  1. Create compose.yaml with following content:
    services:
      qbt_exporter:
        image: qbt_exporter:0.0.1
        restart: always
        ports:
          - "9167:9167"
        env_file:
          - ./.env
        deploy:
          resources:
            limits:
            memory: 256M
    
  2. Start your deployment:
    sudo docker compose up -d