# Self-host Grafana Loki

> A horizontally scalable log aggregation system that indexes labels, not full text, to keep storage cheap.

- Page: https://levelrail.com/templates/loki/
- JSON: https://levelrail.com/templates/loki.json
- Category: Monitoring
- Licence: AGPL-3.0-only (Network copyleft (AGPL) license)
- Source: https://github.com/grafana/loki
- Upstream docs: https://grafana.com/docs/loki/latest

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: tested
- Needs configuration before start: no
- Pinned image tag: 3.7.8

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| loki | grafana/loki | 3.7.8 | 3100 | loki_data -> /loki |

## Deploy

### CLI

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

### API

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

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

## Questions

### Can I deploy Grafana Loki 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 Loki, 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/loki:3.7.8 is what you deploy there.

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