dankhostself-host anything

Langfuse with Docker Compose

Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform. In the project's words: Langfuse on GitHub (repository description, without its emoji) checked 2026-10-01

Runs on: amd64, arm64 from each image's registry manifest, checked 2026-10-01; a CPU counts only if every image has a build for it. Image by image

Add Langfuse to the builder to use your own domain, get its passwords generated in your browser, and combine it with other apps in one file.

What Langfuse needs

Only figures Langfuse's own documentation publishes, each linked to the page it is on. Where the project gives no number, this page does not invent one.

ResourceMinimumRecommended
RAM16 GiBnot stated
Published as "We recommend that you use at least 4 cores and 16 GiB of memory" for a VM running this compose file. Source: Langfuse docs: Docker Compose (secrets marked CHANGEME, 4 cores and 16 GiB, exposed ports, NEXTAUTH_URL, upgrade) checked 2026-10-01
CPU4 coresnot stated
Published together with the 16 GiB of memory. Source: Langfuse docs: Docker Compose (secrets marked CHANGEME, 4 cores and 16 GiB, exposed ports, NEXTAUTH_URL, upgrade) checked 2026-10-01
Disknot stated100 GiB
Published as "choose a sufficient amount of storage, e.g. 100GiB": traces pile up in ClickHouse. Source: Langfuse docs: Docker Compose (secrets marked CHANGEME, 4 cores and 16 GiB, exposed ports, NEXTAUTH_URL, upgrade) checked 2026-10-01

On top of this, Caddy (the reverse proxy in the file) is a single small container. Langfuse itself runs as 6 containers: langfuse-worker, langfuse-web, langfuse-clickhouse, langfuse-minio, langfuse-redis, langfuse-postgres.

Which hardware Langfuse has images for

Read from each image's manifest list in its registry (anonymous, read-only) when this page was built. An app counts for a CPU only if every one of its images lists it.

  • x86-64 PC or NAS (linux/amd64): every image has a build.
  • Raspberry Pi 4/5, 64-bit OS (linux/arm64): every image has a build.
  • Raspberry Pi 3 or Zero 2 W, 32-bit OS (linux/arm/v7): no image for langfuse-worker, langfuse-web, clickhouse, minio. No image for this hardware; the builder leaves the app out.
ServiceImagePlatforms in the manifestDigestRegistryChecked
langfuse-workerdocker.langfuse.com/langfuse/langfuse-worker:4amd64, arm64sha256:9349b003a453326b3d2e2033eb94fe5ca9ee12ee237779c10984b9d3dfe0f8edregistry-1.docker.io2026-10-01
langfuse-webdocker.langfuse.com/langfuse/langfuse:4amd64, arm64sha256:8c1b80ed7735be587974d603af0f6e0247b33d3b56c7d5ab9d2337aec313efa0registry-1.docker.io2026-10-01
clickhousedocker.io/clickhouse/clickhouse-server:25.12amd64, arm64sha256:8a790dd3468db22b1d4e7b18a176f378ff5ff6053b9c48dd4ea1fa71a24c5ba6registry-1.docker.io2026-10-01
miniocgr.dev/chainguard/minioamd64, arm64sha256:4692462f35d97d7e82c30371d82f057703c5d9489bcae726010594c812f2d285cgr.dev2026-10-01
redisdocker.io/redis:7amd64, arm/v7, arm64, 386, ppc64lesha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896fregistry-1.docker.io2026-10-01
postgresdocker.io/postgres:17amd64, arm/v5, arm/v7, arm64, 386, ppc64le, riscv64, s390xsha256:d74eeac9a635390a49bc21bd49fccd973de707e2a53a76ac49b552b8712ec46fregistry-1.docker.io2026-10-01

A manifest says an image exists for a CPU, not how well Langfuse runs on it: a build for arm64 or arm/v7 can still be too slow or need more memory than the board has. The RAM and disk Langfuse publishes are in the table above and, for a whole set of apps against a Raspberry Pi, on Will it run on my machine?. A tag like latest can move to a new digest after the date checked.

