# Self-host ctxpipe (https://docs.ctxpipe.ai/docs/self-hosting)

Self-hosted ctxpipe is the same product as hosted ctxpipe. It runs in
infrastructure that you control. The ctxpipe team is not in the data path. Your
deployment holds the credentials and the source data. Model requests go from
your deployment to the provider that you choose.

## Choose a deployment path

| Path                                                   | Use it when                                                           | You operate                                         |
| ------------------------------------------------------ | --------------------------------------------------------------------- | --------------------------------------------------- |
| [Docker Compose](/docs/self-hosting/deployment/docker) | You evaluate ctxpipe, or run a small internal deployment on one host. | One Compose project and its volumes                 |
| [AWS CDK](/docs/self-hosting/deployment/aws)           | You run ctxpipe in your own AWS account.                              | The `CtxPipe` construct, a domain, and model access |

Each path provides the same services in a different way:

|                 | Docker Compose                              | AWS CDK                                     |
| --------------- | ------------------------------------------- | ------------------------------------------- |
| Postgres        | `pgvector/pgvector` (Postgres 17) container | Aurora PostgreSQL 16                        |
| Graph database  | FalkorDB container                          | Amazon Neptune                              |
| Knowledge store | ClickHouse container                        | ClickHouse on one EC2 host, old parts on S3 |
| Sandboxes       | Docker-in-Docker (`dind`)                   | A Graviton EC2 Docker host                  |
| Public origin   | Your TLS proxy in front of the backend      | Route 53 and a load balancer                |

Start with the [quickstart](/docs/self-hosting/quickstart). It covers each path.

## What you run

* **Backend**: auth, the REST API, the MCP endpoint, webhooks, and the public
  origin. It also serves the UI.
* **UI**: the web app, behind the backend.
* **Worker**: the background jobs for ingestion, connectors, and Workspace
  writes.
* **Codesearch**: repository clones and code search indexes, on persistent
  storage.
* **PostgreSQL with pgvector**: the application data and the job state.
* **A graph database**: FalkorDB by default.
* **ClickHouse**: the new knowledge store for the documents, their sections,
  and their relations. See
  [Knowledge store](/docs/self-hosting/configuration#knowledge-store).
* **A sandbox host**: runs Workspace chat and ingestion in isolated containers.
  Without one, chat answers `503`. For another platform, see
  [Chat sandboxes](/docs/self-hosting/configuration#chat-sandboxes).

OpenTelemetry export is off by default. See
[Observability](/docs/self-hosting/configuration#observability).

## What you own

* One stable public HTTPS origin, `AUTH_BASE_URL`, for the browser, the API,
  auth, MCP, and the provider callbacks.
* Durable storage, backups, and recovery for Postgres, the graph database,
  ClickHouse, and codesearch. See [Graph databases](/docs/self-hosting/graph-databases).
* The secrets for auth and encryption, and the model provider credentials for
  chat, ingestion, and embeddings. See [Models](/docs/self-hosting/models).
* A provider app for each connector that you turn on: a GitHub App for
  repositories, and OAuth apps for Atlassian, Slack, Linear, Notion, and
  PagerDuty. See the source connector pages in this section.
* Monitoring, migrations, upgrades, and rollback.

After the deployment is healthy, people use it like hosted ctxpipe. Send them
to [Connections](/docs/connections) and
[Connect your agent](/docs/mcp/mcp-docs).

<Cards>
  <Card title="Quickstart" href="/docs/self-hosting/quickstart" description="Deploy ctxpipe, connect GitHub, and test the MCP tools." />

  <Card title="Architecture" href="/docs/self-hosting/architecture" description="Services, ports, request flow, and state." />

  <Card title="Configuration" href="/docs/self-hosting/configuration" description="URLs, secrets, providers, and service settings." />

  <Card title="Production readiness" href="/docs/self-hosting/production-readiness" description="TLS, callbacks, persistence, and security checks." />
</Cards>
