Configuration

Configuration

Configure Docker Compose, environment variables, and connector secrets for self-hosted ctx|.

Configuration is environment-driven. Set only the values your deployment needs, but treat the required auth, database, model, and public-origin values as production secrets.

Runtime requirements

  • A supported deployment path: Docker Compose, the repository Terraform stack (Railway + Neon), or AWS CDK
  • PostgreSQL 17; the reference Compose image is pgvector on Postgres 17
  • A graph database; FalkorDB is included in the reference Compose stack
  • An SMTP provider for transactional email
  • An OpenRouter, Azure, Bedrock, or OpenAI-compatible model provider
  • A public HTTPS origin for production auth callbacks, webhooks, MCP, and Forge remotes

Docker Compose

Clone the repository and copy the example environment file:

git clone https://github.com/ctxpipe-ai/ctxpipe.git
cd ctxpipe
cp docker-compose.env.example .env

Edit .env with your values. The full production-style stack is the Compose deploy profile:

pnpm start

The deploy profile starts Postgres, FalkorDB, OTEL collector, migrator, backend, worker, UI, and codesearch. The backend listens on the public app port and proxies the UI.

Required variables

VariableDescription
DATABASE_URLPostgreSQL connection string, for example postgresql://user:pass@host:5432/db
AUTH_SECRETRandom 32+ character string for session signing. Generate with openssl rand -hex 32.
AUTH_BASE_URLPublic URL of your ctx| instance, for example https://ctx.example.com
CTXPIPE_PUBLIC_APP_URLPublic backend URL baked into the UI image. Usually the same value as AUTH_BASE_URL.
MODEL_PROVIDER_API_KEYAPI key for your configured model provider

Email

VariableDescription
SMTP_CONNECTION_URLSMTP connection URL, for example smtps://user:[email protected]:465
EMAIL_FROM_ADDRESSFrom address for transactional email, for example [email protected]

Social sign-in

All social providers are optional. Omit the variables to disable that provider.

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth app client ID
GITHUB_CLIENT_SECRETGitHub OAuth app client secret
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
MICROSOFT_CLIENT_IDMicrosoft Entra application client ID
MICROSOFT_CLIENT_SECRETMicrosoft Entra client secret

See Authentication for OAuth and session behavior.

Models and embeddings

VariableDescription
MODEL_PROVIDEROptional. openai-like default, openrouter, azure, or bedrock.
MODEL_PROVIDER_API_KEYAPI key for OpenAI-compatible providers. Omit for native Bedrock IAM.
MODEL_PROVIDER_URLOptional for openai-like and openrouter; required for Azure; not used by native Bedrock.
MODEL_BEDROCK_AWS_REGIONOptional explicit region for native Bedrock; otherwise use the AWS runtime region.
MODEL_FAST_NAME, MODEL_MEDIUM_NAME, MODEL_HIGH_NAMEOptional model names per tier.
MODEL_EMBEDDING_NAMEOptional embedding model ID.

See Model configuration for provider-specific examples and embedding requirements.

Graph database

VariableDescription
GRAPH_DB_PROVIDEROptional. Selects graph provider strategy.
GRAPH_DB_URIFalkorDB Redis URI or Bolt URI for another supported graph database.
GRAPH_DB_USER, GRAPH_DB_PASSWORDOptional credentials for providers that require them.

See Graph databases for provider support and tenancy behavior.

GitHub App connector

Repository connectors use a deployment-owned GitHub App. The in-product wizard stores its ID, PEM private key, and webhook secret encrypted for the connection.

VariableDescription
GITHUB_APP_IDOptional after migrations. GitHub App numeric ID.
GITHUB_PRIVATE_KEYOptional after migrations. PEM private key for the App.
GITHUB_WEBHOOK_SECRETOptional after migrations. Also used for the legacy webhook route.
GITHUB_APP_SLUGOptional. Public app slug used for default install URLs.
CONNECTION_SECRETS_ENCRYPTION_KEYOptional 64-character hex key. When unset, encryption derives from AUTH_SECRET.

The wizard reserves the connection-specific webhook URL and provides the exact value to paste into GitHub.

OAuth sign-in is separate

GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are for signing in with GitHub. GitHub App credentials are for repository installation and webhook access.

See GitHub for App registration, permissions, events, credentials, installation, and end-to-end verification.

Atlassian and Confluence

Self-hosted Confluence uses the same product wizard as fully managed ctx|, but your deployment or organization must provide Atlassian and Forge settings first.