docker-compose.yml

This is exactly what the builder writes for Langfuse alone on example.org: the official definition with its published ports removed and Caddy added in front. Every ${VARIABLE} is defined in the .env below.

# docker-compose.yml built at dankhost.com for: Langfuse
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Only Caddy publishes ports. Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Langfuse (langfuse.example.org) ----
  # Source: https://github.com/langfuse/langfuse/blob/main/docker-compose.yml (checked 2026-10-01)
  # Source: https://langfuse.com/self-hosting/deployment/docker-compose (checked 2026-10-01)
  # Changed: Removed every published port: '3000:3000' (Caddy reaches langfuse-web:3000 on the proxy network), MinIO's '9090:9000', and the 127.0.0.1 ports of the worker, ClickHouse, the MinIO console, Redis and Postgres, which the file opens on the host for local tools only.
  #          Every value the file marks # CHANGEME is a generated .env secret: the Postgres, ClickHouse, MinIO and Redis passwords, SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY (64 hex characters, the file's openssl rand -hex 32). Each one is used wherever the file repeats it: DATABASE_URL, the three S3 secret access keys, and REDIS_AUTH in redis's command.
  #          NEXTAUTH_URL is the app's own address, https://langfuse.example.org: the docs say it "must match the URL users open in the browser".
  #          The file's ${VAR:-default} environment entries are written as their defaults. Entries whose default is empty (SMTP, the AI features, the in-app agent, headless initialisation, ingestion tuning) are left out, so Langfuse sees them unset exactly as with the file. The YAML anchors &langfuse-depends-on and &langfuse-worker-env are written out in full for both services.
  #          Postgres is docker.io/postgres:17, the default of the file's ${POSTGRES_VERSION:-17}.
  #          LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT on langfuse-web is http://minio:9000, the worker's value, instead of http://localhost:9090: MinIO gets no address outside Docker in this file (see the notes).
  langfuse-worker:
    image: "docker.langfuse.com/langfuse/langfuse-worker:4"
    container_name: "langfuse-worker"
    restart: "always"
    depends_on:
      langfuse-postgres:
        condition: "service_healthy"
      langfuse-minio:
        condition: "service_healthy"
      langfuse-redis:
        condition: "service_healthy"
      langfuse-clickhouse:
        condition: "service_healthy"
    environment:
      NEXTAUTH_URL: "https://langfuse.example.org"
      DATABASE_URL: "postgresql://postgres:${LANGFUSE_POSTGRES_PASSWORD}@postgres:5432/postgres"
      SALT: "${LANGFUSE_SALT}"
      ENCRYPTION_KEY: "${LANGFUSE_ENCRYPTION_KEY}"
      TELEMETRY_ENABLED: "true"
      LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: "false"
      CLICKHOUSE_MIGRATION_URL: "clickhouse://clickhouse:9000"
      CLICKHOUSE_URL: "http://clickhouse:8123"
      CLICKHOUSE_USER: "clickhouse"
      CLICKHOUSE_PASSWORD: "${LANGFUSE_CLICKHOUSE_PASSWORD}"
      CLICKHOUSE_CLUSTER_ENABLED: "false"
      CLICKHOUSE_CLUSTER_NAME: "default"
      LANGFUSE_USE_AZURE_BLOB: "false"
      LANGFUSE_USE_OCI_NATIVE_OBJECT_STORAGE: "false"
      LANGFUSE_OCI_AUTH_TYPE: "workload_identity"
      LANGFUSE_S3_EVENT_UPLOAD_BUCKET: "langfuse"
      LANGFUSE_S3_EVENT_UPLOAD_REGION: "auto"
      LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
      LANGFUSE_S3_EVENT_UPLOAD_PREFIX: "events/"
      LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: "langfuse"
      LANGFUSE_S3_MEDIA_UPLOAD_REGION: "auto"
      LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: "true"
      LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: "media/"
      LANGFUSE_OBSERVATION_FIELD_OVERFLOW_ENABLED: "false"
      LANGFUSE_OBSERVATION_FIELD_SIZE_LIMIT_BYTES: "2097152"
      LANGFUSE_S3_BATCH_EXPORT_ENABLED: "false"
      LANGFUSE_S3_BATCH_EXPORT_BUCKET: "langfuse"
      LANGFUSE_S3_BATCH_EXPORT_PREFIX: "exports/"
      LANGFUSE_S3_BATCH_EXPORT_REGION: "auto"
      LANGFUSE_S3_BATCH_EXPORT_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_BATCH_EXPORT_EXTERNAL_ENDPOINT: "http://localhost:9090"
      LANGFUSE_S3_BATCH_EXPORT_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_BATCH_EXPORT_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_BATCH_EXPORT_FORCE_PATH_STYLE: "true"
      REDIS_HOST: "redis"
      REDIS_PORT: "6379"
      REDIS_AUTH: "${LANGFUSE_REDIS_AUTH}"
      LANGFUSE_BULLMQ_SKIP_REDIS_VERSION_CHECK: "false"
      REDIS_TLS_ENABLED: "false"
      REDIS_TLS_CA: "/certs/ca.crt"
      REDIS_TLS_CERT: "/certs/redis.crt"
      REDIS_TLS_KEY: "/certs/redis.key"
    networks:
      langfuse-backend: {}
  langfuse-web:
    image: "docker.langfuse.com/langfuse/langfuse:4"
    container_name: "langfuse-web"
    restart: "always"
    depends_on:
      langfuse-postgres:
        condition: "service_healthy"
      langfuse-minio:
        condition: "service_healthy"
      langfuse-redis:
        condition: "service_healthy"
      langfuse-clickhouse:
        condition: "service_healthy"
    environment:
      NEXTAUTH_URL: "https://langfuse.example.org"
      DATABASE_URL: "postgresql://postgres:${LANGFUSE_POSTGRES_PASSWORD}@postgres:5432/postgres"
      SALT: "${LANGFUSE_SALT}"
      ENCRYPTION_KEY: "${LANGFUSE_ENCRYPTION_KEY}"
      TELEMETRY_ENABLED: "true"
      LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES: "false"
      CLICKHOUSE_MIGRATION_URL: "clickhouse://clickhouse:9000"
      CLICKHOUSE_URL: "http://clickhouse:8123"
      CLICKHOUSE_USER: "clickhouse"
      CLICKHOUSE_PASSWORD: "${LANGFUSE_CLICKHOUSE_PASSWORD}"
      CLICKHOUSE_CLUSTER_ENABLED: "false"
      CLICKHOUSE_CLUSTER_NAME: "default"
      LANGFUSE_USE_AZURE_BLOB: "false"
      LANGFUSE_USE_OCI_NATIVE_OBJECT_STORAGE: "false"
      LANGFUSE_OCI_AUTH_TYPE: "workload_identity"
      LANGFUSE_S3_EVENT_UPLOAD_BUCKET: "langfuse"
      LANGFUSE_S3_EVENT_UPLOAD_REGION: "auto"
      LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE: "true"
      LANGFUSE_S3_EVENT_UPLOAD_PREFIX: "events/"
      LANGFUSE_S3_MEDIA_UPLOAD_BUCKET: "langfuse"
      LANGFUSE_S3_MEDIA_UPLOAD_REGION: "auto"
      LANGFUSE_S3_MEDIA_UPLOAD_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_MEDIA_UPLOAD_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_MEDIA_UPLOAD_FORCE_PATH_STYLE: "true"
      LANGFUSE_S3_MEDIA_UPLOAD_PREFIX: "media/"
      LANGFUSE_OBSERVATION_FIELD_OVERFLOW_ENABLED: "false"
      LANGFUSE_OBSERVATION_FIELD_SIZE_LIMIT_BYTES: "2097152"
      LANGFUSE_S3_BATCH_EXPORT_ENABLED: "false"
      LANGFUSE_S3_BATCH_EXPORT_BUCKET: "langfuse"
      LANGFUSE_S3_BATCH_EXPORT_PREFIX: "exports/"
      LANGFUSE_S3_BATCH_EXPORT_REGION: "auto"
      LANGFUSE_S3_BATCH_EXPORT_ENDPOINT: "http://minio:9000"
      LANGFUSE_S3_BATCH_EXPORT_EXTERNAL_ENDPOINT: "http://localhost:9090"
      LANGFUSE_S3_BATCH_EXPORT_ACCESS_KEY_ID: "minio"
      LANGFUSE_S3_BATCH_EXPORT_SECRET_ACCESS_KEY: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
      LANGFUSE_S3_BATCH_EXPORT_FORCE_PATH_STYLE: "true"
      REDIS_HOST: "redis"
      REDIS_PORT: "6379"
      REDIS_AUTH: "${LANGFUSE_REDIS_AUTH}"
      LANGFUSE_BULLMQ_SKIP_REDIS_VERSION_CHECK: "false"
      REDIS_TLS_ENABLED: "false"
      REDIS_TLS_CA: "/certs/ca.crt"
      REDIS_TLS_CERT: "/certs/redis.crt"
      REDIS_TLS_KEY: "/certs/redis.key"
      NEXTAUTH_SECRET: "${LANGFUSE_NEXTAUTH_SECRET}"
      LANGFUSE_S3_MEDIA_UPLOAD_INTERNAL_ENDPOINT: "http://minio:9000"
    networks:
      proxy: {}
      langfuse-backend: {}
  langfuse-clickhouse:
    image: "docker.io/clickhouse/clickhouse-server:25.12"
    container_name: "langfuse-clickhouse"
    restart: "always"
    user: "101:101"
    environment:
      CLICKHOUSE_DB: "default"
      CLICKHOUSE_USER: "clickhouse"
      CLICKHOUSE_PASSWORD: "${LANGFUSE_CLICKHOUSE_PASSWORD}"
    volumes:
      - "langfuse-langfuse_clickhouse_data:/var/lib/clickhouse"
      - "langfuse-langfuse_clickhouse_logs:/var/log/clickhouse-server"
    healthcheck:
      test: "wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1"
      interval: "5s"
      timeout: "5s"
      retries: 10
      start_period: "1s"
    networks:
      langfuse-backend:
        aliases:
          - "clickhouse"
  langfuse-minio:
    image: "cgr.dev/chainguard/minio"
    container_name: "langfuse-minio"
    restart: "always"
    entrypoint: "sh"
    command: "-c 'mkdir -p /data/langfuse && minio server --address \":9000\" --console-address \":9001\" /data'"
    environment:
      MINIO_ROOT_USER: "minio"
      MINIO_ROOT_PASSWORD: "${LANGFUSE_MINIO_ROOT_PASSWORD}"
    volumes:
      - "langfuse-langfuse_minio_data:/data"
    healthcheck:
      test:
        - "CMD"
        - "mc"
        - "ready"
        - "local"
      interval: "1s"
      timeout: "5s"
      retries: 5
      start_period: "1s"
    networks:
      langfuse-backend:
        aliases:
          - "minio"
  langfuse-redis:
    image: "docker.io/redis:7"
    container_name: "langfuse-redis"
    restart: "always"
    command: "--requirepass ${LANGFUSE_REDIS_AUTH} --maxmemory-policy noeviction"
    volumes:
      - "langfuse-langfuse_redis_data:/data"
    healthcheck:
      test:
        - "CMD"
        - "redis-cli"
        - "ping"
      interval: "3s"
      timeout: "10s"
      retries: 10
    networks:
      langfuse-backend:
        aliases:
          - "redis"
  langfuse-postgres:
    image: "docker.io/postgres:17"
    container_name: "langfuse-postgres"
    restart: "always"
    healthcheck:
      test:
        - "CMD-SHELL"
        - "pg_isready -U postgres"
      interval: "3s"
      timeout: "3s"
      retries: 10
    environment:
      POSTGRES_USER: "postgres"
      POSTGRES_PASSWORD: "${LANGFUSE_POSTGRES_PASSWORD}"
      POSTGRES_DB: "postgres"
      TZ: "UTC"
      PGTZ: "UTC"
    volumes:
      - "langfuse-langfuse_postgres_data:/var/lib/postgresql/data"
    networks:
      langfuse-backend:
        aliases:
          - "postgres"

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"
  langfuse-backend:
    internal: true

