# Self-host Grafana Alloy

> A telemetry collector that scrapes metrics and ships them to Prometheus-compatible, Loki or Tempo backends. This starts with a small pipeline that scrapes its own metrics and logs them; edit the config to forward data elsewhere.

- Page: https://levelrail.com/templates/grafana-alloy/
- JSON: https://levelrail.com/templates/grafana-alloy.json
- Category: Monitoring
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/grafana/alloy
- Upstream docs: https://grafana.com/docs/alloy/latest/

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

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| alloy | grafana/alloy | v1.21.3 | 12345 | alloy_data -> /var/lib/alloy/data |

## Deploy

### CLI

```bash
levelrail-cli templates deploy grafana-alloy --name my-grafana-alloy
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/grafana-alloy/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. Open the page to see the component graph, then replace the config with your own pipeline and redeploy.

## Questions

### Can I deploy Grafana Alloy 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 Grafana Alloy, 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 grafana/alloy:v1.21.3 is what you deploy there.

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