Grafana Loki
Log aggregation server by Grafana Labs that indexes only labels and stores compressed log chunks, queried with LogQL from Grafana. Runs here as one container with filesystem storage. Fits one server or a small fleet that wants its container and system logs searchable in one place.
Resources by load level
What the app itself needs at each level, next to what we recommend for a server that runs only this app.
| Level | What it means | App requirements | Recommended |
|---|---|---|---|
| LightEstimate | Up to 1 GB of logs a day from one server and its containers, up to 500 active streams, a few people querying the last 30 days from Grafana. | 0.5 vCPU · 1 GiB RAM · 6.361 GiB disk | 0.72 vCPU · 2.7 GiB RAM · 16.631 GiB disk |
| MediumEstimate | Up to 5 GB of logs a day from a few servers, up to 2,000 active streams, dashboards and alert rules querying Loki through the day. | 1 vCPU · 2 GiB RAM · 31.027 GiB disk | 1.32 vCPU · 3.9 GiB RAM · 44.997 GiB disk |
| HeavyEstimate | Up to 20 GB of logs a day, the docs' ceiling for monolithic mode, up to 5,000 active streams (the default per-tenant limit), heavy LogQL use. | 2 vCPU · 4 GiB RAM · 123.527 GiB disk | 2.52 vCPU · 6.3 GiB RAM · 151.372 GiB disk |
Recommended = app requirements + system baseline + safety headroom, under sizing policy 2026.10.0. Options stay at their defaults. “Estimate” means the sources give no number for that case, so it is worked out from them by the method stated under Components. How the numbers are built
Ready-to-run files
Support level Supported
Compose template from the official sources; not yet verified by a run.
Components
What each component needs at each load level, before baseline and headroom.
| Component | Light | Medium | Heavy | Sources |
|---|---|---|---|---|
| Loki (app) | 0.5 / 1 / 6.361 | 1 / 2 / 31.027 | 2 / 4 / 123.527 | [7][10][11][26][28] |
How the estimates are worked out
- Loki · Light: No monolithic sizing upstream. RAM: two hours (max_chunk_age) of 1 GB/day is 0.083 GB of open chunks, plus the 100 MB results cache and the Go runtime of all components → 1 GiB. vCPU: gzip of about 12 KB/s and short LogQL queries → half a core. Disk: image 0.194 GiB (0.045 compressed + 0.149 unpacked, both kept by the containerd store) + 30 days × 1 GB / 5 (assumed gzip ratio) = 6 + WAL 2 h of ingest × 2 = 0.167 → 6.361; GB taken as GiB.
- Loki · Medium: RAM: two hours of 5 GB/day is 0.417 GB of open chunks, plus the 100 MB results cache and up to 4 concurrent queries (querier max_concurrent) → 2 GiB. vCPU: one core for compression and dashboard queries over a few days of data. Disk: image 0.194 GiB (0.045 compressed + 0.149 unpacked, both kept by the containerd store) + 30 days × 5 GB / 5 (assumed gzip ratio) = 30 + WAL 2 h of ingest × 2 = 0.833 → 31.027; GB taken as GiB.
- Loki · Heavy: RAM: two hours of 20 GB/day is 1.667 GB of open chunks, plus cache and 4 concurrent queries → 4 GiB, one ingester request of the docs' smallest microservices tier (2 CPU, 4 Gi). vCPU: 2, the same request; the docs warn queries can need 10× more. Disk: image 0.194 GiB (0.045 compressed + 0.149 unpacked, both kept by the containerd store) + 30 days × 20 GB / 5 (assumed gzip ratio) = 120 + WAL 2 h of ingest × 2 = 3.333 → 123.527; GB taken as GiB.
Ports
Public ports are meant to be reached from outside the stack, usually through a reverse proxy; internal ones stay on the stack's own network.
User and permissions (UID/GID)
The user each container's process runs as, and the paths it writes to. A bind mount for one of these paths must be writable by that UID:GID.
Storage growth
How much each component's data grows per month at each load level, on top of the disk in the profile. A value marked Assumption is ANAROQ's stated assumption, not a figure from the sources; the notes say what it rests on.
What the growth figures rest on
- Loki: Retention is off by default, so Loki keeps every log and never deletes by free space: 30 days × 1 GB/day / 5 (assumed gzip ratio; chunk_encoding gzip) = 6 GiB a month, without end. With compactor retention on, disk levels off at about one retention period.
- Loki: Retention is off by default, so Loki keeps every log and never deletes by free space: 30 days × 5 GB/day / 5 (assumed gzip ratio; chunk_encoding gzip) = 30 GiB a month, without end. With compactor retention on, disk levels off at about one retention period.
- Loki: Retention is off by default, so Loki keeps every log and never deletes by free space: 30 days × 20 GB/day / 5 (assumed gzip ratio; chunk_encoding gzip) = 120 GiB a month, without end. With compactor retention on, disk levels off at about one retention period.
Upgrade and rollback
How to move to a new version safely, and how to go back if it fails.
Back up first
Stop Loki (docker compose stop loki), then copy the whole /loki volume with a helper container, for example docker run --rm -v <volume>:/loki:ro -v "$PWD":/backup alpine tar czf /backup/loki.tgz -C /loki . The Loki image has no shell or tar. [2][14][15]DerivedUpstream documents no backup procedure for the filesystem store. Every data path (chunks, TSDB index, WAL, compactor) is under path_prefix /loki, and BusyBox was removed from the image in 3.5.8, so the copy runs outside it.
Upgrade steps
- Read the upgrade guide and the release notes of every version you cross; upstream advises sequential upgrades and testing skipped versions first. Then back up /loki, set the new pinned tag and run docker compose pull and docker compose up -d. [15][16]
- With your own config file, check it first: run the new image with -config.file=<your file> -verify-config=true, or diff -print-config-stderr of the old and new tags, as the upgrade guide shows. [15]
- After the start, Loki replays its WAL; wait until the container is healthy (loki -health on /ready) and check docker compose logs loki before relying on it. [5][7][8]
Roll back
Stop the stack, restore the /loki copy taken before the upgrade into the volume, pin the previous tag and run docker compose up -d. Logs received after the backup are lost. [15]DerivedThe upgrade guide covers upgrades only, not downgrades; an older binary on index and WAL files written by a newer one is not documented as safe, while the pre-upgrade copy is.
Known breaking changes
- In 3.7.3: Promtail was removed from the Loki project (end of life on March 2, 2026). Move log shipping to Grafana Alloy; alloy convert turns a Promtail config into an Alloy config. [16][18][19]
- In 3.7.0: Labels extracted by parsers in a query (json, logfmt) no longer override structured metadata with the same name; queries that relied on that return different results. [16]
- In 3.6.0: The built-in Loki UI moved to a Grafana plugin (Loki Operational UI); Loki now serves only the APIs the plugin uses. [17]
- In 3.5.8: BusyBox was removed from the image: no /bin/sh, ls or wget, so docker exec … sh and shell or wget healthchecks fail. Use docker cp, a helper container, or loki -health (3.7+). [5][15]
- In 3.0.0: Structured metadata is on by default and needs the tsdb index with schema v13, or Loki will not start; migrate to TSDB first. New limits: 256 KB per line, 15 labels per series; a service_name label is added; retention needs delete_request_store. [15]
Limits
- The template is the Loki server only; something must send it logs. Promtail is end of life: use Grafana Alloy (loki.write to http://loki:3100/loki/api/v1/push; reading container logs needs the Docker socket, so it is not templated), the Loki Docker logging driver, or OTLP at /otlp/v1/logs. [8][18][19][20][24]
- Each app in a generated file gets its own internal network, so Grafana in the same file cannot reach Loki yet: add loki-internal to the networks of the grafana service, then use http://loki:3100 as the Loki data source URL. [3][8]
- The Docker logging driver runs inside the Docker daemon on the host, not on the Compose network: install grafana/loki-docker-driver:3.7.8-amd64 (or -arm64), turn on publish-loopback and set loki-url to http://127.0.0.1:3100/loki/api/v1/push. [21][22][23]
- Retention is off: Loki keeps every log forever and does not delete when the disk fills. To cap it, enable compactor retention, for example by adding -compactor.retention-enabled=true -compactor.delete-request-store=filesystem -store.retention=744h after -config.file=/etc/loki/local-config.yaml in command. [7][12][13]
- Monolithic mode with the filesystem store suits up to about 20 GB/day on one server. Grafana Labs does not support the filesystem store in production; there is no high availability, durability is the disk's, and millions of chunk files in one directory cause trouble. [10][12]
- Default limits per tenant: 4 MB/s ingestion (6 MB burst), 5,000 active streams, 256 KB per line, 15 labels per series, and entries older than one week are rejected. Keep labels few and low-cardinality. [7][15]
- The config is baked into the image and the image has no shell. To change it beyond command-line flags, mount your own file and point -config.file at it, as the Docker install docs do. [1][4][15]
Security
- Loki has no authentication (auth_enabled false, one tenant): anyone who reaches port 3100 can read every log and push new ones. Keep it on the internal network; publish-loopback maps it on 127.0.0.1 only. Agents on other hosts need an authenticating reverse proxy or mTLS in front. [2][9]
- Logs often hold tokens, IP addresses and personal data. Whoever can query Loki or its Grafana sees them, so limit Grafana access, drop sensitive lines in the agent, and set a retention period. [9][13]
- By default Loki sends anonymous usage statistics to stats.grafana.org. To turn it off, add -reporting.enabled=false to the command, or set analytics.reporting_enabled: false in your own config. [2][7]
- The image runs as the non-root user loki (10001:10001) on a distroless base with no shell. A named volume works as is; a bind mount must be owned by 10001, or run with --user. [1][4][6]
Backup
- Everything Loki stores is in the /loki volume: chunks (under fake/ in single-tenant mode), the TSDB index, the WAL, the compactor's files and rules. Copy it with Loki stopped, from a helper container, since the image has no shell. [2][12][14]
- Decide whether the logs are worth backing up: often only the config matters, and old logs can be dropped by retention. Keep any config file or command-line flags you added with your Compose file. [4][13]
Latest release
- Newest upstream release
- Grafana Loki 3.7.8 [27]
- This profile was checked against
Grafana Loki 3.7.8
This profile was checked against the newest release.
- Checked on
- 14 Oct 2026
- State
- Checked within the last 90 days
- Where releases are published
- Docker Hub tags
Version
- Profile status
- Published
- Checked against release
- Grafana Loki 3.7.8
- Profile version
- 1.0.0
- Figures verified
- 14 Oct 2026
- Catalog release
- 2026.10.10
- Sizing policy
- 2026.10.0
- Compose file
- Unverified
Project and alternatives
- Official site
- grafana.com/oss/loki/
- Source code
- github.com/grafana/loki
Sources
- cmd/loki/Dockerfile at v3.7.8: distroless static:nonroot base, loki-docker-config.yaml copied to /etc/loki/local-config.yaml, /loki owned by 10001, USER 10001, EXPOSE 3100 (Official repository · read 14 Oct 2026)
- cmd/loki/loki-docker-config.yaml at v3.7.8 (the image's default config): auth_enabled false, http 3100, path_prefix /loki, filesystem chunks, tsdb v13 with 24h index (Official repository · read 14 Oct 2026)
- production/docker-compose.yaml at v3.7.8: grafana/loki:latest with 3100:3100 and the default config, no volume; Promtail and Grafana (datasource http://loki:3100) (Official Compose · read 14 Oct 2026)
- Loki docs at v3.7.8: Install Loki with Docker (single binary, runs as loki UID/GID 10001, -p 3100:3100, readiness at /ready) (Official docs · read 14 Oct 2026)
- cmd/loki/health.go at v3.7.8: loki -health requests http://localhost:3100/ready with a 5 s timeout; exit 0 on HTTP 200, else 1 (Official repository · read 14 Oct 2026)
- Registry config of grafana/loki:3.7.8 (linux/amd64): User 10001, ExposedPorts 3100/tcp, no Volumes, no Healthcheck, Entrypoint /usr/bin/loki, Cmd -config.file=/etc/loki/local-config.yaml (Measurement · read 14 Oct 2026)
- Loki configuration reference at v3.7.8: grpc_listen_port 9095, retention_enabled false, retention_period 0s (-store.retention), reporting_enabled true, ingestion and chunk defaults (Official docs · read 14 Oct 2026)
- Loki HTTP API reference at v3.7.8: POST /loki/api/v1/push, POST /otlp/v1/logs, GET /ready (HTTP 200 when ready for traffic) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Manage authentication (no built-in authentication layer; run an authenticating reverse proxy in front) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Deployment modes (monolithic = -target=all, one process; for small read/write volumes of up to about 20 GB per day) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Size the cluster (microservices mode only; smallest tier under 3 TB/day: ingester 2 CPU and 4 Gi each) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Filesystem object store (not supported for production by Grafana Labs, no HA, no deletion by free space, chunk file count limits) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Log retention (off by default, logs live forever; compactor retention_enabled, delete_request_store, retention_period, 24h index) (Official docs · read 14 Oct 2026)
- pkg/loki/config_wrapper.go at v3.7.8: with common.path_prefix, the WAL, compactor, rules-temp and TSDB directories default to paths under it (Official repository · read 14 Oct 2026)
- Loki docs at v3.7.8: Upgrade guide (3.6 AWS SDK v2, 3.5.8 BusyBox removed, 3.0 tsdb and v13 for structured metadata, new limits; -print-config-stderr diff) (Official docs · read 14 Oct 2026)
- Loki v3.7 release notes (loki health command #20313; Promtail removed as of 3.7.3; breaking: parsed labels no longer override structured metadata) (Release notes · read 14 Oct 2026)
- Loki v3.6 release notes (Loki UI moved to a Grafana plugin; Promtail deprecated, commercial support ending; SSD mode deprecated before 4.0) (Release notes · read 14 Oct 2026)
- Loki docs: Promtail agent (end of life as of March 2, 2026; no further updates; migrate to Grafana Alloy) (Official docs · read 14 Oct 2026)
- Grafana Alloy docs: Migrate from Promtail (Promtail EOL on March 2, 2026; alloy convert turns a Promtail config into an Alloy config) (Official docs · read 14 Oct 2026)
- Grafana Alloy docs: loki.source.docker (reads container logs from a Docker daemon, unix:///var/run/docker.sock in the example) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Docker driver client (plugin installed on each Docker host; third-party support level, unlike Alloy) (Official docs · read 14 Oct 2026)
- Loki docs at v3.7.8: Docker driver configuration (loki-url per container, in Compose logging options or as the default in daemon.json) (Official docs · read 14 Oct 2026)
- Docker Hub tags of grafana/loki-docker-driver (3.7.8-amd64 and 3.7.8-arm64 pushed 2026-09-17) (Official repository · read 14 Oct 2026)
- Loki docs at v3.7.8: Ingesting logs using OpenTelemetry (OTLP attributes stored as structured metadata; 64 KB and 128 entries per line) (Official docs · read 14 Oct 2026)
- Loki LICENSE at v3.7.8: GNU Affero General Public License v3 (Official repository · read 14 Oct 2026)
- Docker Hub tag grafana/loki:3.7.8 (linux/amd64): 48,003,511 B compressed; 18 layers decompressed and counted: 160,082,432 B (Measurement · read 14 Oct 2026)
- Docker Hub tags of grafana/loki (3.7.8 newest stable on 2026-10-14, pushed 2026-09-17; 3.6.17 on the older line; main-* tags are unreleased builds) (Official repository · read 14 Oct 2026)
- Docker: containerd image store is the default on fresh Engine 29+ installs and keeps images compressed and uncompressed (Official docs · read 14 Oct 2026)
- Grafana Cloud Logs: fully managed log aggregation by Grafana Labs, powered by Loki OSS (Official docs · read 14 Oct 2026)