loki-config.yml and the matching Docker Compose service.
Full configuration
Configuration fields
Controls whether Loki requires an
X-Scope-OrgID header on every request to identify the tenant. When set to false, Loki operates in single-tenant mode and accepts requests without authentication headers.The port Loki’s HTTP server listens on. Promtail pushes logs to this port, and Grafana queries it for log data.
The root directory under which Loki stores all data. The
chunks_directory and rules_directory paths below are resolved relative to this prefix.Where Loki writes compressed log chunks on the filesystem.
Where Loki stores alerting and recording rules.
The number of replicas for each log chunk. A value of
1 means no replication, which is appropriate for a single-node local setup.The address this Loki instance advertises to the ring. Set to the loopback address for single-node deployments.
The key-value store used by the ring for membership coordination.
inmemory keeps all state in the process, which is only viable for a single Loki instance.Schema configuration
The date from which this schema version applies. Loki uses the schema that was active when a chunk was written to read it back correctly.
The index store type.
tsdb is the recommended store for Loki v2.8 and later.Where Loki stores chunk data.
filesystem writes directly to local disk, which is appropriate for local development.The schema version used to encode index entries.
v13 is the current recommended version.A string prepended to all index table names.
How often Loki rotates index tables. A period of
24h creates one table per day.Docker Compose service
Theloki service in docker-compose.yml is defined as follows:
- image — uses the official
grafana/loki:latestimage. - ports — maps host port
3100to container port3100, allowing Grafana (and your browser) to reach Loki athttp://localhost:3100. - volumes — mounts your local
loki/loki-config.ymlinto the container at/etc/loki/local-config.yaml, the path Loki reads by default on startup.