docker-compose.yml at the root of the cognee repository defines eight services. Only two of them start by default — everything else is gated behind a Compose profile. This page explains what each service is for, so you can decide which ones you actually need.
For setup instructions and common stacks, see Docker Deployment.
Service overview
A service with no
profiles: key starts whenever you run a bare docker compose up. That means redisinsight comes up alongside cognee even if you never configure Redis. Run docker compose up cognee to start only the API server.Services in detail
cognee — the API server
cognee — the API server
Built from the repository
Dockerfile and started by docker compose up --build cognee. This is the only service you need for a working deployment; the default relational, vector, and graph stores are all embedded and run inside this container.8000— the FastAPI app (http://localhost:8000/docsfor interactive docs).5678—debugpy, used only whenDEBUG=trueandENVisdevorlocal.- Mounts
./cogneefrom the host for dev reload only, and.envread-only (:ro), so config changes need only a restart, not a rebuild. - Persists memory in the
cognee_systemandcognee_datanamed volumes, mounted at/cognee-storage/systemand/cognee-storage/data— the image’s baked-inSYSTEM_ROOT_DIRECTORY/DATA_ROOT_DIRECTORY. These are the same volumescognee-mcpmounts, so both services read and write one memory store. - Runs as the non-root user
cognee(uid/gid 1000), matchingcognee-mcpso the shared volumes have no ownership conflicts. - Passes
DB_PROVIDER,DB_HOST,DB_PORT,DB_NAME,DB_USERNAME, andDB_PASSWORDthrough from your environment or.env, defaulting to embedded SQLite; theDB_HOST/DB_PORTdefaults (host.docker.internal:5432) only apply once you switchDB_PROVIDERtopostgres. For--profile postgres, setDB_PROVIDER=postgresandDB_HOST=postgres. - Has a
healthcheckthat polls/healthevery 30s after a 40s grace period.
cognee-mcp — MCP server for IDEs
cognee-mcp — MCP server for IDEs
Enabled with
--profile mcp. Exposes Cognee’s tools over the Model Context Protocol so Cursor, Claude Desktop, VS Code, and similar clients can call them.- Runs with
TRANSPORT_MODE=sse, so clients connect tohttp://localhost:8001/sse. - Host ports (
8001,5679) differ from thecogneeservice, but inside the container it still listens on8000/5678— that’s why both can run at once. - Started with
--no-migration, so it does not run Alembic migrations. Let thecogneeservice own the schema, and point both at the same database via theDB_*variables. - Mounts the same
cognee_system/cognee_datavolumes as thecogneeservice, at/cognee-storage/systemand/cognee-storage/data. Sharing one memory store between the API and the MCP server is the point of running both — the image runs as the same non-root user (uid/gid 1000) ascognee, so neither container can create files the other cannot write. - Has a
healthcheckthat polls/healthon the container’s port8000every 30s after a 40s grace period. It probes withpython -c "import urllib.request..."rather thancurl, which the python-slim MCP runtime image does not ship. - Optional. Skip it if you only use the REST API or the Python SDK.
frontend — experimental web UI
frontend — experimental web UI
Enabled with
--profile ui. A Next.js app run from the published cognee/cognee-ui image — the same image CI builds, so this profile works from a bare docker-compose.yml with no checkout of cognee-frontend.- Image tag comes from
COGNEE_UI_TAG, defaulting tolatest. - Waits for the
cogneeservice to report healthy (depends_on: condition: service_healthy) before starting. - Passes
COGNEE_BACKEND_URLthrough from your environment, defaulting to empty. It is read at run time, not baked in at build time, which is what lets one published image point at any backend. Empty means the browser derives the backend host from the address the UI was loaded from, on port8000— right for the default localhost setup. Because the browser calls the backend directly, a value you do set must be the address as seen from the browser, never thecogneeservice name. - The image’s entrypoint rejects a
COGNEE_BACKEND_URLthat is not an absolutehttp(s)URL and exits rather than starting; see Cognee + Web UI. - Has a baked-in
healthcheckthat fetches/api/runtime-configevery 30s after a 20s grace period — the cheapest endpoint that proves both that the server is up and that the backend URL resolved.
mcp profile with your IDE or Cognee Cloud.frontend-dev — the web UI built from source
frontend-dev — the web UI built from source
Enabled with
--profile ui-dev. Builds the dev target of cognee-frontend/Dockerfile — a hot-reloading next dev server — and bind-mounts ./cognee-frontend/src and ./cognee-frontend/public, so source edits are picked up without a rebuild. Never published; it exists for frontend work.Takes the same COGNEE_BACKEND_URL as frontend and publishes the same host port 3000, so the two profiles are alternatives, not additions. Unlike frontend, it declares no depends_on, so it starts without waiting for the API.postgres — relational store and pgvector
postgres — relational store and pgvector
Enabled with
--profile postgres. Uses the pgvector/pgvector:pg17 image, so the same container can serve as the relational database (DB_PROVIDER=postgres) and the vector store (VECTOR_DB_PROVIDER=pgvector).Ships with cognee / cognee / cognee_db as user, password, and database name. Optional — Cognee defaults to SQLite and LanceDB, which need no service at all.- Mounts the
postgres_datanamed volume at/var/lib/postgresql/data, so the database survivesdocker compose up --force-recreate postgresanddocker compose down. Deleting the volume (docker compose down -v) still discards it. See Data Persistence and Host Files. - Has a
healthcheckthat runspg_isready -U cognee -d cognee_dbevery 10s, 5 retries, after a 10s grace period.
Nothing in the shipped file declares
depends_on on postgres — only frontend uses one, to wait on cognee — so this healthcheck only reports state; it does not hold cognee back until Postgres accepts connections. Add a depends_on: condition: service_healthy guard yourself if startup ordering matters; see PostgreSQL Connection Refused.neo4j — dedicated graph database
neo4j — dedicated graph database
Enabled with
--profile neo4j. Pinned to neo4j:5.26 for compatibility with the Neo4j Python driver, with the APOC and Graph Data Science plugins preloaded.7474— Neo4j Browser.7687— Bolt protocol; setGRAPH_DATABASE_URL=bolt://neo4j:7687.- Default credentials are
neo4j/pleaseletmein.
redis — session cache backend
redis — session cache backend
Enabled with
--profile redis. Runs redis:7-alpine with append-only persistence into the redis_data volume.Only needed when you set CACHE_BACKEND=redis for sessions and caching; the default cache backend is SQLite. Point Cognee at it with CACHE_HOST=redis and CACHE_PORT=6379.This service backs the session cache. Using Redis as a vector store is a separate, community-maintained adapter that needs the Redis Search module.
redisinsight — Redis GUI
redisinsight — Redis GUI
RedisInsight is Redis’ official browser-based inspector. It is a developer convenience only — Cognee never talks to it, and nothing breaks if you remove it.Open
http://localhost:5540 and connect to host redis, port 6379 to inspect cached sessions. Because it has no profile, it starts with a bare docker compose up; name the services you want (docker compose up cognee) or delete the block if you don’t need it.Shared building blocks
cognee-network
cognee-network
All services join the user-defined bridge network
cognee-network. Inside it, containers reach each other by service name — that is why DB_HOST=postgres and GRAPH_DATABASE_URL=bolt://neo4j:7687 work, while localhost would resolve to the container itself.extra_hosts and host.docker.internal
extra_hosts and host.docker.internal
The This lets a container reach services running directly on your machine — an Ollama server, or a Postgres instance you started outside Compose. Use
cognee and cognee-mcp services map host.docker.internal to host-gateway:host.docker.internal in place of localhost for those, for example LLM_ENDPOINT=http://host.docker.internal:11434.Resource limits
Resource limits
4.0 CPUs / 8 GB for cognee, 2.0 CPUs / 4 GB for cognee-mcp. Lower them if your machine has less headroom; raise them if large ingestion runs are being OOM-killed. On Docker Desktop the limits cannot exceed what the VM itself is allocated.Combining profiles
Combining profiles
Profiles are additive — repeat the flag to start several optional services together:You can also set them once for the shell session:
Need help?
Join our community for Docker deployment support.