Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsAdd-ons

qBittorrent Exporter

Build and run the Prometheus exporter for qBittorrent as a systemd or OpenRC service.

qbittorrent-exporter.sh downloads the martabal/qbittorrent-exporter release source, builds it with Go and runs it against one qBittorrent instance.

Run itOn any system that can reach qBittorrent's web UI, usually the qBittorrent container. The script has no Proxmox VE host check
Supported OSDebian, Ubuntu (ID=debian or ID=ubuntu in /etc/os-release) and Alpine. Anything else exits with code 238
Port8090
Sourcetools/addon/qbittorrent-exporter.sh

Run

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/qbittorrent-exporter.sh)"

Prompts

PromptAnswer
Install qBittorrent-Exporter? (y/N):y installs. Anything else exits
Enter URL of qBittorrent, example: (http://127.0.0.1:8080):Written as QBITTORRENT_BASE_URL
Enter qBittorrent API key:Written as QBITTORRENT_API_KEY. Create the key in qBittorrent under Tools > Options > Web UI > API key

When /opt/qbittorrent-exporter/qbittorrent-exporter already exists:

PromptAnswer
Uninstall qBittorrent-Exporter? (y/N):y removes it
Update qBittorrent-Exporter? (y/N):y updates. Anything else exits with No action selected
Enter your qBittorrent API key (or press Enter to abort):Only during an update to version 2.0.0 or newer when the configuration has no QBITTORRENT_API_KEY. Empty aborts the update

What it creates

ItemValue
ToolchainGo through setup_go
Application/opt/qbittorrent-exporter, with the built binary /opt/qbittorrent-exporter/qbittorrent-exporter
Configuration/opt/qbittorrent-exporter.env with QBITTORRENT_BASE_URL and QBITTORRENT_API_KEY
Serviceqbittorrent-exporter (systemd unit /etc/systemd/system/qbittorrent-exporter.service, or OpenRC script /etc/init.d/qbittorrent-exporter on Alpine, logging to /var/log/qbittorrent-exporter.log), runs as root
Update helper/usr/local/bin/update_qbittorrent-exporter
Metricshttp://<ip>:8090/metrics

The configuration file holds the API key in plain text. Restart the service after editing it.

Update

Run update_qbittorrent-exporter, answer y to the update prompt, or let the container's update command offer it (see how update finds add-ons). If a newer release exists, the service is stopped, the source is downloaded and rebuilt, and the service is started.

Version 2.0.0 replaced username and password with an API key. When the new release is 2.0.0 or newer and the configuration still has no QBITTORRENT_API_KEY, the update asks for one, removes QBITTORRENT_USERNAME and QBITTORRENT_PASSWORD from the configuration and adds the key. An empty answer ends the update without changing anything.

Remove

The uninstall prompt stops and removes the service and deletes /opt/qbittorrent-exporter, /opt/qbittorrent-exporter.env and the update helper. Go stays installed.

Limits

  • The metrics port is not written to the configuration; 8090 is the address the script prints after the install.