> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Compose Reference

> Annotated walkthrough of every service, port, and profile in the shipped docker-compose.yml

The `docker-compose.yml` at the root of the [cognee repository](https://github.com/topoteretes/cognee) defines seven services. Only two of them start by default — everything else is gated behind a [Compose profile](https://docs.docker.com/compose/how-tos/profiles/). 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](/how-to-guides/cognee-sdk/deployment/docker).

## Service overview

| Service        | Profile    | Host ports     | Required? | Purpose                                                     |
| -------------- | ---------- | -------------- | --------- | ----------------------------------------------------------- |
| `cognee`       | *(none)*   | `8000`, `5678` | **Yes**   | The Cognee REST API server                                  |
| `redisinsight` | *(none)*   | `5540`         | No        | Redis browser GUI (developer convenience)                   |
| `cognee-mcp`   | `mcp`      | `8001`, `5679` | No        | [MCP server](/cognee-mcp/mcp-overview) for IDE integrations |
| `frontend`     | `ui`       | `3000`         | No        | Experimental [web UI](/cognee-cloud/local-ui)               |
| `postgres`     | `postgres` | `5432`         | No        | PostgreSQL + pgvector                                       |
| `neo4j`        | `neo4j`    | `7474`, `7687` | No        | Neo4j graph database                                        |
| `redis`        | `redis`    | `6379`         | No        | Redis, for the session cache                                |

<Note>
  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.
</Note>

## Services in detail

<AccordionGroup>
  <Accordion title="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](/setup-configuration/relational-databases), [vector](/setup-configuration/vector-stores), and [graph](/setup-configuration/graph-stores) stores are all embedded and run inside this container.

    * `8000` — the FastAPI app (`http://localhost:8000/docs` for interactive docs).
    * `5678` — `debugpy`, used only when `DEBUG=true` and `ENV` is `dev` or `local`.
    * Mounts `./cognee` and `.env` from the host, so config changes need only a restart, not a rebuild.
    * Has a `healthcheck` that polls `/health` every 30s after a 40s grace period.
  </Accordion>

  <Accordion title="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 to `http://localhost:8001/sse`.
    * Host ports (`8001`, `5679`) differ from the `cognee` service, but inside the container it still listens on `8000`/`5678` — that's why both can run at once.
    * Started with `--no-migration`, so it does not run Alembic migrations. Let the `cognee` service own the schema, and point both at the same database via the `DB_*` variables.
    * Optional. Skip it if you only use the REST API or the Python SDK.
  </Accordion>

  <Accordion title="frontend — experimental web UI">
    Enabled with `--profile ui`. A Next.js app built from `./cognee-frontend` that talks to the API at `NEXT_PUBLIC_BACKEND_API_URL` (default `http://localhost:8000`).

    Optional and explicitly a work in progress — it supports the minimum feature set needed to be functional. For a richer experience, use the `mcp` profile with your IDE or [Cognee Cloud](/cognee-cloud/overview).
  </Accordion>

  <Accordion title="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](/setup-configuration/relational-databases) (`DB_PROVIDER=postgres`) and the [vector store](/setup-configuration/vector-stores) (`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.

    <Warning>
      The `postgres_data` volume is declared but the mount is commented out in the shipped file, so data is lost when the container is removed. See [Data Persistence and Host Files](/how-to-guides/cognee-sdk/deployment/docker#additional-information).
    </Warning>
  </Accordion>

  <Accordion title="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; set `GRAPH_DATABASE_URL=bolt://neo4j:7687`.
    * Default credentials are `neo4j` / `pleaseletmein`.

    Optional. Use it instead of the embedded file-based graph store when you need concurrent access from multiple processes. No data volume is mounted, so add one for durability.
  </Accordion>

  <Accordion title="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](/core-concepts/sessions-and-caching); the default cache backend is SQLite. Point Cognee at it with `CACHE_HOST=redis` and `CACHE_PORT=6379`.

    <Note>
      This service backs the *session cache*. Using Redis as a [vector store](/setup-configuration/community-maintained/redis) is a separate, community-maintained adapter that needs the Redis Search module.
    </Note>
  </Accordion>

  <Accordion title="redisinsight — Redis GUI">
    [RedisInsight](https://redis.io/insight/) 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.
  </Accordion>
</AccordionGroup>

## Shared building blocks

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="extra_hosts and host.docker.internal">
    The `cognee` and `cognee-mcp` services map `host.docker.internal` to `host-gateway`:

    ```yaml theme={null}
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ```

    This lets a container reach services running directly on your machine — an Ollama server, or a Postgres instance you started outside Compose. Use `host.docker.internal` in place of `localhost` for those, for example `LLM_ENDPOINT=http://host.docker.internal:11434/v1`.
  </Accordion>

  <Accordion title="Resource limits">
    ```yaml theme={null}
    deploy:
      resources:
        limits:
          cpus: "4.0"
          memory: 8GB
    ```

    Docker Compose v2 applies these as hard CPU and memory caps: `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.
  </Accordion>

  <Accordion title="Combining profiles">
    Profiles are additive — repeat the flag to start several optional services together:

    ```bash theme={null}
    docker compose --profile postgres --profile neo4j up --build
    ```

    You can also set them once for the shell session:

    ```bash theme={null}
    export COMPOSE_PROFILES=postgres,neo4j
    docker compose up --build
    ```
  </Accordion>
</AccordionGroup>

<Card title="Need help?" href="https://discord.gg/m63hxKsp4p" icon="discord">
  Join our community for Docker deployment support.
</Card>