volumes:
  caddy-data:
  caddy-config:
  langfuse-langfuse_postgres_data:
  langfuse-langfuse_clickhouse_data:
  langfuse-langfuse_clickhouse_logs:
  langfuse-langfuse_minio_data:
  langfuse-langfuse_redis_data:

Caddyfile save as caddy/Caddyfile

Caddy gets and renews the HTTPS certificate for langfuse.example.org by itself once the DNS record points at your server and ports 80 and 443 reach it.

# Caddyfile built at dankhost.com. Save it as ./caddy/Caddyfile next to docker-compose.yml.
# Caddy gets and renews a Let's Encrypt certificate for each name below by itself,
# once the DNS records point at this server and ports 80 and 443 reach it.

# Langfuse
langfuse.example.org {
	reverse_proxy langfuse-web:3000
}

Already running nginx, Nginx Proxy Manager, Caddy or Traefik? The reverse-proxy settings Langfuse needs, for all four, each cited to Langfuse's own docs.

.env

The secrets are left blank here on purpose: a password printed on a public page is the same for everyone who copies it. The builder fills them with random letters and digits made in your browser.

# .env for Langfuse, from dankhost.com/app/langfuse/. Fill the blank secrets before starting.
# Keep this file private (chmod 600).

# Langfuse
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_POSTGRES_PASSWORD=
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_SALT=
# 64 random letters and digits: the builder fills this in your browser
LANGFUSE_ENCRYPTION_KEY=
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_NEXTAUTH_SECRET=
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_CLICKHOUSE_PASSWORD=
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_MINIO_ROOT_PASSWORD=
# 32 random letters and digits: the builder fills this in your browser
LANGFUSE_REDIS_AUTH=

