Loki

Runs a single Loki service for collecting and querying logs over port 3100. This template gives you a simple way to start storing application logs before adding a larger monitoring or observability stack.

yaml

docker-compose.yml

services:
  loki:
    image: grafana/loki:3.0.0
    container_name: loki
    restart: unless-stopped
    command:
      - "-config.file=${LOKI_CONFIG_PATH}"
    volumes:
      - loki-data:/loki
    ports:
      - ${LOKI_HTTP_PORT}:3100
volumes:
  loki-data:

.ENV

.env example

LOKI_HTTP_PORT=3100
LOKI_CONFIG_PATH=/etc/loki/local-config.yaml

deployment

Quick Start

  1. Create a working directory named after the service.
  2. Copy the compose file and generated `.env` into that directory.
  3. Review the variables and replace placeholders with real values.
  4. Run `docker compose up -d`.
mkdir loki
cd loki
# create docker-compose.yml
# create .env
docker compose up -d