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

Prometheus Paperless-NGX Exporter

Install the Prometheus exporter for Paperless-NGX from its release package as a systemd service.

prometheus-paperless-ngx-exporter.sh installs the hansmi/prometheus-paperless-exporter release package and runs it against one Paperless-NGX instance through its REST API.

Run itOn any system that can reach your Paperless-NGX server. The script has no Proxmox VE host check
Supported OSDebian or Ubuntu (require_debian_like: Alpine and systems without apt-get exit with code 238)
Port8081
Sourcetools/addon/prometheus-paperless-ngx-exporter.sh

Run

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

Prompts

PromptAnswer
Install Prometheus-Paperless-NGX-Exporter? (y/N):y installs. Anything else exits
Enter URL of Paperless-NGX, example: (http://127.0.0.1:8000):Written as PAPERLESS_URL
Enter Paperless-NGX authentication token:Hidden input, written to the token file

When /usr/bin/prometheus-paperless-exporter already exists:

PromptAnswer
Uninstall Prometheus-Paperless-NGX-Exporter? (y/N):y removes it
Update Prometheus-Paperless-NGX-Exporter? (y/N):y updates. Anything else exits with No action selected

What it creates

ItemValue
Binary/usr/bin/prometheus-paperless-exporter, from the release package
Configuration/etc/prometheus-paperless-ngx-exporter/config.env with PAPERLESS_URL
Token/etc/prometheus-paperless-ngx-exporter/paperless_auth_token_file (mode 600)
Serviceprometheus-paperless-ngx-exporter (/etc/systemd/system/prometheus-paperless-ngx-exporter.service), runs as root
Update helper/usr/local/bin/update_prometheus-paperless-ngx-exporter
Metricshttp://<ip>:8081/metrics

The service starts the exporter with a fixed set of options:

  • --paperless_header 'Accept: application/json; version=9'
  • --collectors=tag,correspondent,document_type,storage_path,task,log,group,user,status,statistics

Update

Run update_prometheus-paperless-ngx-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 new package is installed. In every case the systemd unit is rewritten with the current options and the service is restarted, so an update run also refreshes the service when no new release exists. Changes you made to the unit file are replaced.

Remove

The uninstall prompt stops and disables the service, removes the prometheus-paperless-exporter package and deletes the service file, /etc/prometheus-paperless-ngx-exporter and the update helper.

Limits

  • The metrics port is not set by the script; 8081 is the address it prints after the install.