Changes from the official file

Besides prefixing every service, container, volume, folder and variable with langfuse (so any set of apps can share one file), these are all the differences from what the project documents:

  • Removed every published port: '3000:3000' (Caddy reaches langfuse-web:3000 on the proxy network), MinIO's '9090:9000', and the 127.0.0.1 ports of the worker, ClickHouse, the MinIO console, Redis and Postgres, which the file opens on the host for local tools only.
  • Every value the file marks # CHANGEME is a generated .env secret: the Postgres, ClickHouse, MinIO and Redis passwords, SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY (64 hex characters, the file's openssl rand -hex 32). Each one is used wherever the file repeats it: DATABASE_URL, the three S3 secret access keys, and REDIS_AUTH in redis's command.
  • NEXTAUTH_URL is the app's own address, https://langfuse.example.org: the docs say it "must match the URL users open in the browser".
  • The file's ${VAR:-default} environment entries are written as their defaults. Entries whose default is empty (SMTP, the AI features, the in-app agent, headless initialisation, ingestion tuning) are left out, so Langfuse sees them unset exactly as with the file. The YAML anchors &langfuse-depends-on and &langfuse-worker-env are written out in full for both services.
  • Postgres is docker.io/postgres:17, the default of the file's ${POSTGRES_VERSION:-17}.
  • LANGFUSE_S3_MEDIA_UPLOAD_ENDPOINT on langfuse-web is http://minio:9000, the worker's value, instead of http://localhost:9090: MinIO gets no address outside Docker in this file (see the notes).

