# Self-host Pushgateway

> A Prometheus Pushgateway that holds metrics pushed by short-lived batch jobs so a Prometheus server can scrape them. Pushed groups are kept on a persistent volume.

- Page: https://levelrail.com/templates/pushgateway/
- JSON: https://levelrail.com/templates/pushgateway.json
- Category: Monitoring
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/prometheus/pushgateway
- Upstream docs: https://prometheus.io/docs/practices/pushing/

## Requirements
- Memory: about 64 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: v1.11.4

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| pushgateway | prom/pushgateway | v1.11.4 | 9091 | pushgateway_data -> /data |

## Deploy

### CLI

```bash
levelrail-cli templates deploy pushgateway --name my-pushgateway
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/pushgateway/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Push metrics from jobs to /metrics/job/NAME and add pushgateway:9091 as a Prometheus scrape target.

## Questions

### Can I deploy Pushgateway on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Pushgateway, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image prom/pushgateway:v1.11.4 is what you deploy there.

Self-host Pushgateway, Pushgateway docker compose file, deploy Pushgateway on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
