Skip to main content
This is a conceptual guide for developing and testing Agent Server applications locally. Learn about the local development tools available, when to use each one, and how they fit into your workflow from initial development through to deploying Agent Server in production. The LangGraph CLI provides two commands for local development, each optimized for different stages of your workflow:
  • langgraph dev: A lightweight development server for rapid iteration.
  • langgraph up: A production-like testing environment for validation.
Featurelanggraph devlanggraph up
Docker requiredNoYes
Installationpip install langgraph-cli[inmem]pip install langgraph-cli
Primary use caseRapid development & testingProduction-like validation
State persistenceIn-memory & pickled to local directoryPostgreSQL
Hot reloadingYes (default)Optional (--watch flag)
Default port20248123
Resource usageLightweightHeavier (build and run separate docker containers for the server, PostgreSQL, and Redis)
IDE DebuggingBuilt-in DAP supportRegular container debugging
Custom authYesYes (with license key)
For full reference details, refer to the LangGraph CLI reference page.

Development

Here’s the typical workflow when building applications:
StageToolPurpose
Develop & Test Locallylanggraph devWrite and iterate on your graph with hot reloading
Validatelanggraph upTest production-like behavior with full stack
DeployLangSmith UI or Control Plane APIDeploy to production with confidence
  1. Daily development: Use langgraph dev for rapid iteration.
  2. Periodic validation: Test major changes with langgraph up.
  3. Pre-deployment check: Run langgraph up --recreate for a fresh build.
  4. Deploy: Push to production via the LangSmith UI or Control Plane API.

langgraph dev

The langgraph dev command runs a lightweight server directly in your environment, designed for speed and convenience during active development. The key features include:
  • No Docker required: Runs directly in your environment.
  • Hot reloading: Automatically reloads when you change code.
  • Fast startup: Ready in seconds.
  • Built-in Debug Adapter Protocol support: Attach your IDE debugger to the server for line-level breakpoints & debugging.
  • Local storage: State persisted to local directory.
The dev server is tested with the same integration test suite as production to ensure its behavior is the same during development while using minimal resources.

Get started

# Install with inmem extra
pip install -U "langgraph-cli[inmem]"

# Start dev server
langgraph dev
Your server starts at http://localhost:2024 with hot reloading enabled by default.

Use cases

Use langgraph dev as your primary development tool for:
  • Daily feature development: Make changes to your code and the server automatically reloads. Test immediately without rebuilding containers—perfect for fast iteration cycles.
  • Quick prototyping and experiments: Spin up a server in seconds to test ideas without Docker setup overhead.
  • Environments without Docker: In CI/CD pipelines or lightweight VMs where Docker isn’t available:
    langgraph dev --no-browser
    
  • Debugger attachment: Use --debug-port to attach your IDE debugger for step-through debugging during development.

langgraph up

The langgraph up command orchestrates a full Docker-based stack that mirrors production infrastructure, helping catch deployment issues before production. The key features include:
  • Verify build & dependencies: Tests your build process and dependencies.
  • Isolated networking: Realistic container networking.
  • Production validation: Verifies deployment readiness.

Get started

# Ensure Docker is running
docker ps

# Start production-like stack
langgraph up
Your server starts at http://localhost:8123 with full persistent storage.

Use cases

Use langgraph up for validation and production-readiness testing:
  • Pre-deployment validation: Before deploying to production, you can run a final check with a fresh build to ensure your dependencies are all correctly specified.
    langgraph up --recreate
    
    This catches issues related to dependency resolution in containers and any other build process problems.
  • Major feature validation: After implementing significant changes, test with the full production stack periodically to ensure everything works in a containerized environment.
  • Docker troubleshooting: When debugging container-specific issues, networking problems, or environment variable configurations that only appear in production.

Pre-deployment checklist

Before deploying an application, verify the following with langgraph up:

Dependencies configuration

Both langgraph dev and langgraph up read your application’s dependencies from your configuration files, but they run in different environments:
  • langgraph dev runs your code directly in your local environment (Python or Node.js) without Docker.
  • langgraph up builds a Docker container and runs your code inside that isolated container.
Properly configuring your dependencies ensures both commands work correctly and that what you test locally matches what gets deployed to production.

langgraph.json file

The dependencies field tells the CLI where to find your application code. The dependencies field can point to:
  • A directory with package config (containing pyproject.toml, setup.py, requirements.txt, or package.json)
  • A specific subdirectory: "dependencies": ["./my_agent"]
  • A specific package: "dependencies": ["my-package==1.0.0"] (Python) or "dependencies": ["[email protected]"] (JavaScript)
{
  "dependencies": ["."],
  "graphs": {
    "my_agent": "./my_agent/agent.py:graph"
  },
  "env": "./.env"
}

Package dependency files

These files define what packages your application needs:
pyproject.toml example:
[project]
name = "my-agent"
version = "0.1.0"
dependencies = [
    "langchain-openai",
    "langchain-anthropic",
    "langgraph",
]
requirements.txt example:
langchain-openai
langchain-anthropic
langgraph

Dependency resolution process

When you run langgraph up, the CLI follows these steps to install your application’s dependencies:
  1. langgraph.json tells the CLI where to look for your application code. The dependencies: ["."] field points to the current directory.
  2. Find package configuration: The CLI looks in that directory for a package configuration file (pyproject.toml, requirements.txt, or package.json).
  3. Read dependencies list: The CLI reads the list of packages from the configuration file.
  4. Install packages: The CLI installs all the packages using the appropriate package manager for your language (uv or pip for Python, npm for JavaScript).
This two-file approach separates concerns: langgraph.json handles application structure and location, while the package configuration file handles language-specific package dependencies. For more information on the installer, refer to CLI configuration file.

Troubleshooting

If you encounter issues with dependency installation, try switching to pip:
{
  "dependencies": ["."],
  "pip_installer": "pip"
}
Then rebuild:
langgraph up --recreate

Debug your local Docker setup

Production deployment might succeed even when langgraph up fails on your local machine. This happens because production uses managed infrastructure while langgraph up runs the full stack locally on your computer. The following are common local environment issues that don’t affect production.

Docker configuration issues

langgraph up requires Docker locally:
# Check if Docker is running
docker ps
Cloud deployments don’t use your local Docker. Solution: Install Docker, or use langgraph dev for local testing.

Port conflicts

langgraph up uses ports 8123, 5432, and 6379 that might be occupied:
# Check for conflicts
lsof -i :8123  # API server
lsof -i :5432  # PostgreSQL
lsof -i :6379  # Redis
Solution: Stop conflicting services or use the --port flag.

Resource constraints

langgraph up requires more RAM and disk for:
  • PostgreSQL container
  • Redis container
  • API server container
Solution: Free up resources or use langgraph dev.

Network configuration

VPN connections, firewall rules, or corporate proxy settings can affect local Docker networking. Solution: Test with langgraph dev or temporarily disable VPN/firewall to isolate the issue.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.