Notes for Langfuse behind the proxy

  • Open https://langfuse.example.org and click Sign up: Langfuse ships no default login, and the first user then creates the organisation and project. Anyone who reaches the address can sign up until you add AUTH_DISABLE_SIGNUP: "true" to langfuse-web's environment.
  • Multimodal tracing (images, audio and files attached to traces) does not work with this file: browsers upload media straight to MinIO, which the docs' troubleshooting says is not reachable from outside the Docker network unless configured for it. Text traces, prompts, scores and evaluations work.
  • Point your SDKs at https://langfuse.example.org with the public and secret key from the project settings.
  • TELEMETRY_ENABLED is true, the file's default; set it to "false" in both Langfuse services to stop the anonymous usage reports.
  • The docs: this set-up "lacks high-availability, scaling capabilities, and backup functionality"; they point to Kubernetes for high availability and throughput.

How to run it

  1. At your DNS provider, add an A record named langfuse on your domain pointing at the server's public IP address, and forward TCP 80, TCP 443 and UDP 443 to it.
  2. Save the three files in one folder: docker-compose.yml and .env side by side, the Caddyfile at ./caddy/Caddyfile. Replace example.org with your domain in the Caddyfile, the compose file and the .env, or let the builder do it.
  3. Fill the blank LANGFUSE_POSTGRES_PASSWORD, LANGFUSE_SALT, LANGFUSE_ENCRYPTION_KEY, LANGFUSE_NEXTAUTH_SECRET, LANGFUSE_CLICKHOUSE_PASSWORD, LANGFUSE_MINIO_ROOT_PASSWORD, LANGFUSE_REDIS_AUTH in .env. The builder generates them; on the server, tr -dc A-Za-z0-9 </dev/urandom | head -c 32 prints 32 random letters and digits. Then chmod 600 .env.
  4. Start it:
    docker compose up -d
    docker compose logs -f caddy   # watch the certificate arrive
  5. Open the new address (langfuse. plus your domain) in a browser and follow the notes above.

