Skip to main content
Deploy Cognee locally or on a server with Docker Compose. The included docker-compose.yml uses profiles so you can start only the services you need.

Prerequisites

  • Docker and Docker Compose v2+
  • Git

Quick Start

git clone https://github.com/topoteretes/cognee.git
cd cognee
cp .env.template .env
Edit .env and set your LLM API key:
LLM_API_KEY="your_api_key"
Then start the Cognee API server (no profile needed):
docker compose up --build cognee
The API will be available at http://localhost:8000. Interactive docs at http://localhost:8000/docs.

Service Profiles

Each optional service is gated behind a profile. Use --profile to activate one or more:
ProfileServicePort(s)Purpose
(none)cognee8000, 5678Core API server
mcpcognee-mcp8000, 5678MCP server for IDE integrations
uifrontend3000Experimental web UI
neo4jneo4j7474, 7687Neo4j graph database
chromadbchromadb3002ChromaDB vector database
postgrespostgres5432PostgreSQL + pgvector
redisredis6379Redis caching

Data Persistence

The compose file mounts your local cognee/ source directory and .env file into the container. Named volumes persist database data between restarts:
ServiceVolume
postgrespostgres_data
chromadb.chromadb_data/ (local dir)
redisredis_data
To ingest files from your host machine, uncomment and update the volume in docker-compose.yml.
# - /path/to/your/data:/data

Environment Variables

The cognee container reads configuration from .env at startup. Key variables:
VariableDefaultDescription
LLM_API_KEY(required)API key for your LLM provider
LLM_MODELopenai/gpt-4o-miniLLM model to use
DB_PROVIDERsqliteRelational DB: sqlite or postgres
GRAPH_DATABASE_PROVIDERkuzuGraph DB: kuzu, neo4j, etc.
VECTOR_DB_PROVIDERlancedbVector DB: lancedb, chromadb, pgvector, etc.
CORS_ALLOWED_ORIGINS*Restrict to specific domains in production
REQUIRE_AUTHENTICATIONfalseEnable JWT auth for the API
See the full list of options in Setup Configuration.

Common Setups

PostgreSQL with pgvector is a good production choice for the relational database.Add to your .env:
DB_PROVIDER=postgres
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=cognee
DB_PASSWORD=cognee
DB_NAME=cognee_db
Start both services:
docker compose --profile postgres up --build
For production deployments with a dedicated graph database:Add to your .env:
# Relational DB
DB_PROVIDER=postgres
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=cognee
DB_PASSWORD=cognee
DB_NAME=cognee_db

# Graph DB
GRAPH_DATABASE_PROVIDER=neo4j
GRAPH_DATABASE_URL=bolt://neo4j:7687
GRAPH_DATABASE_NAME=neo4j
GRAPH_DATABASE_USERNAME=neo4j
GRAPH_DATABASE_PASSWORD=pleaseletmein
Start the stack:
docker compose --profile postgres --profile neo4j up --build
Neo4j browser is available at http://localhost:7474.
Use ChromaDB as the vector store:Add to your .env:
VECTOR_DB_PROVIDER=chromadb
VECTOR_DB_URL=http://chromadb:8000
VECTOR_DB_KEY=your_chroma_token
Start:
docker compose --profile chromadb up --build
Run the MCP server alongside the API:
docker compose --profile mcp up --build cognee-mcp
The MCP server uses SSE transport on port 8000 (separate container). Configure your IDE to point to http://localhost:8000/sse.

Stopping and Cleaning Up

# Stop containers (preserves volumes)
docker compose down

# Stop and remove volumes (deletes all data)
docker compose down --volumes

Need help?

Join our community for Docker deployment support.