Environment:Langchain ai Langgraph Docker Deployment Environment
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Deployment, Docker |
| Last Updated | 2026-02-11 14:00 GMT |
Overview
Docker-based deployment environment with Docker Compose, PostgreSQL, and optional Node.js 20+ for running LangGraph applications via the CLI.
Description
This environment provides the infrastructure required to build, test, and deploy LangGraph applications using the `langgraph` CLI commands (`langgraph dev`, `langgraph build`, `langgraph up`). It relies on Docker for containerization, Docker Compose for orchestration, and PostgreSQL as the default checkpoint persistence backend. The CLI generates Dockerfiles from templates, manages Docker Compose configurations, and supports both Python and JavaScript/TypeScript graph runtimes. The default Python version for deployment containers is 3.11 (minimum 3.11), and the default Node.js version is 20 (minimum 20).
Usage
Use this environment when deploying LangGraph applications with the CLI deployment workflow. It is the mandatory prerequisite for running `langgraph build`, `langgraph up`, and `langgraph dev` commands, as well as for connecting via `RemoteGraph`.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux or macOS | Windows supported via WSL2 |
| Docker | >= 20.0.0 | `healthcheck_start_interval` requires Docker >= 25.0.0 |
| Docker Compose | >= 1.0.0 | Plugin or standalone (`docker-compose`) supported |
| Python (container) | >= 3.11 | Minimum for deployment containers; default is 3.11 |
| Node.js (container) | >= 20 | Required only for JS/TS graphs; default is 20 |
| Disk | 2GB+ SSD | For Docker images and PostgreSQL data |
| PostgreSQL | >= 14 | Default checkpoint backend in Docker Compose |
Dependencies
System Packages
- `docker` (Docker Engine)
- `docker-compose` or Docker Compose plugin
- `git` (for fetching repositories)
Python Packages (CLI)
- `langgraph-cli` (with `click` >= 8.1.7)
- `langgraph-sdk` >= 0.1.0 (requires Python >= 3.11)
- `python-dotenv` >= 0.8.0 (for `.env` file loading, optional)
In-Memory Server Extra
- `langgraph-api` >= 0.5.35, < 0.8.0 (requires Python >= 3.11)
- `langgraph-runtime-inmem` >= 0.7 (requires Python >= 3.11)
Credentials
The following environment variables are used in the Docker deployment:
- `LANGGRAPH_API_KEY`: API key for the LangGraph server
- `LANGSMITH_API_KEY`: LangSmith API key for tracing and monitoring
- `LANGGRAPH_CLOUD_LICENSE_KEY`: Production license key for LangGraph Cloud
- `OPENAI_API_KEY`: Example API key passed through to containers (model-specific)
- `LANGGRAPH_CLI_NO_ANALYTICS`: Set to `1` to disable CLI analytics
Docker Configuration Variables (JSON format)
- `LANGGRAPH_STORE`: Store configuration
- `LANGGRAPH_AUTH`: Authentication configuration
- `LANGGRAPH_ENCRYPTION`: Encryption configuration
- `LANGGRAPH_HTTP`: HTTP configuration
- `LANGGRAPH_WEBHOOKS`: Webhooks configuration
- `LANGGRAPH_CHECKPOINTER`: Checkpointer configuration
- `LANGGRAPH_UI`: UI configuration
Quick Install
# Install CLI (basic)
pip install langgraph-cli
# Install CLI with in-memory development server (Python 3.11+)
pip install "langgraph-cli[inmem]"
# Verify Docker is available
docker info
docker compose version
Code Evidence
Python and Node.js version constants from `libs/cli/langgraph_cli/config.py:13-19`:
MIN_NODE_VERSION = "20"
DEFAULT_NODE_VERSION = "20"
MIN_PYTHON_VERSION = "3.11"
DEFAULT_PYTHON_VERSION = "3.11"
DEFAULT_IMAGE_DISTRO = "debian"
Docker capability checking from `libs/cli/langgraph_cli/docker.py:48-90`:
def check_capabilities(runner) -> DockerCapabilities:
# check docker available
if shutil.which("docker") is None:
raise click.UsageError("Docker not installed") from None
# ...
return DockerCapabilities(
version_docker=docker_version,
version_compose=compose_version,
healthcheck_start_interval=docker_version >= Version(25, 0, 0),
compose_type=compose_type,
)
Default PostgreSQL URI from `libs/cli/langgraph_cli/docker.py:12`:
DEFAULT_POSTGRES_URI = (
"postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable"
)
In-memory server Python version check from `libs/cli/langgraph_cli/cli.py:701-729`:
try:
from langgraph_api.cli import run_server
except ImportError:
# Guides users to install with: pip install -U "langgraph-cli[inmem]"
# Requires Python 3.11+
raise
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `Docker not installed` | Docker binary not found in PATH | Install Docker Engine from docker.com |
| `Docker not installed or not running` | Docker daemon is not running | Start Docker with `sudo systemctl start docker` or open Docker Desktop |
| `Docker Compose not installed` | Neither Compose plugin nor standalone found | Install Docker Compose plugin or standalone `docker-compose` |
| `ImportError` when running `langgraph dev` | Missing `langgraph-cli[inmem]` extra | `pip install -U "langgraph-cli[inmem]"` (requires Python >= 3.11) |
Compatibility Notes
- Docker healthcheck_start_interval: Only supported on Docker >= 25.0.0; silently omitted on older versions
- Compose types: Supports both Docker Compose plugin (`docker compose`) and standalone (`docker-compose`)
- Base images: Auto-selected based on graph language: `langchain/langgraph-api` (Python), `langchain/langgraphjs-api` (JS/TS)
- Distros: Default is `debian`; supports `slim`, `alpine`, `wolfi`. Bullseye is no longer supported
- Windows: CLI deployment commands require WSL2 or a Docker-compatible Linux environment