Back it up

Langfuse publishes no backup procedure for Docker Compose; its docs say this set-up lacks backup functionality. The data is in four places: Postgres (users, projects, prompts, scores, settings), ClickHouse (traces and observations), MinIO (raw event files) and Redis (the job queue).

Below is the BACKUP.md the builder writes next to the compose file above: which of its folders and volumes hold data, the dump command the project documents, rewritten for this file's service names, what to copy with which container stopped, and a restore check. Pick more apps in the builder and it covers them all in one file.

# BACKUP.md built at dankhost.com for: Langfuse

What to copy from the docker-compose.yml built with this file, the database dump each project documents (rewritten for the service names in that file), what to copy with which container stopped, and how to check the result. Run every command in the folder that holds docker-compose.yml.

The folders are owned by the containers' users: put sudo in front of tar if it says "Permission denied". Named volumes live under /var/lib/docker/volumes, not next to the compose file, so they are copied through a throwaway ubuntu container (Docker's documented --volumes-from method). tar makes a full copy each run; for large folders an incremental tool (restic, borg, rsync) saves time and space.

Never run "docker compose down -v" on this file: it deletes the named volumes of every app in it.

## Before you start

    BACKUP=/mnt/backup/selfhost   # change this: a disk or machine other than this server's system disk
    mkdir -p "$BACKUP"

## Every time: the three stack files

    tar czf "$BACKUP/stack-files.tar.gz" docker-compose.yml .env caddy

.env holds the database passwords and secret keys the apps were set up with; keep this archive as private as the data.

## Caddy (the reverse proxy)

Caddy's docs: 'The data directory must not be treated as a cache.' It holds the TLS certificates and their private keys; without it Caddy has to ask Let's Encrypt for every certificate again.

- caddy-data (named volume, /data in caddy)
  BACK UP: TLS certificates, private keys, OCSP staples.
- caddy-config (named volume, /config in caddy)
  SKIP: the last active configuration, kept for 'caddy run --resume', which this setup does not use: it starts from the Caddyfile.
- ./caddy (/etc/caddy in caddy)
  IN stack-files.tar.gz: the Caddyfile, copied with the stack files above.