VariableDescription
ATLASSIAN_CLIENT_ID, ATLASSIAN_CLIENT_SECRETOptional global Atlassian 3LO app for account linking. If unset, each Forge connection can store its own 3LO credentials through the wizard.
CONFLUENCE_FORGE_INSTALL_URLOptional deployment-wide Forge install URL fallback when a Forge connection has no install URL in connections.config.

See Confluence & Atlassian for the full operator flow.

Slack

Self-hosted Slack uses one deployment-owned Slack app. Organizations authorize that app; they do not create per-tenant Slack apps or Event Subscription URLs.

VariableDescription
SLACK_CLIENT_ID, SLACK_CLIENT_SECRETSlack app OAuth credentials. Required to enable the Slack connector.
SLACK_SIGNING_SECRETVerifies Event Subscription requests (X-Slack-Signature).
SLACK_REDIRECT_URIOptional. Override when the public OAuth callback differs from {AUTH_BASE_URL}/api/v1/connectors/slack/oauth/callback.

Set the client ID, client secret, and signing secret together, then restart or redeploy backend. Backend and worker must share the same AUTH_SECRET and, when configured, CONNECTION_SECRETS_ENCRYPTION_KEY so encrypted Slack bot tokens remain usable by background capture jobs.

Set the Slack Event Subscriptions Request URL to:

https://<public-origin>/api/v1/webhook/slack

See Slack for scopes, app_mention Events, and intent-based thread capture.

Linear

Linear uses a deployment-owned OAuth application and signed application webhooks. Put the credentials on both backend and worker services.

VariableDescription
LINEAR_CLIENT_ID, LINEAR_CLIENT_SECRETLinear OAuth application credentials. Both are required to enable the connector.
LINEAR_REDIRECT_URIOptional exact callback override. Defaults to {AUTH_BASE_URL}/api/v1/integrations/linear/callback.
LINEAR_WEBHOOK_SECRETSigning secret for requests delivered to /api/v1/webhook/linear. Required for incremental updates.

See Linear for application registration, webhook subscriptions, preview limitations, and troubleshooting.

Notion

Notion uses one deployment-owned public integration and one deployment webhook subscription.

VariableDescription
NOTION_CLIENT_ID, NOTION_CLIENT_SECRETPublic integration OAuth credentials. Both are required to enable the connector.
NOTION_REDIRECT_URIOptional exact callback override. Defaults to {AUTH_BASE_URL}/api/v1/connectors/notion/oauth/callback.
NOTION_WEBHOOK_SECRETVerification token shown by Notion after the first webhook delivery. Required for signed updates.

Put the OAuth credentials on every service that performs token refresh or connector work, then register the single deployment webhook. See Notion for provisioning and verification.

Observability

ctx| can export OpenTelemetry data when endpoints are configured.

VariableDescription
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTOTLP traces endpoint, for example http://collector:4318/v1/traces.
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOTLP logs endpoint for evlog drain. If unset, logs go to stdout only.
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTOTLP metrics endpoint.
OTEL_EXPORTER_OTLP_HEADERSOptional headers, for example Authorization=Bearer xxx.
OTEL_SERVICE_NAMEService name for resource attributes.

The repo includes a reference OpenTelemetry Collector in apps/otel-collector that can fan out to APM and Langfuse-style trace backends.

Advanced

VariableDescription
AUTH_ISSUEROverride the OAuth issuer claim. Defaults to AUTH_BASE_URL.
AUTH_ALLOWED_ORIGINSComma-separated list of allowed CORS origins for auth endpoints.
CODESEARCH_URLURL of the codesearch service when running separately.
AMPLITUDE_API_KEY, AMPLITUDE_REGIONOptional runtime product analytics configuration (us default or eu). Use the same values on backend and UI.

Amplitude configuration is read by the UI at runtime. Changing it does not require rebuilding the UI image. Leave AMPLITUDE_API_KEY unset to disable product analytics.

Railway

ctx| can be deployed on Railway with prebuilt images from GitHub Container Registry. A typical flow is:

  1. Build and push service images from CI:
    • ghcr.io/ctxpipe-ai/backend:<sha>
    • ghcr.io/ctxpipe-ai/worker:<sha>
    • ghcr.io/ctxpipe-ai/ui:<sha>
    • ghcr.io/ctxpipe-ai/codesearch:<sha>
  2. Configure Railway services to use image sources.
  3. Set environment variables and secrets in Railway.
  4. Roll production by changing service image tags to the intended commit SHA.