1) Download Pushgateway
Download the latest Pushgateway release from the official GitHub Releases page:
2) Extract and run (quick test)
After downloading the release tarball on your server, extract it and change into the extracted directory:pushgateway binary directly; it listens on port 9091 by default:
3) Install as a systemd service (recommended for production)
Run Pushgateway under systemd to ensure it starts on boot and is managed consistently. Create a dedicated system user and install the binary:/etc/systemd/system/pushgateway.service with the following content:
Quick reference: common commands and locations
If your server has a firewall (for example
ufw or firewalld), ensure port 9091 is open for Prometheus scrapes or only allow access from Prometheus servers. Running services as root is not recommended — the example above uses a dedicated unprivileged pushgateway user.4) Configure Prometheus to scrape Pushgateway
Add Pushgateway as a scrape target in yourprometheus.yml. In many setups you should enable honor_labels: true so label values pushed by clients (for example job and instance) are preserved in Prometheus instead of being replaced by the Pushgateway scrape labels.
Example prometheus.yml snippet:
Use
honor_labels: true when multiple jobs push metrics to Pushgateway and you want the original job and instance labels from the pushing clients to be preserved in Prometheus. Without this, Prometheus will overwrite those labels with the Pushgateway’s own scrape labels.5) Verify end-to-end
- Push a sample metric from a client (example using curl):
- Confirm metrics are visible on Pushgateway:
- Confirm Prometheus scrapes the Pushgateway and the metric appears in Prometheus targets and in PromQL queries (use the Prometheus UI at
/targetsand/graph).
Troubleshooting tips
- If metrics don’t appear in Prometheus:
- Verify
prometheus.ymlhas the correct address and that Prometheus has reloaded. - Check
honor_labelsbehavior — it may affect label attribution. - Confirm network/firewall rules allow Prometheus to reach port
9091.
- Verify
- Check logs:
- Pushgateway logs:
journalctl -u pushgateway - Prometheus logs:
journalctl -u prometheusor view Prometheus UI logs.
- Pushgateway logs:
Links and references
- Prometheus Pushgateway Releases: https://github.com/prometheus/pushgateway/releases
- Prometheus documentation: https://prometheus.io/docs/