Copy (Caddy keeps serving while you copy):

    docker run --rm --volumes-from caddy -v "$BACKUP":/backup ubuntu tar cvf /backup/caddy-data.tar /data

Restore check:

    tar tf "$BACKUP/caddy-data.tar" > /dev/null && echo OK
    docker run --rm --volumes-from caddy -v "$BACKUP":/backup ubuntu bash -c "cd /data && tar xvf /backup/caddy-data.tar --strip 1"

Sources:
- Caddy docs: Conventions, Data directory: https://caddyserver.com/docs/conventions#data-directory (checked 2026-09-24)
- Docker docs: Volumes, Back up, restore, or migrate data volumes: https://docs.docker.com/engine/storage/volumes/#back-up-restore-or-migrate-data-volumes (checked 2026-09-24)

## Langfuse

Langfuse publishes no backup procedure for Docker Compose; its docs say this set-up lacks backup functionality. The data is in four places: Postgres (users, projects, prompts, scores, settings), ClickHouse (traces and observations), MinIO (raw event files) and Redis (the job queue).

What this compose mounts:
- langfuse-langfuse_clickhouse_data (named volume, /var/lib/clickhouse in langfuse-clickhouse)
  BACK UP: ClickHouse: every trace, observation and score.
- langfuse-langfuse_clickhouse_logs (named volume, /var/log/clickhouse-server in langfuse-clickhouse)
  SKIP: ClickHouse server logs.
- langfuse-langfuse_minio_data (named volume, /data in langfuse-minio)
  BACK UP: MinIO: the raw event files the worker ingests, and exports.
- langfuse-langfuse_redis_data (named volume, /data in langfuse-redis)
  OPTIONAL: the job queue: events received but not yet processed.
- langfuse-langfuse_postgres_data (named volume, /var/lib/postgresql/data in langfuse-postgres)
  COVERED BY THE COMMAND BELOW: Postgres data files; copy them only with the database stopped.

1. Stop langfuse-web, langfuse-worker, langfuse-clickhouse. ClickHouse writes data parts continuously; a copy taken while it runs can catch a part half-written. Stopping the two Langfuse services first stops new events arriving.

    docker compose stop langfuse-web langfuse-worker langfuse-clickhouse

2. Database dump for langfuse-postgres:

    docker compose exec -T langfuse-postgres pg_dump -U postgres postgres > "$BACKUP/langfuse.sql"

   Plain pg_dump of the database the file names (user and database both postgres), run through docker compose with -T.

3. Copy while langfuse-web, langfuse-worker, langfuse-clickhouse are stopped:

    docker run --rm --volumes-from langfuse-clickhouse -v "$BACKUP":/backup ubuntu tar cvf /backup/langfuse-langfuse_clickhouse_data.tar /var/lib/clickhouse
    docker run --rm --volumes-from langfuse-minio -v "$BACKUP":/backup ubuntu tar cvf /backup/langfuse-langfuse_minio_data.tar /data

4. Start it again:

    docker compose start langfuse-web langfuse-worker langfuse-clickhouse

Restore check:

    grep -c 'PostgreSQL database dump complete' "$BACKUP/langfuse.sql"   # 1 means pg_dump finished
    tar tf "$BACKUP/langfuse-langfuse_clickhouse_data.tar" > /dev/null && echo OK
    tar tf "$BACKUP/langfuse-langfuse_minio_data.tar" > /dev/null && echo OK

Put a copy back (with langfuse-web, langfuse-worker, langfuse-clickhouse stopped):

    docker run --rm --volumes-from langfuse-clickhouse -v "$BACKUP":/backup ubuntu bash -c "cd /var/lib/clickhouse && tar xvf /backup/langfuse-langfuse_clickhouse_data.tar --strip 3"
    docker run --rm --volumes-from langfuse-minio -v "$BACKUP":/backup ubuntu bash -c "cd /data && tar xvf /backup/langfuse-langfuse_minio_data.tar --strip 1"

    docker compose up -d langfuse-postgres
    docker compose exec -T langfuse-postgres psql -U postgres postgres < "$BACKUP/langfuse.sql"

