# Self-host Grafana Mimir

> Horizontally scalable long term storage for Prometheus metrics, run here as one process on local disk. The install form carries mimir.yaml as an editable file.

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

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 3.2.4

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| mimir | grafana/mimir | 3.2.4 | 9009 | data -> /data |

## Deploy

### CLI

```bash
levelrail-cli templates install mimir --name my-mimir
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain mimir=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/mimir/install \
  -d '{
    "name": "my-mimir"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Point a Prometheus remote_write at /api/v1/push on this address and add the same address with /prometheus as a data source in Grafana.

## Questions

### Can I deploy Grafana Mimir 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 Mimir, 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/mimir:3.2.4 is what you deploy there.

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