Skip to contentSkip to page list

Docs

Docker Compose

Get LangWatch running locally in minutes with Docker Compose

On this page

Docker Compose is the quickest way to try LangWatch locally. It runs the full stack in containers on your machine.

Prerequisites

  • Docker with Docker Compose v2
  • 4 CPU cores, 8 GB RAM, 20 GB disk

Quick Start

example.shBash
# Clone the repositorygit clone https://github.com/langwatch/langwatch.gitcd langwatch​# Copy the example environment file, then replace its placeholder secrets (see Configuration)cp .env.example .env​# Start all servicesdocker compose -f infra/compose.yml --project-directory . up

The compose file lives at infra/compose.yml and reads .env at the repository root, so run every docker compose command from the repository root with -f infra/compose.yml --project-directory .. The commands below use that form.

LangWatch is available at http://localhost:5560.

Why port 5560? On a T9 keyboard, 5560 spells "LLM".

Services

Docker Compose starts the following services:

ServiceImageHost portDescription
applangwatch/langwatch:latest5560Main application
workerslangwatch/langwatch:latest-Background job processing
langwatch_nlplangwatch/langwatch_nlp:latest-NLP processing, workflows
langevalslangwatch/langevals:latest5562Evaluators, guardrails
postgrespostgres:165432Control plane database
redisredis:alpine-Job queue, caching
clickhouselangwatch/clickhouse-serverless:0.4.08123Trace and analytics storage

Services with no host port bind no port on the host's interfaces, so they do not answer on localhost and are not reachable from another machine. langwatch_nlp listens on 5561 inside the Docker network, which is what LANGWATCH_NLP_SERVICE points the app and the workers at. A process on the Docker host itself can still reach a container directly on its own network address, so treat this as removing an exposed entry point, not as a network boundary.

Configuration

Edit .env to customize your deployment. Key variables:

example.shBash
# Required: replace the placeholders that .env.example ships# Signs sessions. Generate with: openssl rand -base64 32NEXTAUTH_SECRET=your-session-secret# Encrypts stored credentials and peppers API key hashes.# Must be exactly 64 hex characters. Generate with: openssl rand -hex 32CREDENTIALS_SECRET=your-64-hex-character-key# Password of ClickHouse's default user. Keep it URL-safe. Generate with:# openssl rand -hex 24. Unset, compose falls back to the published `langwatch`# (deprecated, warned at every boot, removed in the next major release).CLICKHOUSE_PASSWORD=your-clickhouse-password​# Optional: shared credential the app authenticates to the NLP service with.# Every container in the stack reads this file, so one value covers both sides.# Generate with: openssl rand -hex 32LANGWATCH_NLP_INTERNAL_SECRET=​# Optional: an Enterprise license, either an activation code# (LW-XXXX-XXXX-XXXX-XXXX, needs outbound HTTPS to connect.langwatch.ai)# or a signed license key (works offline)LANGWATCH_LICENSE_KEY=

See Editions and licensing for how each form is applied at startup. Keep CREDENTIALS_SECRET stable once LangWatch holds data: changing it makes stored credentials unreadable, and also invalidates API keys unless API_KEY_PEPPER is set. To replace it, see Rotating the credentials secret.

Dashboards, the SQL workbench and Instant Evals read through a restricted ClickHouse user and a PostgreSQL reader role. The upgrade creates both. Their passwords are derived from CREDENTIALS_SECRET (or API_KEY_PEPPER when you set it), so you don't set anything for them. To pick your own, set both LWQL_CLICKHOUSE_PASSWORD and LWQL_POSTGRES_READER_PASSWORD.

Creating them needs a ClickHouse user that can create users, roles and named collections, custom_ in the server's custom_settings_prefixes, and a PostgreSQL user with CREATEROLE. The bundled ClickHouse has all of it. If yours doesn't, as on some managed ClickHouse services, the upgrade logs a warning naming what is missing and carries on, and those three features stay off until you add it. With your own passwords set, a missing grant fails the upgrade instead.

See Environment Variables for the full reference.

Common Operations

Start in the background

example.shBash
docker compose -f infra/compose.yml --project-directory . up -d

View logs

example.shBash
# All servicesdocker compose -f infra/compose.yml --project-directory . logs -f​# Specific servicedocker compose -f infra/compose.yml --project-directory . logs -f app

Stop services

example.shBash
docker compose -f infra/compose.yml --project-directory . down

Update to latest version

example.shBash
docker compose -f infra/compose.yml --project-directory . pulldocker compose -f infra/compose.yml --project-directory . up -d

The workers run pnpm task upgrade on the new image when they start, and the app does not report ready until it completes. On a current installation it applies no step. If it fails, read docker compose logs workers; the exit code is explained in the Upgrade Guide.

Reset data

example.shBash
docker compose -f infra/compose.yml --project-directory . down -v  # Removes volumes (all data)docker compose -f infra/compose.yml --project-directory . up

Customization

Disable optional services

If you don't need NLP or evaluators, comment them out in infra/compose.yml:

example.yamlYAML
services:  # langwatch_nlp:  #   ...  # langevals:  #   ...

Remove the corresponding upstream URLs from the app environment to avoid connection errors.

Connect to external databases

Replace the postgres and redis services with connection strings to your existing instances:

example.yamlYAML
services:  app:    environment:      DATABASE_URL: postgresql://user:password@your-postgres:5432/langwatch      REDIS_URL: redis://:password@your-redis:6379    depends_on: [] # Remove postgres and redis dependencies

Connect to external ClickHouse

Replace the clickhouse service with a connection string to your existing instance:

example.yamlYAML
services:  app:    environment:      CLICKHOUSE_URL: http://user:password@your-clickhouse:8123/langwatch    depends_on:      postgres:        condition: service_healthy      redis:        condition: service_healthy      # Remove clickhouse from depends_on

Limitations

Docker Compose is suitable for evaluation and small teams but lacks:

  • High availability: single instance of each service
  • Horizontal scaling: cannot scale workers independently
  • Automated backups: no built-in backup scheduling
  • TLS: no built-in HTTPS (use a reverse proxy like nginx or Caddy)

For production, migrate to the Kubernetes Helm chart.

Next Steps

Documentation