Put the ClickHouse and MinIO volumes back, then:

    docker compose up -d

Sources:
- Langfuse docs: Docker Compose (secrets marked CHANGEME, 4 cores and 16 GiB, exposed ports, NEXTAUTH_URL, upgrade): https://langfuse.com/self-hosting/deployment/docker-compose (checked 2026-10-01)
- Docker docs: Volumes, Back up, restore, or migrate data volumes: https://docs.docker.com/engine/storage/volumes/#back-up-restore-or-migrate-data-volumes (checked 2026-10-01)

Update it

What docker compose pull does depends only on how each image line in the compose file above is tagged. For Langfuse as this page writes it:

ServiceImageHow it is pinnedWhat docker compose pull does
caddycaddy:2Major version only (tag 2)Takes the newest image tagged 2: minor and patch releases of 2, never 3. A new major version needs a tag edit.
langfuse-workerdocker.langfuse.com/langfuse/langfuse-worker:4Major version only (tag 4)Takes the newest image tagged 4: minor and patch releases of 4, never 5. A new major version needs a tag edit.
langfuse-webdocker.langfuse.com/langfuse/langfuse:4Major version only (tag 4)Takes the newest image tagged 4: minor and patch releases of 4, never 5. A new major version needs a tag edit.
langfuse-clickhousedocker.io/clickhouse/clickhouse-server:25.12Major and minor version (tag 25.12)Takes the newest image tagged 25.12: patch releases and rebuilds of 25.12 only. A newer minor or major version needs a tag edit.
langfuse-miniocgr.dev/chainguard/minioNot pinned: no tag, which means latestMoves to the newest image published as latest, which can be a new major version.
langfuse-redisdocker.io/redis:7Major version only (tag 7)Takes the newest image tagged 7: minor and patch releases of 7, never 8. A new major version needs a tag edit.
langfuse-postgres databasedocker.io/postgres:17Major version only (tag 17)Takes the newest image tagged 17: minor and patch releases of 17, never 18. A new major version needs a tag edit.

Do not raise the major version of langfuse-postgres by editing its tag. Keep its tag, 17, as it is when you update Langfuse.

PostgreSQL's docs: a new major version may change how data is stored on disk, so a data folder written by an older major version will not start under a newer one (the server refuses it). Moving needs a dump and restore (pg_dumpall, then load the dump into the new version) or pg_upgrade. Minor releases of the same major version never change the storage format. Source: PostgreSQL docs: Upgrading a PostgreSQL Cluster checked 2026-09-30

What Langfuse's docs say about updating

Langfuse's Docker Compose page: to upgrade, stop the containers and run docker compose up --pull always. Its upgrade guide covers moves between major versions.

  • The Langfuse images are on tag 4, the major version, so a pull moves to the newest 4.x release. A move to 5 means editing the tag after reading the upgrade guide.

Source: Langfuse docs: Docker Compose (secrets marked CHANGEME, 4 cores and 16 GiB, exposed ports, NEXTAUTH_URL, upgrade) checked 2026-10-01

The steps

  1. Back up first, as in Back it up above. An update can migrate Langfuse's data on its first start and its database with it; the copy is the way back.
  2. Download the new images. Running containers are not touched yet:
    docker compose pull
  3. Recreate the containers whose image changed. Volumes and bind-mounted folders stay as they are:
    docker compose up -d
  4. Watch Langfuse start (Ctrl+C stops following the log, not the app):
    docker compose logs -f langfuse-web
  5. Optional: remove the old images the pull left without a tag. This covers every stack on the machine, not only this one:
    docker image prune

Docker's reference for these commands: Docker docs: docker compose pull checked 2026-09-30; Docker docs: docker compose up (recreates changed containers, keeps volumes) checked 2026-09-30; Docker docs: docker image prune checked 2026-09-30

Sources

Every page below was fetched on the date shown.

Add Langfuse to the builder All seventy apps