diff --git a/README.md b/README.md
index a21e9aafb57..9f73ae7ccab 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
-
+
@@ -96,56 +96,7 @@ See the [MCP docs](https://docs.sim.ai/mcp/overview) for other clients and for s
## Self-hosting
-**Requirements:** [Node.js 20+](https://nodejs.org/) and [Docker](https://www.docker.com/).
-
-`npx sim-setup` is an interactive wizard that creates a small `sim/` deployment directory, provisions the database, generates secrets, writes `.env`, connects a Chat API key, and starts the published Sim images with Docker Compose. It does not clone the repository.
-
-When it finishes, open [http://localhost:3000](http://localhost:3000).
-
-Inside a cloned Sim repository, run `bun run sim-setup` to unlock the source-only local development and Kubernetes modes.
-
-Reconfigure an optional capability without rerunning the full wizard:
-
-```bash
-npx sim-setup config
-npx sim-setup add email
-npx sim-setup add storage
-npx sim-setup add sandbox
-npx sim-setup add jobs
-npx sim-setup add knowledge
-npx sim-setup add chat
-npx sim-setup add llm
-npx sim-setup add integration slack
-```
-
-`npx sim-setup config` detects the effective local-dev, Docker Compose, or current-context
-Helm configuration and reports configured, missing, or invalid capabilities and OAuth
-integrations without printing credential values. This is separate from `npx sim-setup status`,
-which reports whether installed services are running and healthy.
-
-Manage your install from its directory:
-
-```bash
-npx sim-setup start | stop | restart # bring your install up / down / cycle
-npx sim-setup update # pull and apply Compose images
-npx sim-setup status # what's installed and healthy
-npx sim-setup logs # follow logs
-npx sim-setup doctor # diagnose configuration problems
-npx sim-setup down # remove containers (data kept)
-npx sim-setup reset # archive .env and wipe managed data
-```
-
-The setup package detects how you're running and acts accordingly. Use `--dir ` to create or manage a deployment somewhere other than `./sim`.
-
-Sim also supports local models via [Ollama](https://ollama.ai), [vLLM](https://docs.vllm.ai/), and [LiteLLM](https://docs.litellm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details.
-
-## Chat API Keys
-
-Chat is a Sim-managed service. `npx sim-setup` connects a Chat API key for you — sign in when it opens your browser and the key is stored automatically. To view, create, or revoke keys later, go to [sim.ai/selfhost/settings/chat-keys](https://sim.ai/selfhost/settings/chat-keys).
-
-## Environment Variables
-
-See the [environment variables reference](https://docs.sim.ai/self-hosting/environment-variables) for the full list, or [`apps/sim/.env.example`](apps/sim/.env.example) for defaults.
+`npx sim-setup` needs [Node.js 20+](https://nodejs.org/) and [Docker](https://www.docker.com/). It writes a `sim/` directory with the Compose file and a generated `.env`, connects a Chat API key, and starts Sim at [http://localhost:3000](http://localhost:3000). The [self-hosting guide](https://docs.sim.ai/platform/self-hosting) covers Kubernetes, configuration, local models, and upgrades.
## Tech Stack
diff --git a/apps/docs/COPY_AUDIT.md b/apps/docs/COPY_AUDIT.md
index 344e0f63e74..612af0680e8 100644
--- a/apps/docs/COPY_AUDIT.md
+++ b/apps/docs/COPY_AUDIT.md
@@ -502,7 +502,6 @@ Every row below represents a fully reviewed inventory entry. “Rewritten” inc
| [platform/self-hosting/index.mdx](content/docs/platform/self-hosting/index.mdx) | rewritten | Replaced the drifting manual quick-start script with the setup wizard and Docker owner. Separated resource examples from enforced requirements and operational defaults. Placed key/file durability, public origin, email, scheduler, and verification before optional dependencies. Qualified enterprise behavior by billing mode and retained local embedding/remote image prerequisites. | Verified improvement. Reorders deployment choice, supported wizard, production hazards and dependencies; sizing becomes examples rather than user-count guarantees. Verified late fix: Quick start now places Bun and Node.js20 or newer before bunx sim-setup, alongside the preserved Docker and Compose2.24.0 prerequisites. Wizard output, manual setup links and production safeguards remain. Preserved: All deployment choices, resource examples, enterprise/org prerequisites, model/embedding/Chat/OAuth/remote dependencies and next steps retained. Removed raw5secret quickstart replaced by wizard plus full Docker manual setup. |
| [platform/self-hosting/integrations-oauth.mdx](content/docs/platform/self-hosting/integrations-oauth.mdx) | rewritten | Created canonical Google, Microsoft, and Atlassian console setup sections for Search crosslinks. Preserved full Google Search member scopes/callbacks, all Microsoft resource scopes, full Confluence/Jira member scopes, API permissions/consent/distribution and reconnection distinctions. Added Intune, Ramp, and QuickBooks per-connection configuration; kept all prior provider exceptions/flows and hosted-only key constraints. Kept the complete GitHub App setup at its inbound anchor and removed both screenshots, retaining the correct six-permission table. Folded duplicate FAQ into setup/provider/troubleshooting sections and corrected Kubernetes secret modes. Used shared authored tabs with padded mixed content, wrapped prose, visible horizontal scrolling, and mobile touch targets. | Verified improvement. Adds complete Google/Microsoft/Atlassian member grants and distinction from Search service accounts; corrects secret-store deployment setup and scope-update/reconnect procedure. Verified late fix: GitHub App replacement now uses Credential Groups → Integrations → Update configurations. The migration affects existing provider options, preserves option IDs and retains all reconnect and secret handling consequences. Preserved: All original provider IDs/envcredentials/callbacks, GitHubAppsettings/readpermissions5variablesPEMrefresh/privateboundaries, Bitbucketexactpermissions,7providerextras, alternateInstagram/Shopify/Trelloflows, hostedkeycatalog/limits and nativeSlack requirements retained; current Ramp/Intune/QuickBooks added. Screenshots removed with full GitHub fields intact. |
| [platform/self-hosting/kubernetes.mdx](content/docs/platform/self-hosting/kubernetes.mdx) | rewritten | Pinned published chart 1.11.8/appVersion v0.9.17 without claiming a live installation test or latest status. Replaced partial public-origin snippet with complete same-host/split-host routing, allowed origin and TLS Secret instructions. Separated inline, existing-Secret and ESO branches; documented env versus envDefaults and retained all core credentials. Labeled legacy ingress-nginx defaults and annotations honestly; did not choose/provision a controller or invent Gateway API support. Pinned cloud example source v0.9.17 and required review of certificate/IAM/storage/project placeholders; preserved database-name and key-loss upgrade caveats. Corrected cosign reference syntax and qualified registry mirroring of verification artifacts. | Verified improvement. Provides full3secretmode setup, working dual port-forward/public socket/TLS examples, same-releasepinnings, verification and safe retained-secret upgrades; scopes ingress retirement. Preserved: Every original OCI/classicrepo/cosign/attestation/cloud6domainoverride/ExternalDB/redis/migrations/cron/backupconversion/PVC consequence retained; code snippets now complete and pinned instead of abstract v1.2.3. |
-| [platform/self-hosting/platforms.mdx](content/docs/platform/self-hosting/platforms.mdx) | rewritten | Converted unsupported Railway template guarantees into concrete verification steps and exposed five-minute cron limits. Replaced the production convenience-script recommendation with official Docker installation and plugin prerequisites. Clarified provider-specific cloud placeholders and extension availability/activation. Labeled external DATABASE_URL scope and explained production Compose overrides. | Verified improvement. Removes unsupported live-template assumptions and adds minute-scheduler gap, maintained ingress requirement and externalDSN Compose limitation. Preserved: Railway/VPS/EKS/AKS/GKE/database providers, pgvector requirement, TLS/ManagedCertificate, resource sizing and externalDatabase setup remain; Railway badge replaced by usable linked template. |
| [platform/self-hosting/verify.mdx](content/docs/platform/self-hosting/verify.mdx) | rewritten | Preserved all 12 checks and doctor file/journal/live-probe limitations, then separated core and feature checks. Corrected cloud/local multipart thresholds and cross-replica proof claims. Added namespace-consistent commands, avoided printing a Redis credential, and checked actual job success rather than schedules alone. Preserved credential restore checks, uppercase INFO logging/no-op behavior, and upgrade subset. | Verified improvement. Replaces presence-only health guarantees with actual data/recipient/completion results and crosspod requirement; corrects multipart localvscloud thresholds. Preserved: All12checks/failureactions, doctor5groups/repairlimits/journal/skippedprobes, domains, infra/Composecommands, loglevel and postupgrade/postrestore OAuth-key checks retained. |
### Self hosting operations (12)
diff --git a/apps/docs/content/docs/platform/enterprise/self-hosted.mdx b/apps/docs/content/docs/platform/enterprise/self-hosted.mdx
index 27fdcdd4517..bd09e7efe64 100644
--- a/apps/docs/content/docs/platform/enterprise/self-hosted.mdx
+++ b/apps/docs/content/docs/platform/enterprise/self-hosted.mdx
@@ -30,6 +30,8 @@ DATA_DRAINS_ENABLED=false
You can also leave the master switch unset and enable individual features. The [feature flag reference](#feature-flag-reference) lists them all.
+The suite includes retention deletion. Review any retention windows your organizations have configured before turning it on, or set `DATA_RETENTION_ENABLED=false`.
+
## Choose an organization model
### One organization for the instance
diff --git a/apps/docs/content/docs/platform/self-hosting/architecture.mdx b/apps/docs/content/docs/platform/self-hosting/architecture.mdx
index 5f4265ec939..d653d2b8c15 100644
--- a/apps/docs/content/docs/platform/self-hosting/architecture.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/architecture.mdx
@@ -1,116 +1,52 @@
---
title: Architecture
-description: Services, dependencies, request paths, and durable state in a self-hosted deployment
+description: Services, request paths, and durable state in a self-hosted deployment
---
-import { Callout } from '@/components/ui/callout'
-
-Sim runs an app, a realtime server, PostgreSQL, Redis, and a scheduler. This page shows their dependencies and the state you need to preserve.
+Sim runs an app, a realtime server, PostgreSQL, Redis, and a scheduler. This page shows how they connect and what you must preserve.
## Services
-| Service | Image | Port | State | Required |
-|---|---|---|---|---|
-| **app** | `ghcr.io/simstudioai/simstudio` | 3000 | Local uploads unless shared storage is configured | Yes |
-| **realtime** | `ghcr.io/simstudioai/realtime` | 3002 | In-flight collaboration state | Yes |
-| **migrations** | `ghcr.io/simstudioai/migrations` | — | One-shot schema and data migrations | Yes |
-| **postgresql** | `pgvector/pgvector:pg17` | 5432 | Durable application data | Yes |
-| **redis** | `redis:7-alpine` | 6379 | Rate limits, coordination, and live events | Yes (bundled by default) |
-| **cron** | `ghcr.io/simstudioai/cron` (Compose) / `curlimages/curl` (Kubernetes) | — | None | Required for scheduled work |
-| **pii** | `ghcr.io/simstudioai/pii` | 5001 | None | Optional |
-| **ollama** | `ollama/ollama` | 11434 | Model cache | Optional |
-| **telemetry** | `otel/opentelemetry-collector-contrib` | 4317/4318 | None | Optional |
-
-### App
-
-The Next.js app serves the workflow builder, API routes, and workflow orchestration. Local JavaScript runs in Node child workers using isolated-vm inside the app container. The app and those workers share the container's memory budget. The Helm chart requests 4 GiB and limits the app to 8 GiB; `docker-compose.prod.yml` sets an 8 GB memory limit without a reservation.
-
-E2B or Daytona moves supported code execution to a remote sandbox. `TRIGGER_DEV_ENABLED` routes asynchronous jobs to Trigger.dev; the default deployment uses database-backed jobs. See [Sandboxes](/platform/self-hosting/sandboxes) for the provider and image requirements.
-
-Any replica can serve files once shared object storage is configured. Before adding replicas, configure storage, Redis, and database connection capacity as described in [Scaling and high availability](/platform/self-hosting/scaling).
-
-### Realtime
-
-The Bun Socket.IO server carries collaborative editing, live execution updates, and collaborative documents. Clients connect at `/socket.io`.
-
-Realtime shares PostgreSQL and `BETTER_AUTH_SECRET` with the app, using Better Auth's shared-database-session pattern. It authenticates the same accounts without a separate login.
-
-
- Realtime requires `REDIS_URL`, pointing at the same Redis as the app. The Socket.IO Redis adapter carries events between replicas, so members connected to different pods see each other's edits.
-
-
-A realtime server must exist for editing and live updates. Set `realtime.enabled: false` in Helm only when `app.env.SOCKET_SERVER_URL` points to a realtime instance you run separately.
-
-### Migrations
-
-The migrator applies Drizzle SQL and registered data migrations, then exits. Compose runs it as a one-shot service. Helm runs it as an app init container, so migrations complete before that app pod starts. Later pods and rollouts run the migrator again; already-applied migrations are skipped.
-
-Migrations are forward-only. See [Upgrades](/platform/self-hosting/upgrades) for backup and rollback procedures.
-
-### PostgreSQL
+| Service | Image | Port | Required |
+| --- | --- | --- | --- |
+| **app** | `ghcr.io/simstudioai/simstudio` | 3000 | Yes |
+| **realtime** | `ghcr.io/simstudioai/realtime` | 3002 | Yes |
+| **migrations** | `ghcr.io/simstudioai/migrations` | None | Yes, once per release |
+| **postgresql** | `pgvector/pgvector:pg17` | 5432 | Yes |
+| **redis** | `redis:7-alpine` | 6379 | Yes |
+| **scheduler** | `ghcr.io/simstudioai/cron` (Compose), `curlimages/curl` CronJobs (Helm) | None | For scheduled work |
+| **pii** | `ghcr.io/simstudioai/pii` | 5001 | Optional |
+| **ollama** | `ollama/ollama` | 11434 | Optional |
+| **copilot** | Private Mothership image | 8080 | Optional; see [Chat service](/platform/self-hosting/chat) |
-Sim requires PostgreSQL with the pgvector extension for knowledge base embeddings. The bundled image uses PostgreSQL 17 and includes pgvector. On managed PostgreSQL, make the extension available; migrations issue `CREATE EXTENSION` where permissions allow.
+**App.** The Next.js app serves the editor, the API, and workflow execution. Plain JavaScript runs in isolated-vm workers inside the app container and shares its memory; other code runs in a [remote sandbox](/platform/self-hosting/sandboxes). Background jobs run in the app on a database-backed queue.
-PostgreSQL holds workflows, runs, logs, accounts, organizations, credentials, knowledge base chunks and embeddings, table data, and upload-session state.
+**Realtime.** A Bun Socket.IO server for collaborative editing and live execution updates, served at `/socket.io`. It shares PostgreSQL, `BETTER_AUTH_SECRET`, and Redis with the app, so users sign in once. In Helm, `realtime.enabled: false` is only for pointing `SOCKET_SERVER_URL` at a realtime server you run elsewhere.
-### Redis
+**Migrations.** Apply schema and data migrations, then exit. Compose runs them before the app starts; Helm runs them as an init container on every app pod, and already-applied migrations are skipped. They are forward-only; see [Upgrades](/platform/self-hosting/upgrades).
-Redis is required, even with one replica. It holds rate-limit buckets, one-time passcodes, and shared coordination state, and carries live events between processes. There is no PostgreSQL or process-local fallback, and the app refuses to start without `REDIS_URL`. See [Redis](/platform/self-hosting/redis) for everything it backs.
-
-### Scheduler
-
-Scheduled workflows, polling triggers, connector syncs, subscription renewal, and maintenance jobs call authenticated app endpoints. Helm provides CronJobs; Compose provides a supercronic service. See [Background jobs](/platform/self-hosting/background-jobs) for the shipped inventory and the additional upload-session cleanup schedule operators must configure.
-
-### Optional Chat service
-
-The chart can also render the optional `copilot` service, its separate PostgreSQL database, and its migration job. These are separate from the app and workflow database. Enabling them requires the service's image, license, credentials, and database configuration; see [Chat service](/platform/self-hosting/chat).
-
-## Where state lives
-
-| Store | Contents | Backup |
-|---|---|---|
-| **PostgreSQL** | Application data, including any separately enabled Chat-service database | `pg_dump`, managed snapshots, and point-in-time recovery |
-| **Object storage** | Files, knowledge base documents, execution outputs, avatars, and logos | Bucket versioning and lifecycle policies |
-| **Secrets** | `ENCRYPTION_KEY`, `API_ENCRYPTION_KEY`, `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, `CRON_SECRET` | Secret manager and separate recovery copies |
-
-
- Without object storage, uploads are local: Compose keeps them in the `sim_uploads` volume on one host, and the Helm chart keeps them on each pod, lost when it is recreated. Configure [object storage](/platform/self-hosting/object-storage) before storing durable files or scaling.
-
-
-
- Back up `ENCRYPTION_KEY` separately from PostgreSQL. A database restore with a different key cannot decrypt workspace and personal environment variables, stored provider keys, MCP OAuth credentials, or deployment/chat secrets. Recovery requires the original key or re-encryption before rotation.
-
-
-Redis is a cache and message bus, not the owner of committed application data. Losing it interrupts in-flight coordination and live updates; completed data remains in PostgreSQL and object storage.
+**PostgreSQL** needs the pgvector extension. **Redis** is required at any replica count; see [Redis](/platform/self-hosting/redis). **The scheduler** calls authenticated app endpoints; see [Background jobs](/platform/self-hosting/background-jobs).
## Request paths
| Traffic | Path |
-|---|---|
-| Editor / API | Browser → ingress or reverse proxy → app:3000 → PostgreSQL, Redis, storage |
-| Collaboration | Browser → ingress → realtime:3002 (`/socket.io`, WebSocket upgrade) → Redis → other realtime pods |
-| Cloud upload | Browser → app opens upload session → signed transfer instructions → browser uploads directly to storage → app verifies completion and records metadata |
-| Local upload | Browser → app opens upload session → bytes stream through `/api/v2/uploads/...` to local disk |
-| Workflow execution | Manual, API, webhook, or schedule trigger → app enqueues or orchestrates run → local code workers or remote sandbox → results/logs to PostgreSQL, progress markers to Redis |
-| Background work | Scheduler → `Authorization: Bearer $CRON_SECRET` → internal app endpoint |
+| --- | --- |
+| Editor and API | Browser → proxy or ingress → app:3000 → PostgreSQL, Redis, object storage |
+| Collaboration | Browser → proxy or ingress → realtime:3002 (`/socket.io`, WebSocket) → Redis → other realtime pods |
+| File upload | Browser → app opens an upload session. With object storage, the browser uploads to the bucket with signed URLs; on local storage, bytes stream through the app. Downloads always go through the app. |
+| Workflow execution | Trigger → app → local workers or remote sandbox → results in PostgreSQL, progress in Redis |
+| Scheduled work | Scheduler → internal app:3000 with `Authorization: Bearer $CRON_SECRET` |
+| Outbound | App → model providers, integrations, email, object storage, telemetry |
-Cloud uploads use a single `PUT` through 50 MiB and multipart above that. Local uploads use a single `PUT` through 8 MiB and multipart above that. Cloud buckets need CORS for the Sim origin and must be reachable from browsers; downloads are proxied through the app. Local uploads need no bucket CORS configuration.
+Expose only the app and realtime. PostgreSQL, Redis, PII, and the job endpoints stay internal. Cloud buckets must accept CORS requests from the Sim origin and be reachable from browsers. Uploads use multipart above 50 MiB on cloud storage and above 8 MiB on local storage.
-## Network boundaries
-
-| From | To | Purpose |
-|---|---|---|
-| Internet | app:3000, realtime:3002 | Browser/API traffic |
-| App, realtime | PostgreSQL:5432, Redis:6379 | Data and coordination |
-| App | Object-storage endpoint | Storage operations and proxied downloads |
-| Browser | Object-storage endpoint | Signed uploads |
-| App | Model/integration APIs and email provider | Outbound calls |
-| Scheduler | Internal app:3000 | Scheduled work |
-
-The proxy must support WebSocket upgrades, streams, and long-lived connections. The chart's optional NetworkPolicy excludes cloud metadata addresses from broad egress, but its default ingress peer is broad. Configure the actual peers and managed-datastore paths before enabling it.
+## Where state lives
-## Related docs
+| Store | Holds | Back up with |
+| --- | --- | --- |
+| PostgreSQL | Workflows, runs, logs, accounts, credentials, knowledge base embeddings, tables | `pg_dump`, snapshots, point-in-time recovery |
+| Object storage | Files, knowledge base documents, execution outputs, avatars | Bucket versioning, or volume backups for local storage |
+| Secrets | `ENCRYPTION_KEY`, `API_ENCRYPTION_KEY`, `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, `CRON_SECRET` | A secret manager, plus a separate recovery copy |
+| Redis | Rate limits, locks, one-time codes, live events | Nothing; losing it interrupts in-flight work only |
-- [Reference architectures](/platform/self-hosting/reference-architectures)
-- [Networking](/platform/self-hosting/networking)
-- [Security and hardening](/platform/self-hosting/security)
+A database backup is unreadable without its `ENCRYPTION_KEY`; see [Secrets](/platform/self-hosting/security#secrets). Local uploads are not shared across replicas; see [Object storage](/platform/self-hosting/object-storage).
diff --git a/apps/docs/content/docs/platform/self-hosting/background-jobs.mdx b/apps/docs/content/docs/platform/self-hosting/background-jobs.mdx
index 4d121822252..5b17756d2af 100644
--- a/apps/docs/content/docs/platform/self-hosting/background-jobs.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/background-jobs.mdx
@@ -1,59 +1,27 @@
---
title: Background jobs
-description: Scheduled workflows, polling triggers, and the cron endpoints that drive them
+description: The scheduler that drives scheduled workflows, polling triggers, syncs, and cleanup
---
import { Callout } from '@/components/ui/callout'
-Scheduled workflows, polling triggers, connector syncs, and maintenance jobs depend on authenticated HTTP endpoints called by an external scheduler.
-
-Helm enables CronJobs by default; Docker Compose includes a `cron` service. Both use `CRON_SECRET` and the same shipped schedules. Upload-session cleanup needs an additional operator-configured job, described below.
+Scheduled workflows, polling triggers, connector syncs, and maintenance run when a scheduler calls authenticated app endpoints. Helm deploys one CronJob per job and Compose runs a `cron` service; both run the [same jobs on the same schedules](#shipped-jobs).
## Authentication
-Every endpoint is protected by `CRON_SECRET` and expects it as a bearer token:
-
-```bash
-curl -f -s -S --max-time 60 \
- -H "Authorization: Bearer $CRON_SECRET" \
- https://sim.yourdomain.com/api/schedules/execute
-```
-
-Generate it like the other secrets:
+Every endpoint expects `CRON_SECRET` as a bearer token, and the app and scheduler must hold the same value:
```bash
-openssl rand -hex 32
+curl -fsS -H "Authorization: Bearer $CRON_SECRET" http://localhost:3000/api/schedules/execute
```
-
- Background jobs require `CRON_SECRET`. Helm rejects a missing inline value when CronJobs are enabled. With a pre-created Secret or External Secrets, supply the key in that Secret; otherwise cron pods cannot start. Endpoints reject calls without the matching secret.
-
-
-Point cron at an **internal** address where possible (the in-cluster Service, or `localhost` on a single node). These endpoints should not be reachable from the internet; if they are, `CRON_SECRET` is the only thing protecting them.
+Generate it with `openssl rand -hex 32`. The shipped schedulers call the app's internal address; keep these endpoints off the public internet, where `CRON_SECRET` would be their only protection.
## Kubernetes
-CronJobs are enabled by default. Supply `CRON_SECRET` through the app Secret and ensure cron pods can reach the internal app Service.
-
-```yaml
-cronjobs:
- enabled: true
-```
-
-Each `curlimages/curl` pod calls the internal app Service, which routes the request to one replica. `concurrencyPolicy: Forbid` prevents overlapping Jobs for that CronJob; the app also handles overlap for detached work.
-
-| Setting | Shipped behavior |
-|---|---|
-| Completed/failed Job history | Three successful and one failed Job |
-| Finished-Job TTL | 600 seconds; collect logs before deletion |
-| Job deadline | 300 seconds by default; outbox uses 900, idempotency cleanup 360 |
-| Kubernetes retry limit | No chart `backoffLimit` key; Kubernetes defaults to six retries after the initial failure |
-| Request retries | Three shell attempts, ten seconds apart; each uses `curl --retry 2 --retry-delay 5` |
-| Request timeout | 60 seconds by default, with per-job overrides; outbox uses 810 seconds |
+CronJobs are on by default (`cronjobs.enabled`); with inline secrets, the chart refuses to render without `CRON_SECRET`. Each Job runs `curl` against the app Service with three attempts, each with curl retries, a 60-second request timeout (longer for a few slow jobs), and a 300-second Job deadline. Kubernetes keeps three successful and one failed Job for 600 seconds; collect logs before they go.
-The Job deadline includes attempts and controller backoff. It can end a Job before the retry limit is reached and also stops a hung request.
-
-Disable individual jobs you do not need — billing reconciliation is the obvious one on a self-hosted install:
+Turn off a job you do not need, such as billing reconciliation without billing:
```yaml
cronjobs:
@@ -62,9 +30,7 @@ cronjobs:
enabled: false
```
-Do not disable schedule execution, outbox processing, or subscription renewal unless you know you do not use the features behind them.
-
-Check they are running:
+Keep schedule execution, outbox processing, and subscription renewal on unless you use none of their features.
```bash
kubectl get cronjobs -n simstudio
@@ -72,60 +38,38 @@ kubectl get jobs -n simstudio --sort-by=.metadata.creationTimestamp | tail
kubectl logs -n simstudio 'job/'
```
-Inspect stale schedules and failed Jobs. A stale `LAST SCHEDULE` points to controller, suspension, or deadline settings; a 401 in Job logs points to authentication. `Forbid` can skip a tick while an earlier Job remains active. Alert on successful completion as described in [Observability](/platform/self-hosting/observability).
+A stale `LAST SCHEDULE` points to suspension, controller, or deadline settings; `concurrencyPolicy: Forbid` skips a tick while the previous Job runs.
## Docker Compose
-Generate a secret, then save it as `CRON_SECRET` in the `.env` file next to your Compose file. Replace an existing value rather than adding a duplicate. The app and scheduler must receive the same value.
-
-```bash
-openssl rand -hex 32
-```
-
-Recreate the services after updating `.env`:
-
-```bash
-docker compose -f docker-compose.prod.yml up -d
-```
-
-Without it the `cron` service logs exactly what to set — including a freshly generated value — and exits, leaving the rest of the stack running. Schedules live in `docker/crontab` and mirror `helm/sim/values.yaml` `cronjobs.jobs` one-for-one.
-
-An older install may lack `CRON_SECRET`; add it to `.env` and run `up -d` to enable the scheduler.
-
-The service runs [supercronic](https://github.com/aptible/supercronic) rather than the app image: it logs each job's output to the container log, forwards `SIGTERM` so `docker compose stop` is graceful, and will not start an iteration while the previous one is still running.
+The `cron` service runs [supercronic](https://github.com/aptible/supercronic) with the schedules in `docker/crontab`. Without `CRON_SECRET` in `.env` it prints what to set and exits; add the value and run `docker compose -f docker-compose.prod.yml up -d`.
```bash
docker compose -f docker-compose.prod.yml logs -f cron
```
-A healthy log line looks like:
-
-```
-level=info msg=starting iteration=0 job.schedule="*/1 * * * *"
-level=info msg="job succeeded" iteration=0
-```
-
-The published cron image contains its crontab. Editing the repository copy and restarting that image does not change its jobs. To customize them, copy `docker/crontab` to an operator-owned file, edit it, and mount it with a Compose override:
+Healthy output shows `msg="job succeeded"` for each run. The crontab is baked into the cron image; to change it, copy `docker/crontab` from your release, edit it, and mount it with an overlay:
```yaml
-# cron-custom.yml
+# cron-custom.yml — docker compose -f docker-compose.prod.yml -f cron-custom.yml up -d cron
services:
cron:
volumes:
- ./sim-crontab:/etc/sim/crontab:ro
```
-```bash
-docker compose -f docker-compose.prod.yml -f cron-custom.yml up -d cron
-```
-
-Alternatively, build a custom image from `docker/cron.Dockerfile` with your crontab and configure Compose to use it.
+## Jobs you schedule yourself [#schedule-upload-session-cleanup]
-## Schedule upload-session cleanup
+The shipped schedules leave these out. Add them as operator-owned jobs with the same `CRON_SECRET`:
-The cleanup endpoint exists, but neither shipped scheduler calls it. Configure your own authenticated schedule for `/api/cron/cleanup-tasks` to expire upload sessions and reclaim abandoned upload state. It also dispatches task-retention cleanup according to configured policy.
+| Endpoint | When | Does |
+| --- | --- | --- |
+| `/api/cron/cleanup-tasks` | Every deployment, hourly | Expires abandoned upload sessions and their partial uploads. With retention on, it also applies Chat-task retention |
+| `/api/logs/cleanup` | With `DATA_RETENTION_ENABLED`, daily | Log retention |
+| `/api/cron/cleanup-soft-deletes` | With `DATA_RETENTION_ENABLED`, daily | Purges soft-deleted resources past retention |
+| `/api/cron/cleanup-file-versions` | With `DATA_RETENTION_ENABLED`, daily | Deletes previous file versions past retention |
-For Helm, add an operator-owned job to your values file. This example runs hourly; choose a cadence and timeout for your workload:
+On Helm, add each to your values:
```yaml
cronjobs:
@@ -137,81 +81,62 @@ cronjobs:
path: /api/cron/cleanup-tasks
requestTimeoutSeconds: 300
activeDeadlineSeconds: 360
- concurrencyPolicy: Forbid
```
-For Compose, add this line to the mounted or custom-image crontab described above:
+On Compose, add a line per endpoint to your mounted crontab:
```text
0 * * * * curl -fsS -m 300 -o /dev/null -H "Authorization: Bearer $CRON_SECRET" "$SIM_URL/api/cron/cleanup-tasks"
```
-Use the internal app address and the same `CRON_SECRET`. Check job logs for a successful response. Provider lifecycle rules remain a second layer for incomplete multipart state; see [Object storage](/platform/self-hosting/object-storage#configure-incomplete-multipart-cleanup).
-
-## Verifying
-
-Create a workflow with a Schedule trigger set to every minute, deploy it, and watch the Logs view. An execution should appear within ~2 minutes. If nothing appears:
-
-1. Check the scheduler's own logs — `docker compose -f docker-compose.prod.yml logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
-2. Confirm the app and the scheduler share the same `CRON_SECRET`. A mismatch shows up as `401` in the scheduler log.
-3. A `202` means the endpoint accepted the run; it does not confirm a schedule was due, so check the Logs view.
-
-## Shipped job reference
-
-| Job | Endpoint | Schedule | Drives |
-|---|---|---|---|
-| Schedule execution | `/api/schedules/execute` | `*/1 * * * *` | **Scheduled workflows** |
-| Gmail poll | `/api/webhooks/poll/gmail` | `*/1 * * * *` | Gmail trigger |
-| Outlook poll | `/api/webhooks/poll/outlook` | `*/1 * * * *` | Outlook trigger |
-| IMAP poll | `/api/webhooks/poll/imap` | `*/1 * * * *` | IMAP trigger |
-| RSS poll | `/api/webhooks/poll/rss` | `*/1 * * * *` | RSS trigger |
-| Google Sheets poll | `/api/webhooks/poll/google-sheets` | `*/1 * * * *` | Sheets trigger |
-| Google Drive poll | `/api/webhooks/poll/google-drive` | `*/1 * * * *` | Drive trigger |
-| Google Calendar poll | `/api/webhooks/poll/google-calendar` | `*/1 * * * *` | Calendar trigger |
-| HubSpot poll | `/api/webhooks/poll/hubspot` | `*/1 * * * *` | HubSpot trigger |
-| Time pause/resume | `/api/resume/poll` | `*/1 * * * *` | Workflows paused on a timer |
-| Outbox processing | `/api/webhooks/outbox/process` | `*/1 * * * *` | Transactional-outbox retries for billing, membership, enterprise issuance, and workflow-deployment side effects |
-| Workspace file search dispatch | `/api/cron/workspace-file-search-dispatch` | `*/1 * * * *` | Dispatches indexing work for workspace file search |
-| Knowledge projection | `/api/cron/knowledge-projection` | `*/1 * * * *` | Brings knowledge base search up to date with document, permission, and chunk changes |
-| Activity rollup | `/api/cron/activity-rollup` | `*/2 * * * *` | Maintains the hourly workflow activity rollup that serves organization activity; idle unless `ACTIVITY_ROLLUP_MAINTENANCE` is set |
-| Table row-change fold | `/api/cron/fold-table-row-changes` | `*/1 * * * *` | Folds the table row-change log into each table's stored row count and version |
-| Connector sync | `/api/knowledge/connectors/sync` | `*/5 * * * *` | Knowledge base connector syncs |
-| Connector member sync | `/api/knowledge/connectors/member-sync` | `*/5 * * * *` | Per-member content/access sync for indexed connectors; live Search sources are skipped |
-| Connector directory sync | `/api/knowledge/connectors/directory-sync` | `*/5 * * * *` | Refreshes stored groups for indexed administrator-mode connectors; live Search sources are skipped |
-| Workspace events poll | `/api/workspace-events/poll` | `*/15 * * * *` | Workspace event triggers |
-| Table row TTL cleanup | `/api/cron/cleanup-table-row-ttl` | `*/15 * * * *` | Deletes table rows whose TTL column has expired |
-| Stale execution cleanup | `/api/cron/cleanup-stale-executions` | `*/30 * * * *` | Fails runs whose worker died without finishing — workflow executions, background jobs, table jobs and table runs — so they stop showing as running |
-| OAuth token cleanup | `/api/cron/cleanup-oauth-tokens` | `0 * * * *` | Deletes access and refresh tokens after the retention tail |
-| Credential Group link cleanup | `/api/cron/cleanup-credential-group-links` | `20 * * * *` | Deletes workflow connection-request log rows after two days and connect or self-enrollment links a day after they expire |
-| Activity history cleanup | `/api/cron/cleanup-activity-history` | `45 4 * * *` | Deletes organization adoption history past its retention: daily member activity, daily Search integration counts and Search MCP call metadata after 400 days |
-| Workspace source staging cleanup | `/api/cron/cleanup-source-staging` | `30 * * * *` | Deletes binary files staged for a workspace source apply a day after they were last staged |
-| SCIM reconciliation | `/api/cron/scim-reconcile` | `17 * * * *` | Re-applies directory group mappings |
-| Data drains | `/api/cron/run-data-drains` | `*/15 * * * *` | Enterprise data drains; each drain runs only when its own cadence is due |
-| Renew subscriptions | `/api/cron/renew-subscriptions` | `0 */12 * * *` | Renews Microsoft Teams chat subscriptions (Graph caps them at ~3 days) |
-| Billing cycle close | `/api/cron/billing-cycle-close` | `0 */6 * * *` | Billing only — final overage collection and per-period tracker reset |
-| Reconcile billing seats | `/api/cron/reconcile-billing-seats` | `0 * * * *` | Billing only — safe to disable when self-hosted |
-| Reconcile inbox entitlement | `/api/cron/reconcile-inbox-entitlement` | `0 3 * * *` | Inbox access reconciliation |
-| Cleanup sandbox images | `/api/cron/cleanup-sandbox-images` | `30 4 * * *` | Reclaims sandbox images |
-| Cleanup session sandboxes | `/api/cron/cleanup-session-sandboxes` | `*/5 * * * *` | Kills chat workbenches paused past their retention window |
-| Idempotency key cleanup | `/api/webhooks/cleanup/idempotency` | `0 5 * * *` | Deletes deduplication records older than seven days |
-
-Subscription renewal covers Microsoft Teams chat triggers. Their Graph subscriptions last at most three days; rich notifications have a shorter limit. Gmail, Outlook, Drive, Calendar, and Sheets use the per-minute polling jobs instead. See [Microsoft Graph subscription lifetimes](https://learn.microsoft.com/en-us/graph/change-notifications-overview). SCIM reconciliation calls its authenticated endpoint directly each hour; it does not require Trigger.dev.
-
-## Concurrency
-
-On the default database-backed queue, scheduled execution capacity is shared across the deployment:
-
-| Variable | Default | Applies to |
-|---|---|---|
-| `SCHEDULE_EXECUTION_CONCURRENCY_LIMIT` | `30` | Scheduled workflows in flight across the database-backed queue; also the schedule task limit on Trigger.dev |
-
-
- `WORKFLOW_EXECUTION_CONCURRENCY_LIMIT`, `WEBHOOK_EXECUTION_CONCURRENCY_LIMIT`, and `RESUME_EXECUTION_CONCURRENCY_LIMIT` are `concurrencyLimit` settings on Trigger.dev task definitions. They have **no effect** unless `TRIGGER_DEV_ENABLED` is set, and neither the Helm chart nor Docker Compose configures Trigger.dev — so on a default self-host they are inert.
-
-
-Adding replicas does not multiply the database queue's schedule cap. Raise it only after measuring memory and database headroom. The app orchestrates runs; local JavaScript uses Node child workers inside its container.
-
-## Related docs
-
-- [Observability](/platform/self-hosting/observability)
-- [Upgrades](/platform/self-hosting/upgrades)
+Retention windows themselves are set per organization; see [Data retention](/platform/enterprise/data-retention).
+
+## Verify
+
+Deploy a workflow with an every-minute Schedule trigger and watch its logs. A run should appear within two minutes. If not, read the scheduler logs: `401` means `CRON_SECRET` differs, and `202` means the endpoint accepted the call, not that a schedule was due.
+
+## Shipped jobs
+
+Generated from `cronjobs.jobs` in the chart's `values.yaml`, which `docker/crontab` mirrors.
+
+{/* self-hosting-cron-jobs:begin — generated by `bun run generate:self-hosting-docs`; do not edit between markers */}
+
+| Job | Endpoint | Schedule | Does |
+| --- | --- | --- | --- |
+| `schedule-execution` | `/api/schedules/execute` | `*/1 * * * *` | Runs scheduled workflows |
+| `gmail-webhook-poll` | `/api/webhooks/poll/gmail` | `*/1 * * * *` | Polls Gmail for the Gmail trigger |
+| `outlook-webhook-poll` | `/api/webhooks/poll/outlook` | `*/1 * * * *` | Polls Outlook for the Outlook trigger |
+| `rss-webhook-poll` | `/api/webhooks/poll/rss` | `*/1 * * * *` | Polls feeds for the RSS trigger |
+| `imap-webhook-poll` | `/api/webhooks/poll/imap` | `*/1 * * * *` | Polls mailboxes for the IMAP trigger |
+| `google-sheets-webhook-poll` | `/api/webhooks/poll/google-sheets` | `*/1 * * * *` | Polls Google Sheets for the Sheets trigger |
+| `google-drive-webhook-poll` | `/api/webhooks/poll/google-drive` | `*/1 * * * *` | Polls Google Drive for the Drive trigger |
+| `google-calendar-webhook-poll` | `/api/webhooks/poll/google-calendar` | `*/1 * * * *` | Polls Google Calendar for the Calendar trigger |
+| `hubspot-webhook-poll` | `/api/webhooks/poll/hubspot` | `*/1 * * * *` | Polls HubSpot for the HubSpot trigger |
+| `renew-subscriptions` | `/api/cron/renew-subscriptions` | `0 */12 * * *` | Renews Microsoft Teams chat subscriptions, which Microsoft Graph expires after about three days |
+| `billing-cycle-close` | `/api/cron/billing-cycle-close` | `0 */6 * * *` | Billing only: collects final overage and resets per-period usage trackers |
+| `reconcile-billing-seats` | `/api/cron/reconcile-billing-seats` | `0 * * * *` | Billing only: reconciles subscription seats; safe to disable without billing |
+| `reconcile-inbox-entitlement` | `/api/cron/reconcile-inbox-entitlement` | `0 3 * * *` | Releases Sim Mailer inboxes for workspaces whose plan lapsed |
+| `workspace-events-poll` | `/api/workspace-events/poll` | `*/15 * * * *` | Fires workspace event triggers |
+| `time-pause-resume-poll` | `/api/resume/poll` | `*/1 * * * *` | Resumes workflows paused on a timer |
+| `connector-sync` | `/api/knowledge/connectors/sync` | `*/5 * * * *` | Syncs knowledge base connectors |
+| `connector-member-sync` | `/api/knowledge/connectors/member-sync` | `*/5 * * * *` | Syncs per-member content and access for indexed connectors |
+| `connector-directory-sync` | `/api/knowledge/connectors/directory-sync` | `*/5 * * * *` | Refreshes stored groups for indexed administrator-mode connectors |
+| `run-data-drains` | `/api/cron/run-data-drains` | `*/15 * * * *` | Runs the enterprise data drains that are due |
+| `people-directory-sync` | `/api/cron/people-directory-sync` | `*/5 * * * *` | Refreshes connected People directories and delivers pending SCIM changes |
+| `scim-reconcile` | `/api/cron/scim-reconcile` | `17 * * * *` | Re-applies SCIM directory group mappings |
+| `cleanup-table-row-ttl` | `/api/cron/cleanup-table-row-ttl` | `*/15 * * * *` | Deletes table rows whose TTL column has expired |
+| `cleanup-oauth-tokens` | `/api/cron/cleanup-oauth-tokens` | `0 * * * *` | Deletes OAuth access and refresh tokens after their retention tail |
+| `cleanup-credential-group-links` | `/api/cron/cleanup-credential-group-links` | `20 * * * *` | Deletes Credential Group connection-request logs and expired connect links |
+| `cleanup-activity-history` | `/api/cron/cleanup-activity-history` | `45 4 * * *` | Deletes organization activity history past its 400-day retention |
+| `cleanup-source-staging` | `/api/cron/cleanup-source-staging` | `30 * * * *` | Deletes files staged for a workspace source apply a day after last use |
+| `cleanup-sandbox-images` | `/api/cron/cleanup-sandbox-images` | `30 4 * * *` | Deletes unused prebuilt sandbox images past their retention window |
+| `cleanup-session-sandboxes` | `/api/cron/cleanup-session-sandboxes` | `*/5 * * * *` | Stops idle chat workbenches and removes finished Kubernetes sandbox pods |
+| `outbox-process` | `/api/webhooks/outbox/process` | `*/1 * * * *` | Retries transactional-outbox side effects for billing, membership, and deployments |
+| `workspace-file-search-dispatch` | `/api/cron/workspace-file-search-dispatch` | `*/1 * * * *` | Dispatches indexing work for workspace file search |
+| `knowledge-projection` | `/api/cron/knowledge-projection` | `*/1 * * * *` | Brings knowledge base search up to date with document, permission, and chunk changes |
+| `activity-rollup` | `/api/cron/activity-rollup` | `*/2 * * * *` | Maintains the hourly workflow activity rollup; idle unless ACTIVITY_ROLLUP_MAINTENANCE is on |
+| `fold-table-row-changes` | `/api/cron/fold-table-row-changes` | `*/1 * * * *` | Folds the table row-change log into each table's row count and version |
+| `cleanup-stale-executions` | `/api/cron/cleanup-stale-executions` | `*/30 * * * *` | Fails runs whose worker died without finishing, and prunes old run bookkeeping |
+| `idempotency-cleanup` | `/api/webhooks/cleanup/idempotency` | `0 5 * * *` | Deletes deduplication records older than seven days |
+
+{/* self-hosting-cron-jobs:end */}
diff --git a/apps/docs/content/docs/platform/self-hosting/chat.mdx b/apps/docs/content/docs/platform/self-hosting/chat.mdx
index 0337cfd8e6f..2f205c44e23 100644
--- a/apps/docs/content/docs/platform/self-hosting/chat.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/chat.mdx
@@ -6,7 +6,7 @@ description: Connect self-hosted Sim to the Sim-hosted Chat service, or run the
import { Tab, Tabs } from '@/components/ui/tabs'
import { Callout } from '@/components/ui/callout'
-Chat, the Sim Chat workflow block, and Inbox run on a separate service, the Mothership. A self-hosted Sim either connects to the Mothership Sim hosts or to one you run beside it. Without either, set `NEXT_PUBLIC_CHAT_DISABLED=true` to hide Chat.
+Chat, the Sim Chat workflow block, and Inbox run on a separate service, the Mothership. A self-hosted Sim connects either to the Mothership Sim hosts or to one you run beside it.
| | Sim-hosted Mothership | Your own Mothership |
| --- | --- | --- |
@@ -25,7 +25,17 @@ These are set on **Sim**, not on the Mothership.
| `MOTHERSHIP_SIM_TRANSPORT` | How the Mothership reaches Sim. `direct`: it calls Sim at its own `SIM_ENDPOINT`. `checkpoint`: Sim collects workspace tool calls by polling the Mothership over outbound HTTPS, so the Sim-hosted service needs no route into Sim. A Mothership you run still reaches `SIM_ENDPOINT` for account validation and usage reporting with either transport. Self-hosted Sim defaults to `checkpoint` |
| `INTERNAL_API_SECRET` | Sim's existing secret. Your own Mothership uses the same value |
-For the Sim-hosted service, set `COPILOT_API_KEY` and keep the defaults. Chat attachments also need an object storage bucket; see [Object storage](/platform/self-hosting/object-storage).
+## Use the Sim-hosted service
+
+1. Sign in to [sim.ai](https://www.sim.ai) with any account and create a key at [sim.ai/selfhost/settings/chat-keys](https://www.sim.ai/selfhost/settings/chat-keys). The page exists only on Sim Cloud, not on your deployment.
+2. Set `COPILOT_API_KEY` to it, keep the other defaults, and recreate the app. On Compose, `npx sim-setup add chat` writes it for you.
+3. Remove `NEXT_PUBLIC_CHAT_DISABLED`, or set it to `false`.
+
+Chat attachments also need the Chat attachments bucket; see [Object storage](/platform/self-hosting/object-storage).
+
+## Hide Chat
+
+Without a Mothership, set `NEXT_PUBLIC_CHAT_DISABLED=true` on the app. Workspaces then open on their first workflow, with no chats list or editor Chat panel. `npx sim-setup` sets it when you skip the Chat key.
## Run the Mothership
diff --git a/apps/docs/content/docs/platform/self-hosting/docker.mdx b/apps/docs/content/docs/platform/self-hosting/docker.mdx
index f8963d17e4c..dfaf1a26465 100644
--- a/apps/docs/content/docs/platform/self-hosting/docker.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/docker.mdx
@@ -1,290 +1,169 @@
---
title: Docker
-description: Deploy Sim with Docker Compose and verify its services
+description: Run Sim on one host with Docker Compose
---
import { Callout } from '@/components/ui/callout'
-Use the production Compose stack for a single-node installation. It starts the app, realtime, PostgreSQL with pgvector, Redis, migrations, and the scheduler.
+The production Compose stack runs the app, realtime, PostgreSQL with pgvector, Redis, migrations, and the scheduler on one host.
## Prerequisites
-- Docker Engine or Docker Desktop, running.
-- Docker Compose 2.24.0 or later. The file uses optional `env_file` entries introduced in that version.
-- Node.js 20 or later, which provides `npx` for the `sim-setup` CLI.
-- Available host ports 3000 and 3002, with enough resources for your workload. See [resource examples](/platform/self-hosting#requirements).
-- A public domain and TLS proxy for remote access.
+- Docker Engine or Docker Desktop with Compose 2.24.0 or later.
+- Node.js 20 or later, for `npx sim-setup`.
+- Free host ports 3000 and 3002, and the [resources](/platform/self-hosting#requirements) for your workload.
+- A domain and a TLS proxy for access from other machines.
## Quick start
```bash
-npx sim-setup
+npx sim-setup --url https://sim.yourdomain.com
```
-The wizard creates `./sim` with a generated `.env` and production Compose file, then starts published container images. Pass `--dir ` for another directory, and `--url https://sim.yourdomain.com` to set the public URL (Custom setup also asks for it). Open [http://localhost:3000](http://localhost:3000), or your public URL. `bunx sim-setup` works too if you use Bun.
+The wizard writes `docker-compose.prod.yml` and a generated `.env` to `./sim`, and starts the published images. Leave out `--url` to serve [http://localhost:3000](http://localhost:3000) only. `--dir ` picks another directory, and `bunx sim-setup` works too.
-For a manual installation, obtain the Compose file from a source checkout:
+## Manual install [#production-setup]
+
+Fetch the Compose file from the [release](https://github.com/simstudioai/sim/releases) you want to run:
```bash
-git clone https://github.com/simstudioai/sim.git
-cd sim
+mkdir sim && cd sim
+SIM_VERSION=
+curl -fsSLO "https://raw.githubusercontent.com/simstudioai/sim/${SIM_VERSION}/docker-compose.prod.yml"
```
-Then follow the configuration steps below.
-
-## Production setup
-
-### 1. Configure the environment
-
-For a new installation, create `.env` next to `docker-compose.prod.yml`:
+Create `.env` beside it. Run this once, for a new installation only: it generates new secrets, and an existing database cannot be read with them.
```bash
umask 077
cat > .env << EOF
+SIM_VERSION=${SIM_VERSION}
+NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
-INTERNAL_API_SECRET=$(openssl rand -hex 32)
API_ENCRYPTION_KEY=$(openssl rand -hex 32)
+INTERNAL_API_SECRET=$(openssl rand -hex 32)
CRON_SECRET=$(openssl rand -hex 32)
-NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
-POSTGRES_USER=postgres
POSTGRES_PASSWORD=$(openssl rand -hex 24)
-POSTGRES_DB=simstudio
+LOG_LEVEL=INFO
+# Chat: set COPILOT_API_KEY, or keep Chat hidden
+NEXT_PUBLIC_CHAT_DISABLED=true
EOF
```
-If you already ran the wizard or have an existing installation, edit that `.env` and retain its keys and database credentials. Do not rerun this creation command over it.
-
-Compose derives `BETTER_AUTH_URL` from `NEXT_PUBLIC_APP_URL` and `DATABASE_URL` from `POSTGRES_*`. Setting either derived variable in `.env` does not override the service definition. To use an external database, maintain a Compose configuration that supplies the same external DSN to the app, realtime, and migrations and adjusts their bundled-database dependencies.
-
-Keep `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` URL-safe: letters, digits, `.`, `_`, `~`, or `-`. Compose inserts them into the DSN without escaping; values containing `@`, `/`, `?`, `#`, `%`, or spaces can initialize PostgreSQL but prevent app connections. Hex output from `openssl` is safe.
-
-
- Back up `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY` separately from the server. Restoring the database with different keys leaves encrypted values unreadable. `ENCRYPTION_KEY` protects environment variables, provider keys, MCP OAuth credentials, and deployment/Chat secrets. `API_ENCRYPTION_KEY` protects stored Sim API-key material; when absent, legacy API keys can be stored in plain text.
-
-
-Compose refuses startup without `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, or `POSTGRES_PASSWORD`. PostgreSQL applies its credentials only when initializing a new volume; changing `.env` does not change an existing database password. See [Postgres on Compose](/platform/self-hosting/security#postgres-on-compose) before rotating it.
-
-Set `CRON_SECRET` for scheduled work. Without it, the cron service prints instructions and exits; the other services can still run. Images use `latest` unless you set `SIM_VERSION`; the separate scheduler image uses `SIM_CRON_VERSION`. Pin and upgrade deliberately using [Upgrades](/platform/self-hosting/upgrades).
-
-### 2. Configure durable uploads
-
-Without object storage, the app stores uploads in the `sim_uploads` volume, so they survive container recreation and updates. It stays on this host and needs its own backup. A one-shot `uploads-init` service makes it writable by the app user.
-
-Follow [Object storage](/platform/self-hosting/object-storage) for AWS S3, Azure Blob, or Google Cloud Storage.
-
-#### Existing installs: keep uploads from before the volume
-
-If your install predates the `sim_uploads` volume, uploads live inside the app container and recreating it discards them. Copy them out before switching to the new Compose file or running `npx sim-setup update`, then copy them in:
-
-```bash
-docker compose -f docker-compose.prod.yml cp simstudio:/app/apps/sim/uploads ./uploads-backup
-# switch to the new docker-compose.prod.yml (or run npx sim-setup update), then:
-docker compose -f docker-compose.prod.yml cp ./uploads-backup/. simstudio:/app/apps/sim/uploads
-docker compose -f docker-compose.prod.yml exec -u 0 simstudio chown -R nextjs:nodejs /app/apps/sim/uploads
-```
+- Compose derives `BETTER_AUTH_URL` from `NEXT_PUBLIC_APP_URL` and `DATABASE_URL` from `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB`; setting either derived variable in `.env` has no effect.
+- Compose refuses to start without `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, or `POSTGRES_PASSWORD`. Keep the `POSTGRES_*` values URL-safe (letters, digits, `.`, `_`, `~`, `-`), because they are inserted into the database URL unescaped.
+- PostgreSQL applies its credentials only when it creates the volume; changing `.env` later does not change the password. See [Postgres on Compose](/platform/self-hosting/security#postgres-on-compose).
+- Without `CRON_SECRET` the scheduler prints what to set and exits; everything else runs. See [Background jobs](/platform/self-hosting/background-jobs).
+- Back up `.env` now. The encryption keys cannot be recovered; see [Secrets](/platform/self-hosting/security#secrets).
+- [Chat](/platform/self-hosting/chat) needs `COPILOT_API_KEY`; set it and remove `NEXT_PUBLIC_CHAT_DISABLED` to show Chat.
-### 3. Start and verify services
+## Start and check
```bash
docker compose -f docker-compose.prod.yml up -d
docker compose -f docker-compose.prod.yml ps -a
-docker compose -f docker-compose.prod.yml logs migrations
curl -fsS http://localhost:3000/api/health
```
| Service | Host port | Purpose |
| --- | --- | --- |
-| `simstudio` | 3000 | App; 8G memory limit. |
-| `realtime` | 3002 | WebSocket service; 1G memory limit. |
-| `db` | Not published | PostgreSQL 17 with pgvector. |
-| `redis` | Not published | Required. Rate limits, shared coordination, pub/sub, and caches. |
-| `cron` | None | Calls background job endpoints. |
-| `migrations` | None | Applies migrations once, then exits. |
-| `uploads-init` | None | Hands the uploads volume to the app user once, then exits. |
-
-Expect five services running, and `migrations` and `uploads-init` exited successfully. The migrator has no healthcheck because it is a one-shot job.
-
-```bash
-docker compose -f docker-compose.prod.yml logs -f cron
-```
-
-Confirm the scheduler calls succeed, then run [Verify your install](/platform/self-hosting/verify).
-
-### 4. Serve the public origin over TLS
-
-A host-installed Caddy proxy can obtain and renew certificates for your domain. For example:
-
-```text
-sim.yourdomain.com {
- request_body {
- max_size 250MB
- }
-
- handle /socket.io/* {
- reverse_proxy localhost:3002
- }
-
- reverse_proxy localhost:3000 {
- flush_interval -1
- }
-}
-```
-
-Route `/socket.io` to realtime on 3002 and other requests to the app on 3000. The 250 MB decimal Caddy limit clears the configured 220 MiB deployed-chat cap, but the app's current Next.js proxy buffer still limits matching requests to 10 MiB. See [Request size limits](/platform/self-hosting/networking#request-size-limits) before increasing payload sizes. `flush_interval -1` explicitly disables response buffering; Caddy already flushes SSE immediately. It also keeps the upstream request running if the client disconnects. See [Caddy streaming behavior](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#streaming).
-
-When the proxy runs on the same host, set `SIM_APP_PUBLISH=127.0.0.1:3000` and `SIM_REALTIME_PUBLISH=127.0.0.1:3002` in `.env` so the app and realtime are reachable only through it. Keep the ports; `sim-setup` checks 3000 and 3002.
-
-This example assumes Caddy runs on the Docker host. A containerized proxy needs reachable Compose service addresses instead of its own `localhost`. For Nginx, Traefik, cloud load balancers, or separate socket hosts, see [Networking](/platform/self-hosting/networking).
-
-## Ollama
-
-### External Ollama
-
-For production, keep this Compose stack and point `OLLAMA_URL` at an Ollama server. If it runs on the Docker host, save the address in `.env` so later recreations retain it:
-
-```bash
-OLLAMA_URL=http://host.docker.internal:11434
-```
-
-Production Compose maps `host.docker.internal` to the host gateway, including on Linux. You can instead use a reachable host IP. The Ollama server must listen on an interface reachable from the container. On Linux, bind it to the Docker bridge address that `host.docker.internal` resolves to, usually `OLLAMA_HOST=172.17.0.1:11434` (check with `ip -4 addr show docker0`). Ollama's API has no authentication, so listen on `0.0.0.0` only behind a firewall that blocks port 11434 from outside the host.
+| `simstudio` | 3000 | App; 8 GB memory limit |
+| `realtime` | 3002 | WebSocket server; 1 GB memory limit |
+| `db` | None | PostgreSQL 17 with pgvector |
+| `redis` | None | Required: rate limits, coordination, and live events |
+| `cron` | None | Calls the background job endpoints |
+| `migrations` | None | Applies migrations, then exits |
+| `uploads-init` | None | Makes the uploads volume writable, then exits |
-```bash
-docker compose -f docker-compose.prod.yml up -d
-```
+Then run [Verify your install](/platform/self-hosting/verify).
-
- Container `localhost` is the container itself. The default `http://localhost:11434` does not reach an Ollama server on the host.
-
+Without object storage, uploads go to the `sim_uploads` volume on this host. Back it up, or configure [object storage](/platform/self-hosting/object-storage).
-### Bundled Ollama
+## Serve your domain over TLS
-`docker-compose.ollama.yml` is an overlay on `docker-compose.prod.yml`: it adds an Ollama server to the production stack and points the app at it, so the stack keeps the published images, the required secrets, Redis, and cron. Ollama is reachable only inside the Compose network, as `ollama:11434`.
+Put a TLS proxy in front of the stack. Route `/socket.io` to realtime on port 3002 and everything else to the app on port 3000, with WebSocket upgrades and response streaming enabled. [Networking](/platform/self-hosting/networking#reverse-proxy-configuration) has Caddy, Nginx, and Traefik configurations.
-Add the address to `.env` first. The overlay refuses to start without it, and keeping it in `.env` means a later run of `docker-compose.prod.yml` alone still reaches Ollama:
+When the proxy runs on the same host, publish the app and realtime on loopback only. Keep the ports, which `sim-setup` checks:
```bash
-OLLAMA_URL=http://ollama:11434
+SIM_APP_PUBLISH=127.0.0.1:3000
+SIM_REALTIME_PUBLISH=127.0.0.1:3002
```
-Start the stack with exactly one server profile:
+## External PostgreSQL and Redis
-```bash
-# NVIDIA GPU (requires the NVIDIA Container Toolkit)
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu up -d
+To use your own Redis, set `REDIS_URL` in `.env` and recreate the stack; the app and realtime both read it.
-# CPU only
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile cpu up -d
-```
-
-Pull the starter model, `gemma3:4b`, once the server is running:
+For your own PostgreSQL (with the `vector` extension available; see [Managed PostgreSQL](/platform/self-hosting/reference-architectures#managed-postgresql)), add an overlay that points the app, realtime, and migrations at it and stops starting the bundled database. Save it as `external-db.yml`:
-```bash
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile setup run --rm model-setup
+```yaml
+services:
+ simstudio:
+ environment:
+ DATABASE_URL: ${EXTERNAL_DATABASE_URL:?set EXTERNAL_DATABASE_URL in .env}
+ depends_on: !override
+ uploads-init:
+ condition: service_completed_successfully
+ redis:
+ condition: service_healthy
+ migrations:
+ condition: service_completed_successfully
+ realtime:
+ condition: service_healthy
+ realtime:
+ environment:
+ DATABASE_URL: ${EXTERNAL_DATABASE_URL:?set EXTERNAL_DATABASE_URL in .env}
+ depends_on: !override
+ redis:
+ condition: service_healthy
+ migrations:
+ condition: service_completed_successfully
+ migrations:
+ environment:
+ DATABASE_URL: ${EXTERNAL_DATABASE_URL:?set EXTERNAL_DATABASE_URL in .env}
+ depends_on: !reset {}
+ db:
+ profiles: [bundled-db]
```
-To pull another model, exec into the server for your profile:
+Then add to `.env`:
```bash
-# GPU profile
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu exec ollama ollama pull llama3.2
-
-# CPU profile
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile cpu exec ollama-cpu ollama pull llama3.2
+EXTERNAL_DATABASE_URL=postgresql://:@:5432/simstudio?sslmode=require
+COMPOSE_FILE=docker-compose.prod.yml:external-db.yml
```
-#### Migrating from the previous Ollama stack
-
-The previous `docker-compose.ollama.yml` was a standalone stack with the fixed project name `sim-with-ollama`, so its database and models live in the `sim-with-ollama_postgres_data` and `sim-with-ollama_ollama_data` volumes. The overlay takes its project name from `docker-compose.prod.yml`, and started as-is it creates empty volumes instead. To keep your data:
-
-1. From the repository directory, stop the old stack without `-v`, so its volumes are kept. The old file is gone, so name the project instead:
-
- ```bash
- docker compose -p sim-with-ollama down
- ```
-
-2. Add the old project name and database password to `.env`, so the overlay and the `sim-setup` CLI both resolve the same project and volumes. The old stack's password defaulted to `postgres` unless you set one:
-
- ```bash
- COMPOSE_PROJECT_NAME=sim-with-ollama
- POSTGRES_PASSWORD=postgres
- OLLAMA_URL=http://ollama:11434
- ```
-
-3. Start the stack with the overlay and your profile, as above.
-
-Ollama is no longer published on host port `11434`. Reach it with `docker compose exec`, as in the model pull commands above.
-
-## LM Studio
-
-Start [LM Studio's local server](https://lmstudio.ai/docs/developer/core/server), load a model, enable **Serve on Local Network**, and [configure API authentication](https://lmstudio.ai/docs/developer/core/authentication). Save these values beside your Compose file:
-
-```bash
-VLLM_BASE_URL=http://host.docker.internal:1234
-VLLM_API_KEY=your_lm_studio_api_token
-```
+`!override` needs Compose 2.24.4 or later. Keep `POSTGRES_PASSWORD` set to any value: the base file still requires it. With `COMPOSE_FILE` in `.env`, plain `docker compose` commands and `npx sim-setup update` apply both files.
-Use a reachable host IP when needed. Sim accepts the server root or a `/v1` URL. Models appear with a `vllm/` prefix, which Sim removes before sending the model ID to LM Studio.
+## Local models [#ollama]
-Recreate the app using the file that started your installation:
-
-```bash
-COMPOSE_FILE=docker-compose.prod.yml
-# For a source-built stack, use docker-compose.local.yml. A stack running the
-# Ollama overlay is a docker-compose.prod.yml install.
-docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
-```
+To run Ollama, LM Studio, or vLLM with this stack, see [Local models](/platform/self-hosting/local-models).
## The `sim-setup` CLI
-Invoke commands as `npx sim-setup ` unless the package is installed globally. Run `doctor`, `config`, and the wizard from the configuration directory. Lifecycle commands discover running production/local Compose stacks, source checkouts, and Helm releases. Compose commands apply every file the stack was started with, such as the Ollama overlay. For a stopped stack they use `COMPOSE_FILE` from its `.env`, else `docker-compose.prod.yml` plus `docker-compose.override.yml` when that file exists. `update` prints the files it applies. Compose does not record profiles, so set `COMPOSE_PROFILES` in `.env` (for example `COMPOSE_PROFILES=cpu`) for a stack that uses them.
+Run `npx sim-setup `. Run the wizard, `doctor`, and `config` from the configuration directory. Lifecycle commands find running Compose stacks, source checkouts, and Helm releases, and apply every Compose file a stack was started with. A stopped stack uses `COMPOSE_FILE` from its `.env`. Compose does not record profiles, so set `COMPOSE_PROFILES` in `.env` for a stack that uses them.
| Command | Behavior |
| --- | --- |
-| `sim-setup` | Wizard. `--quick` uses defaults and asks essential questions; `--mode compose\|dev\|k8s` chooses the target; `--url ` sets a Compose install's public URL. Dev and Kubernetes modes require a source checkout. |
-| `status` | Reports detected installations and health. |
-| `logs` | Follows Compose logs or the Kubernetes app deployment. In dev mode, prints container log commands; the app runs in your terminal. |
-| `start` / `stop` / `restart` | Starts, stops, or restarts Compose services. In dev mode, manages only PostgreSQL and Redis; start/stop the dev server yourself. For Kubernetes, prints port-forward or scale commands without applying them. |
-| `update` | Pulls or rebuilds Compose images and applies them. Refuses dev and Kubernetes installs, which use git and `helm upgrade`. |
-| `down` | Confirms before removing managed containers or uninstalling the Helm release. Compose/dev data volumes remain. |
-| `reset` | Confirms before archiving env files and removing managed Compose/dev data. On Helm it uninstalls the release; PostgreSQL StatefulSet PVCs remain and must be deleted separately to erase data. |
+| `sim-setup` | Wizard. `--quick` uses defaults; `--mode compose\|dev\|k8s` picks the target (dev and k8s need a source checkout: run `bun run sim-setup` from the repo root); `--url ` sets a Compose install's public URL. |
+| `status` | Reports detected installations and their health. |
+| `logs` | Follows Compose logs or the Kubernetes app Deployment. |
+| `start` / `stop` / `restart` | Manages Compose services. For Kubernetes, prints the commands instead of running them. `restart` does not apply changed environment; recreate the containers. |
+| `update` | Pulls the images for `SIM_VERSION` (or rebuilds a source stack) and recreates the services. `--yes` skips the prompt about uploads still inside an old app container. Refuses dev and Kubernetes installs. |
+| `down` | Removes managed containers, or uninstalls the Helm release, after confirming. Data volumes remain. |
+| `reset` | Archives env files and removes managed Compose data after confirming. On Helm it uninstalls the release; PostgreSQL PVCs remain. |
| `config` | Reports configured capabilities and integrations. |
-| `doctor` | Checks env files and reachable services. `--fix` writes supported repairs; `--json` emits structured findings. |
-| `add ` | Configures `email`, `storage`, `sandbox`, `jobs`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration `. Requires one writable configuration; refuses ambiguous destinations and Helm releases. |
-| `desktop` | Prints this deployment's installer/server links. `--url ` skips discovery; `--no-open` skips the browser-opening prompt. |
-
-`--dir ` works with every command and scopes standalone lifecycle commands to that installation.
-
-For Compose, `reset` archives `.env` beside the Compose file. For dev, Kubernetes, or no detected install, it archives `apps/sim/.env`, `apps/realtime/.env`, `packages/db/.env`, and root `.env`. Preserve any backups before intentionally removing volumes.
-
-`add` writes beside the Compose file or to `apps/sim/.env` on a source checkout. Recreate containers that read the change. To point both app and realtime at a different Redis, set `REDIS_URL` in `.env` and recreate both containers. For a source checkout, mirror shared values into `apps/realtime/.env`. `restart` alone does not apply changed container environment. Desktop discovery refuses configurations naming different origins; pass `--url` to choose.
-
-## Back up and update [#commands]
-
-For the default database role/name:
-
-```bash
-docker compose -f docker-compose.prod.yml exec -T db pg_dump -U postgres simstudio > backup.sql
-```
+| `doctor` | Checks env files and reachable services. `--fix` writes supported repairs; `--json` prints structured findings. |
+| `add ` | Configures `email`, `storage`, `sandbox`, `jobs`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration ` in a writable `.env`. Refuses Helm releases. |
+| `desktop` | Prints this deployment's desktop installer links. `--url ` skips discovery. |
-Restore only to the intended database:
+`--dir ` works with every command and scopes it to that installation.
-```bash
-docker compose -f docker-compose.prod.yml exec -T db psql -U postgres simstudio < backup.sql
-```
-
-Use your configured role/database if you changed `POSTGRES_*`. `-T` disables TTY allocation for redirected input/output. Compose stores database data in the `postgres_data` volume and local uploads in the `sim_uploads` volume; back up uploads and encryption keys separately.
-
-For an image update, change the pinned `SIM_VERSION` in `.env`, then:
-
-```bash
-npx sim-setup update
-```
-
-Read [Upgrades](/platform/self-hosting/upgrades) before updating or restoring an existing installation.
+
+ `add` and `doctor --fix` write `.env`; recreate the affected containers with `docker compose -f docker-compose.prod.yml up -d` to apply the change.
+
-## Related docs
+## Back up and upgrade [#commands]
-- [Environment variables](/platform/self-hosting/environment-variables)
-- [Background jobs](/platform/self-hosting/background-jobs)
-- [Security](/platform/self-hosting/security)
+Back up the database, the `sim_uploads` volume, and `.env`. [Upgrades](/platform/self-hosting/upgrades) has the backup, update, and rollback commands.
diff --git a/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx b/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx
index 068c8faeab8..83e2f852655 100644
--- a/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/environment-variables.mdx
@@ -5,9 +5,9 @@ description: Deployment configuration, feature prerequisites, and limits
import { Callout } from '@/components/ui/callout'
-Configure variables in the env files or secret strategy for your deployment. Restart source processes or recreate containers/pods after changes; a running process does not reread credentials.
+Set these in `.env` on Compose or through your [secret strategy](/platform/self-hosting/kubernetes#secret-stores) on Helm, then recreate the containers or pods; a running process does not reread them. Compose derives `DATABASE_URL` and `BETTER_AUTH_URL`, and Helm derives the database URL, `BETTER_AUTH_URL`, and the internal service URLs. [Docker](/platform/self-hosting/docker#production-setup) has a complete `.env` for a new installation.
-Production Compose derives `DATABASE_URL` and `BETTER_AUTH_URL` on its service definitions, overriding values in `.env`. Use `POSTGRES_*` and `NEXT_PUBLIC_APP_URL` there. Helm constructs the database URL from its database values. See [Docker](/platform/self-hosting/docker) and [Kubernetes secret strategies](/platform/self-hosting/kubernetes#secret-stores).
+Trigger.dev is a hosted-only job backend; leave the `TRIGGER_*` variables unset.
## Required
@@ -19,29 +19,29 @@ Production Compose derives `DATABASE_URL` and `BETTER_AUTH_URL` on its service d
| `ENCRYPTION_KEY` | Encryption key, exactly 64 hex characters (32 bytes): `openssl rand -hex 32`. A key in any other format leaves [account token sealing](/platform/self-hosting/security#account-token-sealing) off |
| `INTERNAL_API_SECRET` | Internal API secret, at least 32 characters: `openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | Public app URL |
-| `REDIS_URL` | Redis connection string (`redis://` or `rediss://`), shared by the app and realtime services. The app refuses to start without it; there is no PostgreSQL or in-memory fallback. See [Redis](/platform/self-hosting/redis) |
+| `REDIS_URL` | `redis://` or `rediss://` URL, the same for the app and realtime. [Required](/platform/self-hosting/redis) |
-`openssl rand -hex 32` prints 64 hex characters. Encryption keys require that format. The app skips its env schema validation; individual consumers can reject invalid values when first used. Realtime validates `BETTER_AUTH_SECRET` and `INTERNAL_API_SECRET` at boot and rejects values shorter than 32 characters.
-
-
- Retain `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY` across upgrades and restores. There is no supported in-place key rotation procedure; losing a key makes values encrypted with it unreadable — workspace and personal environment variables, stored provider API keys, MCP OAuth credentials, connected-account OAuth tokens, and deployment/chat secrets in the first case, user-generated Sim API keys in the second. Back them up separately from the database.
-
+The app does not validate its environment at startup; a malformed value fails where it is first used. Realtime rejects a `BETTER_AUTH_SECRET` or `INTERNAL_API_SECRET` shorter than 32 characters at boot. Keep the encryption keys for the life of the database; see [Secrets](/platform/self-hosting/security#secrets).
## Feature prerequisites and coordination [#strongly-recommended]
| Variable | Description |
|----------|-------------|
| `API_ENCRYPTION_KEY` | Encrypts stored Sim API-key material; use exactly 64 hex characters (`openssl rand -hex 32`). When unset, legacy API keys can be stored in plain text; the key getter logs a warning when called |
-| `CRON_SECRET` | Bearer token for the background job endpoints: `openssl rand -hex 32`. **Required whenever background jobs are enabled** — the Helm chart's default, and the chart will not render without it, unless it comes from `app.secrets.existingSecret` or External Secrets. See [Background jobs](/platform/self-hosting/background-jobs) |
+| `CRON_SECRET` | Bearer token the scheduler sends to the job endpoints: `openssl rand -hex 32`. Required for [background jobs](/platform/self-hosting/background-jobs) |
| `REDIS_TLS_SERVERNAME` | TLS SNI override. Required when `REDIS_URL` uses `rediss://` with a bare IP, or the app refuses to start |
| `NEXT_PUBLIC_SOCKET_URL` | Public WebSocket URL. Proxied deployments default to the page origin; a localhost page uses port 3002. Set it for a separate realtime host. |
| `TRUSTED_ORIGINS` | Comma-separated additional origins to trust for auth (apex + `www`, alias domains) |
| `AUTH_TRUSTED_PROXIES` | Comma-separated reverse-proxy IPs/CIDRs so the client IP cannot be forged through `X-Forwarded-For` |
-| `INTERNAL_API_BASE_URL` | Internal URL for server-side self-calls, e.g. `http://sim-app.simstudio.svc.cluster.local:3000`. Defaults to the public base URL. The Trigger.dev worker ignores it and uses the public app URL. |
+| `INTERNAL_API_BASE_URL` | Internal URL for server-side self-calls, e.g. `http://sim-app.simstudio.svc.cluster.local:3000`. Defaults to the public base URL |
+| `SOCKET_SERVER_URL` | Internal URL the app uses to reach realtime. Compose sets `http://realtime:3002` and Helm sets the realtime Service |
+| `INTERNAL_JWT_SECRET` | Separate signing key for the app's internal tokens, at least 32 characters. Falls back to `INTERNAL_API_SECRET` |
+| `LOG_LEVEL` | `DEBUG`, `INFO`, `WARN`, or `ERROR`. Production defaults to `ERROR`; `sim-setup` writes `INFO` |
| `SIM_MCP_URL` | Public URL of the [Sim MCP server](/mcp/overview) when you serve it on its own host, e.g. `https://mcp.example.com/mcp`. Point that host at the app; Sim serves only the MCP endpoint and its OAuth metadata there, and stops serving `/api/mcp` on the app host so clients use one URL. Optional — defaults to `/api/mcp` |
| `MCP_OAUTH_CLIENT_METADATA_DOCUMENT_ENABLED` | Set to `true` so Sim identifies itself to MCP OAuth servers that support it with a client ID metadata document, instead of registering a new client at each server. The server reads `/api/mcp/oauth/client-metadata`, so turn it on only when that HTTPS URL is reachable from the internet. Off by default on self-hosted deployments, and has no effect while the app URL is not HTTPS. See [MCP client registration](/agents/mcp#oauth-client-registration) |
| `ENCRYPT_ACCOUNT_TOKENS` | Set to `false` to stop sealing connected-account OAuth tokens on write and during `migrate`. Sealing is on by default with a 64-hex `ENCRYPTION_KEY`; see [Account token sealing](/platform/self-hosting/security#account-token-sealing) |
| `DATABASE_REPLICA_URL` | Read-replica connection string for log listing, audit logs, and dashboard aggregations. Falls back to the primary when unset |
+| `DATABASE_URL_` | Separate connection string, and connection pool, for one workload: `CLEANUP`, `EXEC`, `SEARCH`, `BILLING`, or `AUTH` inside the app, and `REALTIME` for the realtime server. Each falls back to `DATABASE_URL`. See [Connections](/platform/self-hosting/scaling#connections) |
## AI providers
@@ -64,9 +64,7 @@ Production Compose derives `DATABASE_URL` and `BETTER_AUTH_URL` on its service d
Knowledge bases use an embedding model independent of the chat model. See [Knowledge bases](#knowledge-bases) for supported providers, local Ollama, and vector widths.
-For provider-key rotation, configure `_1`, `_2`, and `_3` keys, such as `OPENAI_API_KEY_1` and `OPENAI_API_KEY_2`. OpenAI, Anthropic, Gemini, xAI, Kimi, Z.ai, Cohere, and Fireworks support numbered keys.
-
-For Ollama on the Docker host, use `OLLAMA_URL=http://host.docker.internal:11434` and ensure its server is reachable from the container.
+For provider-key rotation, configure `_1`, `_2`, and `_3` keys, such as `OPENAI_API_KEY_1` and `OPENAI_API_KEY_2`. OpenAI, Anthropic, Gemini, xAI, Kimi, Z.ai, Cohere, and Fireworks support numbered keys. For Ollama, see [Local models](/platform/self-hosting/local-models).
**Agent tool-call depth.** An Agent block keeps calling tools until the model answers, with no round-trip limit by default. With billing disabled there is also no execution timeout unless `EXECUTION_TIMEOUT_FREE` (sync) or `EXECUTION_TIMEOUT_ASYNC_FREE` (async) is set, so a looping agent keeps making paid model calls. Set `MAX_TOOL_ITERATIONS` (for example `MAX_TOOL_ITERATIONS=50`) to cap the model round trips per block, or set those timeouts to bound the whole run.
@@ -115,12 +113,7 @@ For Ollama on the Docker host, use `OLLAMA_URL=http://host.docker.internal:11434
### Self-hosted OpenAI-compatible endpoints
-| Variable | Description |
-|----------|-------------|
-| `VLLM_BASE_URL` | OpenAI-compatible vLLM or LM Studio URL. Both the server root (`http://localhost:8000`) and versioned API URL (`http://localhost:8000/v1`) are accepted |
-| `VLLM_API_KEY` | Optional bearer token for the vLLM or LM Studio endpoint |
-| `LITELLM_BASE_URL` | LiteLLM proxy base URL |
-| `LITELLM_API_KEY` | Optional bearer token for LiteLLM |
+`VLLM_BASE_URL` and `VLLM_API_KEY` connect vLLM or LM Studio; `LITELLM_BASE_URL` and `LITELLM_API_KEY` connect a LiteLLM proxy. See [Local models](/platform/self-hosting/local-models).
## Knowledge bases
@@ -146,13 +139,7 @@ For hosted models, Sim checks catalog-supported widths and falls back to the mod
| `1536` | `text-embedding-3-small`, `text-embedding-3-large`, `gemini-embedding-001` |
| `3072` | `text-embedding-3-large`, `gemini-embedding-001` |
-For Compose or a source checkout, run `npx sim-setup add knowledge-embeddings` to choose OpenAI, Azure OpenAI, OpenRouter, Gemini, or Ollama and write its configuration. The three OpenAI-family transports share model/width choices. `npx sim-setup config` reports the family selected by `KB_EMBEDDING_MODEL`. For Helm, set the variables through chart values or your secret strategy. Run Ollama yourself; the setup command configures a connection, not an Ollama installation.
-
-The Embeddings block reads the same `OLLAMA_URL`. It lists the models on that server that report an
-embedding capability, with the width each one emits where Ollama reports it, so a workflow can embed
-locally without an API key. Ollama only began reporting capabilities in 0.5 — against an older
-server nothing can be filtered, so the list includes chat models and labels none of them with a
-width. Check what you pick there, or upgrade Ollama.
+On Compose, `npx sim-setup add knowledge-embeddings` chooses a provider and writes its configuration. The Embeddings block lists the embedding models on `OLLAMA_URL`; servers older than Ollama 0.5 report no capabilities, so their list also includes chat models.
## Login providers
@@ -188,7 +175,7 @@ Who may sign up and sign in — the allowlists, blocklists, `REGISTRATION_MODE`,
| `E2B_FUNCTION_TEMPLATE_ID` | Immutable `:` ref for the Function base image. Required for E2B; a mutable tag is refused |
| `E2B_FUNCTION_TEMPLATE_GENERATION` | Monotonic release generation printed by the same build. Required for E2B |
| `DAYTONA_FUNCTION_SNAPSHOT_ID` | Immutable snapshot **ID** (not a name) for the Function base image. Required for Daytona |
-| `SANDBOX_K8S_NAMESPACE` | Namespace for sandbox pods when `SANDBOX_PROVIDER=kubernetes` (default `sim-sandboxes`). The Helm chart sets this and the other `SANDBOX_K8S_*` variables from `sandbox.kubernetes.*`. The provider runs only in the app, so leave `TRIGGER_DEV_ENABLED` unset: with it set, the provider is reported misconfigured and sandbox features stay off |
+| `SANDBOX_K8S_NAMESPACE` | Namespace for sandbox pods when `SANDBOX_PROVIDER=kubernetes` (default `sim-sandboxes`). The Helm chart sets this and the other `SANDBOX_K8S_*` variables from `sandbox.kubernetes.*`. |
| `SANDBOX_K8S_RUNTIME_CLASS` | RuntimeClass for sandbox pods, e.g. `isolated-sandbox` (EKS), `gvisor` (GKE), `kata-vm-isolation` (AKS). Required unless `SANDBOX_K8S_ALLOW_UNISOLATED=true`; a RuntimeClass whose handler is `runc`, `crun`, or empty is refused |
| `SANDBOX_K8S_ALLOW_UNISOLATED` | `true` runs sandboxes on the node's shared kernel. Only for fully trusted workflow authors |
| `SANDBOX_K8S_TRUSTED_RUNTIME_HANDLERS` | Comma-separated RuntimeClass handlers to accept as isolating, for a VM or user-space-kernel runtime Sim does not recognise. The Helm chart sets it to `sandbox.kubernetes.runtimeClass.handler`, or to the handler of a RuntimeClass it creates |
@@ -200,6 +187,7 @@ Who may sign up and sign in — the allowlists, blocklists, `REGISTRATION_MODE`,
| `SANDBOX_K8S_NODE_SELECTOR` / `SANDBOX_K8S_TOLERATIONS` | JSON node selector object and tolerations array for sandbox pods |
| `E2B_PI_TEMPLATE_ID` / `DAYTONA_PI_SNAPSHOT_ID` | The image Pi runs on. Separate from the Function base — configuring the provider and Function image alone leaves Pi failing closed |
| `SANDBOXES_ENABLED` | Enable custom sandbox entitlement through deployment configuration where supported; see the [enterprise guide](/platform/enterprise/self-hosted) for billing-mode requirements. Not sufficient on its own — a provider key **and** an immutable Function base must also be configured. The Function block's Sandbox selector appears once the server confirms both |
+| `IVM_POOL_SIZE` | Isolated-vm worker processes in the app container (default `4`) |
| `IVM_MAX_EXECUTIONS_PER_WORKER` | Executions before an isolated-vm worker is recycled |
| `IVM_MAX_BROKERS_PER_EXECUTION` | Host-call brokers per execution |
| `IVM_MAX_BROKER_ARGS_JSON_CHARS` | Max argument payload size |
@@ -262,17 +250,12 @@ Configure at least one. Every configured provider stays active and is tried in o
| `API_MAX_JSON_BODY_BYTES` | 50 MiB | Configured JSON body cap; contract-validated routes clamp it to 10 MiB, or a lower route cap |
| `CHAT_MAX_REQUEST_BYTES` | 220 MiB | Configured body cap on the public deployed-chat endpoint; the Next.js proxy buffer also applies |
| `WEBHOOK_MAX_REQUEST_BYTES` | 10 MiB | Max body on public webhook receiver endpoints |
-| `WORKFLOW_EXECUTION_CONCURRENCY_LIMIT` | `75` | Trigger.dev workflow task concurrency |
-| `WEBHOOK_EXECUTION_CONCURRENCY_LIMIT` | `75` | Trigger.dev webhook task concurrency |
-| `SCHEDULE_EXECUTION_CONCURRENCY_LIMIT` | `30` | Deployment-wide active scheduled executions in the default database-backed mode; Trigger.dev uses a separate task queue |
-| `RESUME_EXECUTION_CONCURRENCY_LIMIT` | `50` | Trigger.dev resume task concurrency |
+| `SCHEDULE_EXECUTION_CONCURRENCY_LIMIT` | `30` | Scheduled executions in flight across the deployment. Adding replicas does not raise it |
| `EGRESS_ALLOWED_HOSTS` | unset | Comma-separated hostnames outbound requests may reach on a private network. Leading wildcard allowed, e.g. `host.docker.internal,*.svc.cluster.local`. Not honored for URLs harvested from content or a third-party response, nor for an HTTP block's `proxyUrl` |
| `EGRESS_ALLOWED_IP_RANGES` | unset | Comma-separated CIDRs or IPs outbound requests may reach on a private network, e.g. `10.0.0.0/8`. Same exclusions |
| `DOMAIN_VERIFICATION_NAMESERVERS` | `1.1.1.1,8.8.8.8` | Comma-separated nameserver IPs that SSO domain verification sends its TXT lookup to. Set it when the network only allows DNS to an internal resolver. Entries that are not IP addresses are ignored |
-A malformed entry in either allowlist stops the app at startup with a message naming the setting. See [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary) for the accepted syntax and for what the allowlist does and does not reach.
-
-Most `/api` routes also pass through Next.js Proxy, which buffers only the first 10 MiB with the current app configuration. Raising these variables or an external proxy limit does not raise that buffer. See [Request size limits](/platform/self-hosting/networking#request-size-limits) for the layers to configure.
+A malformed allowlist entry stops the app at startup; see [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary) for the syntax. Body caps interact with the Next.js proxy buffer and your reverse proxy; see [Request size limits](/platform/self-hosting/networking#request-size-limits).
## Outbound request limits
@@ -303,28 +286,9 @@ Retention cleanup is separately opt-in through `DATA_RETENTION_ENABLED` or the e
Without billing, accounts resolve to the free tier for these counters. Each explicit free-tier variable enables only its corresponding limit.
-Current stock Compose and Helm configuration do not preset these free-tier caps. Charts before 1.5.0 did; inherited values can still reach upgraded pods.
-
### Remove an inherited limit [#removing-a-limit-you-already-inherited]
-If a limit remains after upgrading, inspect the pod's configuration for inherited values, such as `FREE_TABLES_LIMIT` or `FREE_TABLE_ROWS_LIMIT` from a chart older than 1.5.0 or your own values file. On Helm, remove the key by overriding it with `null`:
-
-```yaml
-app:
- envDefaults:
- FREE_TABLES_LIMIT: null
- FREE_TABLE_ROWS_LIMIT: null
-```
-
-Setting the variable to an empty string does **not** remove it: the chart reads an empty value as "not specified", so the inherited value still applies.
-
-Null the variable in every layer that sets it. If it appears in both `app.env` and `app.envDefaults`, nulling only the `app.env` entry lets the `envDefaults` value apply again and the limit stays in force. With External Secrets, also drop the key from `externalSecrets.remoteRefs.app`, which keeps syncing it independently. Confirm what the pod will actually receive before rolling out:
-
-```bash
-helm template sim oci://ghcr.io/simstudioai/charts/sim --version -f values.yaml | grep -A1 FREE_TABLE # expect no output
-```
-
-`null` deletion has no effect under `helm upgrade --reuse-values` — pass your full values with `-f`, or use `--reset-then-reuse-values` (Helm 3.14+). If you deploy with Argo CD, put the `null` in `valueFiles` or the `values` string rather than `valuesObject`, which strips nulls. On Docker Compose, delete the line from your `.env` file.
+Stock Compose and Helm set none of these caps. A limit that persists after an upgrade comes from your own values or an old chart default. On Compose, delete the line from `.env`. On Helm, set the key to `null` (an empty string does not remove it) in every layer that sets it, and drop it from `externalSecrets.remoteRefs.app`; the chart's [Removing an inherited env key](https://github.com/simstudioai/sim/blob/main/helm/sim/README.md#removing-an-inherited-env-key) notes cover `--reuse-values` and Argo CD.
## Observability
@@ -341,38 +305,6 @@ helm template sim oci://ghcr.io/simstudioai/charts/sim --version
See [Observability](/platform/self-hosting/observability).
-## Example .env
-
-```text
-# App/source-checkout example: replace placeholders before use.
-# Production Compose derives its DSN from POSTGRES_* instead.
-DATABASE_URL=postgresql://:@:5432/simstudio?sslmode=require
-NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
-BETTER_AUTH_URL=https://sim.yourdomain.com
-
-# Secrets — generate each with `openssl rand -hex 32`
-BETTER_AUTH_SECRET=
-ENCRYPTION_KEY=
-INTERNAL_API_SECRET=
-API_ENCRYPTION_KEY=
-CRON_SECRET=
-
-# Redis (required)
-REDIS_URL=redis://redis:6379
-
-# Models — OPENAI_API_KEY also powers knowledge base embeddings
-OPENAI_API_KEY=sk-...
-
-# Email
-RESEND_API_KEY=re_...
-FROM_EMAIL_ADDRESS="Sim "
-
-# Access control
-ALLOWED_LOGIN_DOMAINS=yourdomain.com
-```
-
-This is an app/source-checkout example, not a replacement for the [Compose setup](/platform/self-hosting/docker#production-setup) or [Helm values](/platform/self-hosting/kubernetes). See `apps/sim/.env.example` for additional options.
-
## Related docs
- [Authentication](/platform/self-hosting/authentication)
diff --git a/apps/docs/content/docs/platform/self-hosting/index.mdx b/apps/docs/content/docs/platform/self-hosting/index.mdx
index 6edf8b78bb0..94c6d15f278 100644
--- a/apps/docs/content/docs/platform/self-hosting/index.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/index.mdx
@@ -3,88 +3,57 @@ title: Self-hosting
description: Deploy and operate Sim on your own infrastructure
---
-import { Callout } from '@/components/ui/callout'
-
-Run Sim on your own infrastructure with Docker Compose or Kubernetes. Both run the same app, realtime service, database migrations, and background job endpoints.
+Sim runs on your infrastructure as an app, a realtime server, PostgreSQL with pgvector, Redis, and a scheduler. [Architecture](/platform/self-hosting/architecture) shows how they connect and where state lives.
## Choose a deployment
-| Deployment | Use it for |
-| --- | --- |
-| [Docker](/platform/self-hosting/docker) | A single-node installation with published containers |
-| [Kubernetes](/platform/self-hosting/kubernetes) | A Helm installation on a cluster you operate |
-| [Cloud platforms](/platform/self-hosting/platforms) | Provider-specific setup for Railway, a VPS, or managed Kubernetes |
-
-Compose bundles PostgreSQL, Redis, and a scheduler. The Helm chart bundles PostgreSQL and Redis and enables scheduled jobs by default. Kubernetes also exposes replica, autoscaling, disruption-budget, secret-store, and network-policy settings; configure these for your cluster before relying on high availability. See [Reference architectures](/platform/self-hosting/reference-architectures).
+| Deployment | Use it for | Bundled for you |
+| --- | --- | --- |
+| [Docker Compose](/platform/self-hosting/docker) | One host | PostgreSQL, Redis, and the scheduler |
+| [Kubernetes](/platform/self-hosting/kubernetes) | A cluster you operate, with replicas and autoscaling | PostgreSQL and Redis for evaluation, and the scheduled jobs |
-## Quick start
+Railway has a community template that this repository does not maintain. Confirm it provides pgvector, the same secrets on app and realtime, Redis, and the scheduler; Railway Cron runs at most every five minutes, so it cannot run the every-minute jobs.
-Install Node.js 20 or newer, Docker, and Docker Compose 2.24.0 or later, then run:
+On a single host, one command installs and starts Sim:
```bash
npx sim-setup
```
-The wizard creates a `./sim` directory with a production Compose file and generated `.env`, including `POSTGRES_PASSWORD`. It starts published container images. Open [http://localhost:3000](http://localhost:3000).
-
-See [Docker](/platform/self-hosting/docker) for runtime prerequisites, manual setup, and production configuration. For a cluster, use [Kubernetes](/platform/self-hosting/kubernetes).
+On EKS, AKS, or GKE, plan managed databases, storage, and identity with [Reference architectures](/platform/self-hosting/reference-architectures).
## Requirements
-Use these as starting resource examples, then size the deployment for concurrent executions, file processing, vector queries, and database growth. User counts alone do not predict capacity.
+Start from these examples, then size for concurrent executions, file processing, vector queries, and database growth. User count alone does not predict capacity.
-| Resource | Evaluation example | Team example | Larger workload example |
+| Resource | Evaluation | Team | Larger workloads |
| --- | --- | --- | --- |
| CPU | 2 cores | 4 cores | 8+ cores |
| RAM | 12 GiB | 16 GiB | 32+ GiB |
| Storage | 20 GiB SSD | 50 GiB SSD | 100+ GiB SSD |
-These are sizing suggestions, not enforced minimums or capacity guarantees. The Helm chart requests 4 GiB and limits the app to 8 GiB by default. Production Compose sets an 8G app memory limit with no reservation. Memory-intensive executions and parsing can require more; see [Scaling](/platform/self-hosting/scaling).
-
-## Before production use
-
-- Set your public origin and route `/socket.io` to the realtime service. Configure TLS before remote sign-in.
-- Retain and back up `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY` with the database. Generate keys only for a new installation.
-- Configure durable [object storage](/platform/self-hosting/object-storage) or a persistent local-storage layout. The production Compose file does not mount the app's upload directory.
-- Configure [email](/platform/self-hosting/email) for invitations, verification, and password resets.
-- Verify [background jobs](/platform/self-hosting/background-jobs), including the scheduler's `CRON_SECRET`.
-
-
- A database backup does not cover local uploads or encryption keys; back them up separately. Losing an encryption key makes the data encrypted with it unreadable.
-
-
-Run [Verify your install](/platform/self-hosting/verify) before opening the deployment to your team and after upgrades or restores.
+The Helm chart requests 4 GiB for the app and limits it to 8 GiB; Compose limits it to 8 GB. Memory-heavy executions and document parsing can need more. See [Scaling](/platform/self-hosting/scaling).
## External dependencies
-The editor and execution engine run within your deployment. Configure these dependencies for the features you use:
+The editor and execution engine run inside your deployment. These features need a provider you configure:
| Feature | Dependency |
| --- | --- |
-| Knowledge bases | An OpenAI, Azure OpenAI, OpenRouter, or Gemini embedding key, or your own Ollama server. `KB_EMBEDDING_MODEL` selects the model (`text-embedding-3-small` by default); `EMBEDDING_OUTPUT_DIMS` selects the stored vector width. Use `ollama/` and `OLLAMA_URL` for local embeddings. |
-| Agent blocks | A model provider key or a self-hosted compatible endpoint such as Ollama, vLLM, LM Studio, or LiteLLM. |
-| Chat | `COPILOT_API_KEY` for the Sim-hosted Chat service, or your own Mothership; see [Chat service](/platform/self-hosting/chat). Set `NEXT_PUBLIC_CHAT_DISABLED=true` to hide Chat when it is not configured. |
-| OAuth integrations | Your provider app and credentials for each OAuth service you use. API-key integrations take keys in their blocks. |
-| Remote Function or Pi execution | An E2B or Daytona provider key and the appropriate immutable image. Function and Pi use separate images. |
-
-Plain JavaScript without `import` or `require` runs in isolated-vm within Node child workers in the app container. Python, Shell, imported JavaScript, custom Function Sandboxes, and file-path or sandbox execution require remote sandbox configuration. See [Sandboxes](/platform/self-hosting/sandboxes).
-
-## Enterprise features
-
-In a standard billing-disabled self-hosted deployment, enterprise features are enabled through configuration:
-
-```bash
-ENTERPRISE_ENABLED=true
-```
-
-Organizations, SSO, permission groups, audit logs, session policies, retention, and data drains also need their feature-specific configuration. Most read settings from the organization that owns a workspace. Enabling the suite can enable retention processing; review the configured policy before turning it on.
-
-See [Self-hosted enterprise features](/platform/enterprise/self-hosted) for organization setup, per-feature flags, and billing-enabled differences.
-
-## Related docs
-
-- [Environment variables](/platform/self-hosting/environment-variables)
-- [Authentication](/platform/self-hosting/authentication)
-- [Integrations and OAuth](/platform/self-hosting/integrations-oauth)
-- [Security](/platform/self-hosting/security)
-- [Upgrades](/platform/self-hosting/upgrades)
+| Agent blocks | A model provider key, or a self-hosted endpoint such as Ollama, vLLM, LM Studio, or LiteLLM. See [Local models](/platform/self-hosting/local-models). |
+| Knowledge bases | An embedding provider: OpenAI, Azure OpenAI, OpenRouter, Gemini, or your own Ollama. See [Knowledge bases](/platform/self-hosting/environment-variables#knowledge-bases). |
+| Chat | `COPILOT_API_KEY` for the Sim-hosted Chat service, or your own Mothership. See [Chat service](/platform/self-hosting/chat). |
+| OAuth integrations | A provider app and its client credentials for each service. See [Integrations and OAuth](/platform/self-hosting/integrations-oauth). |
+| Enterprise features (SSO, SCIM, audit logs, permission groups) | `ENTERPRISE_ENABLED` and an organization. See [Self-hosted enterprise](/platform/enterprise/self-hosted). |
+| Python, Shell, imported JavaScript, and Pi | A remote sandbox: E2B, Daytona, or Kubernetes. Plain JavaScript runs locally. See [Sandboxes](/platform/self-hosting/sandboxes). |
+
+## Production checklist
+
+1. Serve one public HTTPS origin and route `/socket.io` to realtime. See [Networking](/platform/self-hosting/networking).
+2. Store the generated secrets and back up the encryption keys separately from the database. See [Secrets](/platform/self-hosting/security#secrets).
+3. Configure [object storage](/platform/self-hosting/object-storage) for uploads.
+4. Configure [email](/platform/self-hosting/email) for invitations, verification, and password resets.
+5. Confirm the scheduler runs with `CRON_SECRET`. See [Background jobs](/platform/self-hosting/background-jobs).
+6. Restrict who can sign up. See [Authentication](/platform/self-hosting/authentication#controlling-who-can-sign-up).
+7. Pin a release and back up the database before every upgrade. See [Upgrades](/platform/self-hosting/upgrades).
+8. Work through [Verify your install](/platform/self-hosting/verify) and the [pre-launch checklist](/platform/self-hosting/security#pre-launch-checklist).
diff --git a/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx b/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx
index 2c207c5c8f5..201b9352d95 100644
--- a/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/integrations-oauth.mdx
@@ -4,46 +4,26 @@ description: Configure provider apps, callbacks, and credentials for your deploy
---
import { Step, Steps } from '@/components/ui/steps'
-import { Tabs, Tab } from '@/components/ui/tabs'
-Register provider apps for the OAuth integrations your team uses. API-key blocks take member-supplied keys; service-account connections have their own configuration. Sim login providers are separate from integration connections, even when they share client credentials.
-
-## Prerequisites
-
-- Serve Sim at a stable public origin and set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` to match.
-- Have permission to register an app and grant the required provider permissions.
-- Use the deployment's secret store or env files for client secrets.
-- For webhook triggers, make Sim reachable from the provider's servers. Polling triggers instead require the scheduler.
-
-Each OAuth connector has a provider ID. Its callback is:
-
-```text
-https:///api/auth/oauth2/callback/
-```
-
-Register the exact scheme, hostname, port, and path. Use no trailing slash. A provider that permits several callbacks can share one app across connectors or environments; GitHub Search's installation setup requires a separate app per deployment origin.
+Register a provider app for each OAuth integration your team uses. API-key integrations take keys members enter in Sim and need no deployment configuration. Sign-in providers are configured separately in [Authentication](/platform/self-hosting/authentication#social-login), even when they share client credentials.
## Set up an OAuth client [#setup]
-1. Set your public origin:
+1. Serve Sim at its public origin with `NEXT_PUBLIC_APP_URL` set to it.
+2. Register an app with the provider and add the redirect URI for each provider ID you use. Unless a section below says otherwise, it is:
- ```bash
- NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
- BETTER_AUTH_URL=https://sim.yourdomain.com
+ ```text
+ https:///api/auth/oauth2/callback/
```
-2. Register the provider app and each connector callback you need. Configure provider-side APIs, permissions, consent, and distribution using the sections below.
-3. Store the matching client ID/secret and restart the app. With Compose, recreate the app container after editing `.env`; a running process does not reread credentials.
-4. Connect an account from the integration and confirm it returns to Sim with the account listed. Test an operation using that connection.
-
-For Kubernetes, use the configured [secret strategy](/platform/self-hosting/kubernetes#secret-stores): inline `app.env` becomes a chart-managed Secret; an existing Secret must contain the standard env keys; ESO requires `externalSecrets.remoteRefs.app` mappings and suppresses the inline Secret. Do not commit credentials to a values file. Explicit `app.env` credentials in existing-Secret mode are inlined into pod specs.
+ Match the scheme, host, port, and path exactly, with no trailing slash.
+3. Store the client ID and secret through your [secret strategy](/platform/self-hosting/kubernetes#secret-stores) or `.env`, and recreate the app.
+4. Connect an account from the integration, confirm it returns to Sim, and run an operation with it.
-When changing an organization's saved OAuth provider configuration or scopes, an organization admin updates that configuration and affected members reconnect. Changing server variables alone does not replace an organization's saved provider settings.
+Each integration page lists the scopes Sim requests under **OAuth scopes**. After you change a client or its scopes, an organization admin updates the saved provider configuration under **Settings → Credential Groups → Integrations**, and affected members reconnect.
## Provider reference
-Every provider ID below uses the callback format above unless its section specifies another flow. Integration references contain operation-specific requirements and their **OAuth Scopes** sections.
-
### Google
Use one web OAuth client for the enabled Google services. The same client variables can also provide **Sign in with Google**; register `/api/auth/callback/google` separately if you use it.
@@ -58,73 +38,7 @@ Use one web OAuth client for the enabled Google services. The same client variab
4. Open **Google Auth platform → Clients → Create client**, select **Web application**, and add each enabled connector's callback under **Authorized redirect URIs**. Add callbacks to an existing client if the deployment already uses one. See [Google web credentials](https://developers.google.com/workspace/guides/create-credentials#web-application).
5. Store `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`, restart Sim, and connect each service separately. Workspace administrators may need to approve the app.
-For example, Gmail and Drive require both callbacks:
-
-```text
-https://sim.yourdomain.com/api/auth/oauth2/callback/google-email
-https://sim.yourdomain.com/api/auth/oauth2/callback/google-drive
-```
-
-#### Member-account scopes
-
-These are the full Google member scope sets for the Search services below. Their connections also support workflow actions, so requested scopes can be broader than Search's read-only operations. The same Google identity does not imply the same grant for another service.
-
-
-
-
-Callback: `/api/auth/oauth2/callback/google-email`.
-
-```text
-openid
-https://www.googleapis.com/auth/userinfo.email
-https://www.googleapis.com/auth/userinfo.profile
-https://www.googleapis.com/auth/gmail.send
-https://www.googleapis.com/auth/gmail.modify
-https://www.googleapis.com/auth/gmail.labels
-```
-
-
-
-
-Callback: `/api/auth/oauth2/callback/google-drive`.
-
-```text
-openid
-https://www.googleapis.com/auth/userinfo.email
-https://www.googleapis.com/auth/userinfo.profile
-https://www.googleapis.com/auth/drive.file
-https://www.googleapis.com/auth/drive
-```
-
-
-
-
-Callback: `/api/auth/oauth2/callback/google-calendar`.
-
-```text
-openid
-https://www.googleapis.com/auth/userinfo.email
-https://www.googleapis.com/auth/userinfo.profile
-https://www.googleapis.com/auth/calendar
-```
-
-
-
-
-Callback: `/api/auth/oauth2/callback/google-meet`.
-
-```text
-openid
-https://www.googleapis.com/auth/userinfo.email
-https://www.googleapis.com/auth/userinfo.profile
-https://www.googleapis.com/auth/meetings.space.created
-https://www.googleapis.com/auth/meetings.space.readonly
-```
-
-
-
-
-Other Google connectors declare their current scopes in their integration reference. Google Search service-account sources use separate domain-wide delegation scopes; those do not replace each member's OAuth connection. Configure delegation using the [Gmail](/search/gmail), [Drive](/search/google-drive), and [Calendar](/search/google-calendar) source guides. Meet member Search does not require a service account.
+Google Search's service-account sources use separate domain-wide delegation; see the [Gmail](/search/gmail), [Drive](/search/google-drive), and [Calendar](/search/google-calendar) source guides. Scopes per service: [Gmail](/integrations/gmail#oauth-scopes), [Drive](/integrations/google_drive#oauth-scopes), [Calendar](/integrations/google_calendar#oauth-scopes), [Meet](/integrations/google_meet#oauth-scopes).
### Microsoft
@@ -139,25 +53,7 @@ Use one [Entra app registration](https://learn.microsoft.com/en-us/entra/identit
3. Under **API permissions → Add a permission**, select the resource API and its **Delegated permissions**. Configure the scopes below; grant tenant admin consent when the permission requires it. These are member connections, not application/service-principal permissions. See [Microsoft API permissions](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-configure-app-access-web-apis).
4. Create a client secret, store its value as `MICROSOFT_CLIENT_SECRET`, and store the application client ID as `MICROSOFT_CLIENT_ID`. Restart Sim and connect each service.
-Every connector below requests `openid`, `profile`, `email`, and `offline_access`, plus its resource scopes:
-
-| Provider ID | Additional delegated scopes |
-| --- | --- |
-| `outlook` | `Mail.ReadWrite`, `Mail.ReadBasic`, `Mail.Read`, `Mail.Send`, `Calendars.ReadWrite` |
-| `onedrive` | `Files.Read`, `Files.ReadWrite` |
-| `sharepoint` | `Sites.Read.All`, `Sites.ReadWrite.All`, `Sites.Manage.All` |
-| `microsoft-teams` | `User.Read`, `Chat.Read`, `Chat.ReadWrite`, `Chat.ReadBasic`, `ChatMessage.Send`, `Channel.ReadBasic.All`, `ChannelMessage.Send`, `ChannelMessage.Read.All`, `ChannelMessage.ReadWrite`, `ChannelMember.Read.All`, `Group.Read.All`, `Group.ReadWrite.All`, `Team.ReadBasic.All`, `TeamMember.Read.All`, `Files.Read`, `Sites.Read.All` |
-| `microsoft-excel` | `Files.Read`, `Files.ReadWrite` |
-| `microsoft-word` | `Files.Read`, `Files.ReadWrite`, `Files.Read.All`, `Files.ReadWrite.All` |
-| `microsoft-planner` | `Group.ReadWrite.All`, `Group.Read.All`, `Tasks.ReadWrite` |
-| `microsoft-powerbi` | `https://analysis.windows.net/powerbi/api/Workspace.Read.All`, `https://analysis.windows.net/powerbi/api/Report.Read.All`, `https://analysis.windows.net/powerbi/api/Dataset.ReadWrite.All` |
-| `microsoft-dataverse` | `https://dynamics.microsoft.com/user_impersonation` |
-| `microsoft-ad` | `User.ReadWrite.All`, `Group.ReadWrite.All`, `GroupMember.ReadWrite.All`, `LicenseAssignment.Read.All`, `LicenseAssignment.ReadWrite.All`, `UserAuthenticationMethod.ReadWrite.All`, `AuditLog.Read.All`, `Application.Read.All`, `AppRoleAssignment.ReadWrite.All`, `RoleManagement.ReadWrite.Directory`, `Device.Read.All`, `Policy.Read.All` |
-| `microsoft-intune` | `DeviceManagementManagedDevices.Read.All`, `DeviceManagementConfiguration.Read.All`, `DeviceManagementManagedDevices.PrivilegedOperations.All` |
-
-For Power BI, use its Web callback and organizational account from the home tenant. The `https://analysis.windows.net/powerbi/api/` prefix is part of the requested resource scopes. Power BI uses a separate connection from Microsoft Graph; Credential Groups and service-principal authentication are unsupported in this version. See [Power BI](/integrations/powerbi).
-
-For Dataverse/Dynamics 365, add **Dynamics CRM → Delegated permissions → user_impersonation**. The table shows the legacy Dynamics resource scope; environment-specific Dataverse connections request that environment's resource scope. Azure AD, Intune, Teams, and Planner permissions can require tenant-admin consent. Reconnect existing accounts after adding scopes.
+Each integration page lists its delegated permissions, for example [Outlook](/integrations/outlook#oauth-scopes), [Teams](/integrations/microsoft_teams#oauth-scopes), and [SharePoint](/integrations/sharepoint#oauth-scopes). Azure AD, Intune, Teams, and Planner permissions need tenant admin consent. Power BI uses its own connection, with the `https://analysis.windows.net/powerbi/api/` resource prefix. For Dataverse and Dynamics 365, add **Dynamics CRM → Delegated permissions → user_impersonation**.
### Atlassian
@@ -174,104 +70,10 @@ Configure Confluence and Jira with their respective OAuth credentials and callba
4. Enable sharing under **Distribution** so members other than the app owner can connect.
5. Store the service's client ID/secret from **Settings**, restart Sim, and connect from **Integrations**, selecting the intended site. After changing client/scopes, update the organization's provider configuration and reconnect affected accounts.
-These are the full member connection scope sets. They include workflow writes; Search itself uses read operations. Jira's list includes Service Management and Assets permissions. Service-account read scopes from Search do not replace this app configuration. See [Confluence OAuth](https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/) and [Jira OAuth](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/).
-
-
-
-
-```text
-read:confluence-content.all
-read:confluence-space.summary
-read:space:confluence
-write:confluence-content
-write:confluence-space
-write:confluence-file
-read:page:confluence
-write:page:confluence
-read:comment:confluence
-write:comment:confluence
-delete:comment:confluence
-delete:attachment:confluence
-delete:page:confluence
-read:label:confluence
-write:label:confluence
-read:attachment:confluence
-write:attachment:confluence
-search:confluence
-read:me
-offline_access
-read:hierarchical-content:confluence
-read:content.metadata:confluence
-read:user:confluence
-read:confluence-user
-read:group:confluence
-read:task:confluence
-write:task:confluence
-write:space:confluence
-delete:space:confluence
-read:blogpost:confluence
-write:blogpost:confluence
-delete:blogpost:confluence
-read:content.property:confluence
-write:content.property:confluence
-read:space.property:confluence
-write:space.property:confluence
-read:space.permission:confluence
-```
-
-
-
-
-```text
-read:jira-user
-read:jira-work
-write:jira-work
-read:me
-offline_access
-read:issue.vote:jira
-read:user:jira
-delete:issue:jira
-delete:comment:jira
-delete:attachment:jira
-delete:issue-worklog:jira
-delete:issue-link:jira
-read:servicedesk-request
-write:servicedesk-request
-manage:servicedesk-customer
-read:servicedesk:jira-service-management
-read:requesttype:jira-service-management
-read:request:jira-service-management
-write:request:jira-service-management
-read:request.comment:jira-service-management
-write:request.comment:jira-service-management
-read:servicedesk.customer:jira-service-management
-write:servicedesk.customer:jira-service-management
-read:organization:jira-service-management
-write:organization:jira-service-management
-read:servicedesk.organization:jira-service-management
-write:servicedesk.organization:jira-service-management
-read:queue:jira-service-management
-read:request.sla:jira-service-management
-read:request.status:jira-service-management
-write:request.status:jira-service-management
-read:request.participant:jira-service-management
-write:request.participant:jira-service-management
-read:request.approval:jira-service-management
-write:request.approval:jira-service-management
-read:cmdb-object:jira
-write:cmdb-object:jira
-delete:cmdb-object:jira
-read:cmdb-schema:jira
-read:cmdb-type:jira
-read:cmdb-attribute:jira
-```
-
-
-
+Add the scopes listed for [Confluence](/integrations/confluence#oauth-scopes) and [Jira](/integrations/jira#oauth-scopes). A service-account credential for Search is configured separately.
### GitHub Search
-
Self-hosted GitHub Search uses a GitHub App for personal account connections and optional organization repository boundaries. Register your own App and configure the server variables below. Sim Cloud users use the [GitHub Search setup flow](/search/github#add-a-repository) directly.
@@ -360,7 +162,7 @@ Keep the private key and client secret in the deployment's server configuration;
Configure all five variables on the app. If a separate worker indexes GitHub knowledge bases, configure its matching environment too; app secret changes do not update a separate worker. Live Search does not use an indexing worker.
-The **Client ID** is different from the numeric **App ID**. Use credentials from **Developer settings → GitHub Apps**. `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` belong to the separate GitHub sign-in integration and remain unchanged. Search does not read `GITHUB_REPO_CLIENT_ID` or `GITHUB_REPO_CLIENT_SECRET`.
+The **Client ID** is different from the numeric **App ID**. Use credentials from **Developer settings → GitHub Apps**. `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` belong to the separate GitHub sign-in integration and remain unchanged.
Keep **Expire user authorization tokens** enabled so Sim receives the refresh token it needs to [renew personal connections](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens).
@@ -377,101 +179,75 @@ GitHub workflow blocks and knowledge-base token connections continue to use pers
### Other providers [#everything-else]
+Every OAuth client a deployment can configure that has no section above. Each service links to its scope list.
-| Service | Environment variables | Provider ID |
-|---|---|---|
-| Slack | `SLACK_CLIENT_ID` / `SLACK_CLIENT_SECRET` | `slack` |
-| Notion | `NOTION_CLIENT_ID` / `NOTION_CLIENT_SECRET` | `notion` |
-| Jira | `JIRA_CLIENT_ID` / `JIRA_CLIENT_SECRET` | `jira` |
-| Confluence | `CONFLUENCE_CLIENT_ID` / `CONFLUENCE_CLIENT_SECRET` | `confluence` |
-| Linear | `LINEAR_CLIENT_ID` / `LINEAR_CLIENT_SECRET` | `linear` |
-| Asana | `ASANA_CLIENT_ID` / `ASANA_CLIENT_SECRET` | `asana` |
-| ClickUp | `CLICKUP_CLIENT_ID` / `CLICKUP_CLIENT_SECRET` | `clickup` |
-| Monday | `MONDAY_CLIENT_ID` / `MONDAY_CLIENT_SECRET` | `monday` |
-| Airtable | `AIRTABLE_CLIENT_ID` / `AIRTABLE_CLIENT_SECRET` | `airtable` |
-| Bitbucket | `BITBUCKET_CLIENT_ID` / `BITBUCKET_CLIENT_SECRET` | `bitbucket` |
-| Help Scout | `HELPSCOUT_CLIENT_ID` / `HELPSCOUT_CLIENT_SECRET` | `helpscout` |
-| HubSpot | `HUBSPOT_CLIENT_ID` / `HUBSPOT_CLIENT_SECRET` | `hubspot` |
-| Salesforce | `SALESFORCE_CLIENT_ID` / `SALESFORCE_CLIENT_SECRET` | `salesforce` |
-| Apollo | `APOLLO_CLIENT_ID` / `APOLLO_CLIENT_SECRET` | `apollo` |
-| Pipedrive | `PIPEDRIVE_CLIENT_ID` / `PIPEDRIVE_CLIENT_SECRET` | `pipedrive` |
-| Attio | `ATTIO_CLIENT_ID` / `ATTIO_CLIENT_SECRET` | `attio` |
-| Zoho Desk | `ZOHO_CLIENT_ID` / `ZOHO_CLIENT_SECRET` | `zoho-desk` |
-| Wealthbox | `WEALTHBOX_CLIENT_ID` / `WEALTHBOX_CLIENT_SECRET` | `wealthbox` |
-| Box | `BOX_CLIENT_ID` / `BOX_CLIENT_SECRET` | `box` |
-| Dropbox | `DROPBOX_CLIENT_ID` / `DROPBOX_CLIENT_SECRET` | `dropbox` |
-| DocuSign | `DOCUSIGN_CLIENT_ID` / `DOCUSIGN_CLIENT_SECRET` | `docusign` |
-| Zoom | `ZOOM_CLIENT_ID` / `ZOOM_CLIENT_SECRET` | `zoom` |
-| Cal.com | `CALCOM_CLIENT_ID` only — PKCE public client, no secret | `calcom` |
-| Webflow | `WEBFLOW_CLIENT_ID` / `WEBFLOW_CLIENT_SECRET` | `webflow` |
-| WordPress | `WORDPRESS_CLIENT_ID` / `WORDPRESS_CLIENT_SECRET` | `wordpress` |
-| LinkedIn | `LINKEDIN_CLIENT_ID` / `LINKEDIN_CLIENT_SECRET` | `linkedin` |
-| X | `X_CLIENT_ID` / `X_CLIENT_SECRET` | `x` |
-| Ramp | `RAMP_CLIENT_ID` / `RAMP_CLIENT_SECRET` | `ramp` |
-| Reddit | `REDDIT_CLIENT_ID` / `REDDIT_CLIENT_SECRET` | `reddit` |
-| Spotify | `SPOTIFY_CLIENT_ID` / `SPOTIFY_CLIENT_SECRET` | `spotify` |
-| TikTok | `TIKTOK_CLIENT_ID` / `TIKTOK_CLIENT_SECRET` | `tiktok` |
-
-For Help Scout, create an app under **Your Profile > My Apps** and set its redirection URL to
-`https:///api/auth/oauth2/callback/helpscout`. The App ID and App Secret are the client
-ID and secret. Help Scout has no OAuth scopes: a connection acts with the permissions of the user who
-authorizes it.
-
-For Bitbucket, create an OAuth consumer and register
-`https:///api/auth/oauth2/callback/bitbucket` as its callback URL. Bitbucket fixes
-permissions on the consumer instead of narrowing them per authorization request. Enable exactly
-Account read, Repositories read/write, Pull requests read/write, Pipelines read/write, and Webhooks
-read/write (`account`, `repository`, `repository:write`, `pullrequest`, `pullrequest:write`,
-`pipeline`, `pipeline:write`, and `webhook`). The webhook permission is required for automatic
-trigger subscription management.
+{/* self-hosting-oauth-clients:begin — generated by `bun run generate:self-hosting-docs`; do not edit between markers */}
+
+| Service | Environment variables | Redirect URI |
+| --- | --- | --- |
+| [Airtable](/integrations/airtable#oauth-scopes) | `AIRTABLE_CLIENT_ID`, `AIRTABLE_CLIENT_SECRET` | `/api/auth/oauth2/callback/airtable` |
+| [Apollo](/integrations/apollo#oauth-scopes) | `APOLLO_CLIENT_ID`, `APOLLO_CLIENT_SECRET` | `/api/auth/oauth2/callback/apollo` |
+| [Asana](/integrations/asana#oauth-scopes) | `ASANA_CLIENT_ID`, `ASANA_CLIENT_SECRET` | `/api/auth/oauth2/callback/asana` |
+| [Attio](/integrations/attio#oauth-scopes) | `ATTIO_CLIENT_ID`, `ATTIO_CLIENT_SECRET` | `/api/auth/oauth2/callback/attio` |
+| [Bitbucket](/integrations/bitbucket#oauth-scopes) | `BITBUCKET_CLIENT_ID`, `BITBUCKET_CLIENT_SECRET` | `/api/auth/oauth2/callback/bitbucket` |
+| [Box](/integrations/box#oauth-scopes) | `BOX_CLIENT_ID`, `BOX_CLIENT_SECRET` | `/api/auth/oauth2/callback/box` |
+| [Cal.com](/integrations/calcom#oauth-scopes) | `CALCOM_CLIENT_ID` | `/api/auth/oauth2/callback/calcom` |
+| [ClickUp](/integrations/clickup#oauth-scopes) | `CLICKUP_CLIENT_ID`, `CLICKUP_CLIENT_SECRET` | `/api/auth/oauth2/callback/clickup` |
+| [DocuSign](/integrations/docusign#oauth-scopes) | `DOCUSIGN_CLIENT_ID`, `DOCUSIGN_CLIENT_SECRET` | `/api/auth/oauth2/callback/docusign` |
+| [Dropbox](/integrations/dropbox#oauth-scopes) | `DROPBOX_CLIENT_ID`, `DROPBOX_CLIENT_SECRET` | `/api/auth/oauth2/callback/dropbox` |
+| [Greenhouse](/integrations/greenhouse#oauth-scopes) | `GREENHOUSE_CLIENT_ID`, `GREENHOUSE_CLIENT_SECRET` | `/api/auth/oauth2/callback/greenhouse` |
+| [Help Scout](/integrations/helpscout#oauth-scopes) | `HELPSCOUT_CLIENT_ID`, `HELPSCOUT_CLIENT_SECRET` | `/api/auth/oauth2/callback/helpscout` |
+| [HubSpot](/integrations/hubspot#oauth-scopes) | `HUBSPOT_CLIENT_ID`, `HUBSPOT_CLIENT_SECRET` | `/api/auth/oauth2/callback/hubspot` |
+| [HubSpot Search](/search/hubspot) | `HUBSPOT_MCP_CLIENT_ID`, `HUBSPOT_MCP_CLIENT_SECRET` | `/api/mcp/oauth/callback` |
+| Instagram | `INSTAGRAM_CLIENT_ID`, `INSTAGRAM_CLIENT_SECRET` | `/api/auth/oauth2/callback/instagram` |
+| [Linear](/integrations/linear#oauth-scopes) | `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET` | `/api/auth/oauth2/callback/linear` |
+| [LinkedIn](/integrations/linkedin#oauth-scopes) | `LINKEDIN_CLIENT_ID`, `LINKEDIN_CLIENT_SECRET` | `/api/auth/oauth2/callback/linkedin` |
+| [ManageEngine ServiceDesk Plus](/integrations/manageengine_sdp#oauth-scopes), [Zoho Desk](/integrations/zoho_desk#oauth-scopes) | `ZOHO_CLIENT_ID`, `ZOHO_CLIENT_SECRET` | `/api/auth/oauth2/callback/manageengine-sdp`
`/api/auth/oauth2/callback/zoho-desk` |
+| [Monday.com](/integrations/monday#oauth-scopes) | `MONDAY_CLIENT_ID`, `MONDAY_CLIENT_SECRET` | `/api/auth/oauth2/callback/monday` |
+| [Notion](/integrations/notion#oauth-scopes) | `NOTION_CLIENT_ID`, `NOTION_CLIENT_SECRET` | `/api/auth/oauth2/callback/notion` |
+| [Pipedrive](/integrations/pipedrive#oauth-scopes) | `PIPEDRIVE_CLIENT_ID`, `PIPEDRIVE_CLIENT_SECRET` | `/api/auth/oauth2/callback/pipedrive` |
+| [Ramp](/integrations/ramp#oauth-scopes) | `RAMP_CLIENT_ID`, `RAMP_CLIENT_SECRET` | `/api/auth/oauth2/callback/ramp` |
+| [Reddit](/integrations/reddit#oauth-scopes) | `REDDIT_CLIENT_ID`, `REDDIT_CLIENT_SECRET` | `/api/auth/oauth2/callback/reddit` |
+| [Salesforce](/integrations/salesforce#oauth-scopes) | `SALESFORCE_CLIENT_ID`, `SALESFORCE_CLIENT_SECRET` | `/api/auth/oauth2/callback/salesforce`
`/api/auth/oauth2/callback/salesforce-sandbox` |
+| [Shopify](/integrations/shopify#oauth-scopes) | `SHOPIFY_CLIENT_ID`, `SHOPIFY_CLIENT_SECRET` | `/api/auth/oauth2/callback/shopify` |
+| [Slack](/integrations/slack#oauth-scopes) | `SLACK_CLIENT_ID`, `SLACK_CLIENT_SECRET` | `/api/auth/oauth2/callback/slack` |
+| Spotify | `SPOTIFY_CLIENT_ID`, `SPOTIFY_CLIENT_SECRET` | `/api/auth/oauth2/callback/spotify` |
+| [TikTok](/integrations/tiktok#oauth-scopes) | `TIKTOK_CLIENT_ID`, `TIKTOK_CLIENT_SECRET` | `/api/auth/oauth2/callback/tiktok` |
+| Trello | `TRELLO_API_KEY` | `/api/auth/trello/callback` |
+| [Wealthbox](/integrations/wealthbox#oauth-scopes) | `WEALTHBOX_CLIENT_ID`, `WEALTHBOX_CLIENT_SECRET` | `/api/auth/oauth2/callback/wealthbox` |
+| [Webflow](/integrations/webflow#oauth-scopes) | `WEBFLOW_CLIENT_ID`, `WEBFLOW_CLIENT_SECRET` | `/api/auth/oauth2/callback/webflow` |
+| [WordPress](/integrations/wordpress#oauth-scopes) | `WORDPRESS_CLIENT_ID`, `WORDPRESS_CLIENT_SECRET` | `/api/auth/oauth2/callback/wordpress` |
+| [X](/integrations/x#oauth-scopes) | `X_CLIENT_ID`, `X_CLIENT_SECRET` | `/api/auth/oauth2/callback/x` |
+| [Zoom](/integrations/zoom#oauth-scopes) | `ZOOM_CLIENT_ID`, `ZOOM_CLIENT_SECRET` | `/api/auth/oauth2/callback/zoom` |
+| [Zoom Search](/search/zoom) | `ZOOM_MCP_CLIENT_ID`, `ZOOM_MCP_CLIENT_SECRET` | `/api/mcp/oauth/callback` |
+
+{/* self-hosting-oauth-clients:end */}
+
+`SLACK_SEARCH_*` variables configure Sim Cloud's shared Slack Search app and have no effect on a self-hosted deployment.
Some providers need more setup than a client ID, secret, and redirect URI:
| Service | Extra setup |
|---|---|
+| Bitbucket | Permissions are fixed on the OAuth consumer. Enable Account read, Repositories, Pull requests, Pipelines, and Webhooks read/write; webhooks let triggers manage their subscriptions. |
+| Help Scout | Create the app under **Your Profile → My Apps**; its App ID and App Secret are the client ID and secret. Help Scout has no scopes. |
+| Instagram | Use the Instagram App ID and secret from the Meta App Dashboard (Instagram API setup with Instagram login). Publishing needs [object storage](/platform/self-hosting/object-storage): Meta fetches media from a public HTTPS URL. |
+| QuickBooks | No deployment variables: the client ID, secret, and environment are entered in Sim for each connection. Register `/api/auth/oauth2/callback/quickbooks`. |
+| Shopify | Each shop installs the app. |
+| Trello | Uses an API key, not OAuth 2.0. Add your Sim origin to the key's allowed origins, or Trello does not redirect back. |
| Asana | Sim requests the `default` scope. Enable **Full permissions** under the app's OAuth settings, or Asana rejects the authorization. |
| Attio | Enable the scopes listed on the [Attio page](/integrations/attio#oauth-scopes) in the app's Developer console; Attio grants scopes from the app, not the authorization request. |
| Cal.com | Sim does not send a `scope` parameter, so connecting works only with a legacy Cal.com OAuth client: one with no scopes configured, or only `READ_BOOKING` and `READ_PROFILE`. Cal.com requires at least one scope on new clients and rejects their authorization without a `scope` parameter. |
| DocuSign | `DOCUSIGN_AUTH_HOST` defaults to the demo host `account-d.docusign.com`. Set it to `account.docusign.com` for production accounts. |
-| Microsoft | Azure AD, Teams, and Planner request permissions that need tenant admin consent. For Dataverse and Dynamics 365, add the **Dynamics CRM** API's delegated `user_impersonation` permission. |
| Notion | Enable the integration's **Read content**, **Update content**, **Insert content**, **Read comments**, **Insert comments**, and **User information with email addresses** capabilities. |
| Zoho Desk and ManageEngine | Both use one Zoho client. Register both `zoho-desk` and `manageengine-sdp` redirect URIs on it if you use both. |
-### Services with a different flow
-
-| Service | Configuration | Notes |
-|---|---|---|
-| **Instagram** | `INSTAGRAM_CLIENT_ID` / `INSTAGRAM_CLIENT_SECRET` | Instagram App ID/Secret from the Meta App Dashboard (Instagram → API setup with Instagram login). Redirect URI: `/api/auth/oauth2/callback/instagram`. **Publishing requires cloud object storage** — Meta fetches a public HTTPS URL, so local-disk storage will not work. |
-| **QuickBooks** | Configure client ID, client secret, environment, and optional webhook verifier token on the connection/provider configuration | Callback: `/api/auth/oauth2/callback/quickbooks`. This uses per-connection app configuration rather than deployment-wide client env variables. |
-| **Shopify** | `SHOPIFY_CLIENT_ID` / `SHOPIFY_CLIENT_SECRET` | Redirect URI: `/api/auth/oauth2/callback/shopify`. Per-shop install flow. |
-| **Trello** | `TRELLO_API_KEY` | API-key based, not OAuth 2.0. Callback: `/api/auth/trello/callback`. Add your Sim origin (`NEXT_PUBLIC_APP_URL`) to the API key's allowed origins, or Trello will not redirect back. |
+## API-key integrations
-## Non-OAuth integration credentials
-
-
-Many blocks authenticate with an API key the user pastes into the block, and need nothing from you.
-
-Sim also has a "hosted key" mechanism, configured with the `{PREFIX}_API_KEY_COUNT` + `{PREFIX}_API_KEY_1..N` variables below, that lets the platform supply a key so users do not have to. **The injection path is gated on the deployment being Sim's hosted platform** (`isHosted`, derived from the app hostname), so on a self-hosted instance these variables do not remove the need for users to bring their own key. Treat these as hosted-platform configuration; they do not enable platform-supplied integration keys on a standard production self-hosted instance.
-
-The variables, for reference:
-
-| Variable | Service |
-|---|---|
-| `EXA_API_KEY` (or `EXA_API_KEY_COUNT` + `EXA_API_KEY_1..N`) | Exa search |
-| `SERPER_API_KEY` | Serper search |
-| `BROWSERBASE_API_KEY` / `BROWSERBASE_PROJECT_ID` | Browserbase |
-| `HUNTER_API_KEY_COUNT` + `HUNTER_API_KEY_1..N` | Hunter.io |
-| `PEOPLEDATALABS_API_KEY_COUNT` + `PEOPLEDATALABS_API_KEY_1..N` | People Data Labs |
-| `CONTEXT_DEV_API_KEY_COUNT` + `CONTEXT_DEV_API_KEY_1..N` | Context.dev |
-| `FALAI_API_KEY` | fal.ai |
-| `TWILIO_ACCOUNT_SID` / `TWILIO_AUTH_TOKEN` / `TWILIO_PHONE_NUMBER` | Twilio |
-| `AGENTMAIL_API_KEY` / `AGENTMAIL_DOMAIN` | AgentMail |
-
-Providers that take a `_COUNT` plus numbered keys distribute requests round-robin across them.
+Integrations that authenticate with an API key take the key a member enters in Sim. Variables such as `EXA_API_KEY` or `SERPER_API_KEY` supply platform keys only on Sim Cloud and have no effect on a self-hosted deployment.
## Triggers that need extra configuration
-
Webhook triggers receive callbacks from the provider and must be able to verify them:
| Variable | Needed for |
@@ -481,7 +257,7 @@ Webhook triggers receive callbacks from the provider and must be able to verify
When enabling the native Sim Slack trigger, configure both variables together. Enable `SLACK_EXTENDED_SCOPES` only after Slack approves the app for `assistant:write`, `app_mentions:read`, and `im:history`; otherwise Slack rejects OAuth authorization. Slack OAuth actions can use `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` without enabling the native trigger or supplying a signing secret.
-Your deployment must also be reachable from the provider's servers for webhook triggers to fire — a Sim instance on a private network can use polling triggers but not webhook triggers. Polling triggers additionally require the scheduler; see [Background Jobs](/platform/self-hosting/background-jobs).
+Your deployment must also be reachable from the provider's servers for webhook triggers to fire — a Sim instance on a private network can use polling triggers but not webhook triggers. Polling triggers need the [scheduler](/platform/self-hosting/background-jobs).
## Troubleshooting
@@ -490,7 +266,6 @@ Your deployment must also be reachable from the provider's servers for webhook t
| Callback/redirect URI mismatch | Compare scheme, hostname, port, and path with the callback derived from `NEXT_PUBLIC_APP_URL`. |
| Only the provider app owner can connect | Check audience/test users, app distribution, and provider approval. |
| A new scope is missing | Configure the provider permission, update saved organization provider configuration where applicable, then reconnect the account. |
-| Instagram publishing cannot fetch media | Configure cloud object storage with a publicly reachable HTTPS media URL. This is a publishing requirement; Gmail attachments do not have the same constraint. |
| Polling trigger stays idle | Verify the scheduler and `CRON_SECRET`; a connected OAuth account does not prove scheduling works. |
## Related docs
diff --git a/apps/docs/content/docs/platform/self-hosting/kubernetes.mdx b/apps/docs/content/docs/platform/self-hosting/kubernetes.mdx
index 75c0a9f1fd9..097850024cc 100644
--- a/apps/docs/content/docs/platform/self-hosting/kubernetes.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/kubernetes.mdx
@@ -1,114 +1,84 @@
---
title: Kubernetes
-description: Install the Sim Helm chart, configure public access, and verify the release
+description: Install the Sim Helm chart on a cluster you operate
---
import { Callout } from '@/components/ui/callout'
-Deploy Sim on a Kubernetes cluster you operate. The chart bundles PostgreSQL with pgvector and Redis, runs migrations before the app starts, and enables scheduled jobs by default.
+The Helm chart deploys the app, realtime, migrations (as an init container on the app), and the scheduled jobs. It bundles PostgreSQL with pgvector and Redis for evaluation. It does not provision cloud resources; see [Reference architectures](/platform/self-hosting/reference-architectures) for what you create first.
-Always install a pinned chart version: without `--version`, Helm resolves the newest chart at install time, so the same command deploys different releases on different days. Each chart's `appVersion` is the Sim release its images default to. To see the newest chart and the release it installs, or every published version:
+## Prerequisites
+
+- Kubernetes 1.25 or later, and Helm 3.8 or later.
+- A default StorageClass with `ReadWriteOnce` for the bundled PostgreSQL.
+- An ingress controller and a TLS certificate for public access.
+- `metrics-server` for autoscaling, and the External Secrets Operator if you use it.
+
+## 1. Pin the chart
+
+Each chart version installs one Sim release, its `appVersion`. Resolve the newest chart once and reuse the version for every later command:
```bash
-helm show chart oci://ghcr.io/simstudioai/charts/sim | grep -E '^(version|appVersion):'
-crane ls ghcr.io/simstudioai/charts/sim # every published version; or `helm search repo sim/sim --versions` after adding the Helm repository
+CHART_VERSION=$(helm show chart oci://ghcr.io/simstudioai/charts/sim | awk '/^version:/ {print $2}')
+SIM_RELEASE=$(helm show chart oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION" | awk '/^appVersion:/ {print $2}')
+echo "chart $CHART_VERSION installs Sim $SIM_RELEASE"
```
-Inspect a version's configuration with `helm show values oci://ghcr.io/simstudioai/charts/sim --version `.
+Leave the `image.tag` of app, realtime, and migrations unset so all three follow the chart's `appVersion` together. `crane ls ghcr.io/simstudioai/charts/sim` lists every published version, and `helm show values oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION"` prints every value with its comment.
-## Prerequisites
+## 2. Choose where secrets live [#secret-stores]
-- A maintained Kubernetes cluster. The chart's declared compatibility minimum is 1.25.
-- Helm 3.8 or later for OCI installation.
-- A default StorageClass supporting `ReadWriteOnce` for bundled PostgreSQL.
-- An installed ingress controller if you enable ingress, plus a certificate for public TLS.
-- `metrics-server` if you enable autoscaling.
-- External Secrets Operator and a configured SecretStore/ClusterSecretStore if you choose that secret strategy.
+| Strategy | Configure | Behavior |
+| --- | --- | --- |
+| Inline | Secrets under `app.env` or `--set` | The chart writes them to a Secret. They also land in Helm release data, shell history, and `helm get values`. Evaluation only. |
+| Existing Secret | `app.secrets.existingSecret.enabled: true` and `.name` | You create one Secret holding every key under its standard name; it is loaded whole, with no key remapping. A missing key is silently empty at runtime, and a non-empty `app.env` value is inlined on the pod and shadows the Secret. |
+| External Secrets Operator | `externalSecrets.enabled: true`, `secretStoreRef`, and `remoteRefs.app.` | ESO creates the Secret from your secret manager. The chart refuses to render when a non-empty `app.env` key has no remote reference, so put non-secret values in `app.envDefaults`. Recommended for production. |
-Sim requires Redis, and the chart bundles it by default. A non-empty `app.env.REDIS_URL` overrides its URL and suppresses the bundled Redis Deployment. With `redis.enabled=false` you must supply `REDIS_URL` for a managed instance (through `app.env`, `app.secrets.existingSecret`, or `externalSecrets.remoteRefs.app.REDIS_URL`); the chart fails to render otherwise. See [Redis](/platform/self-hosting/redis).
+The bundled PostgreSQL takes its password from `postgresql.auth.password`, or from `postgresql.auth.existingSecret` (key `POSTGRES_PASSWORD`), or from `externalSecrets.remoteRefs.postgresql.password`. Recreate pods after a Secret changes; running processes do not reread credentials. [Secret stores](#secret-store-examples) below has values for both non-inline modes.
-## Installation
+## 3. Choose the database [#external-database]
-### 1. Choose the secret strategy
+The bundled PostgreSQL runs on one 10 GiB `ReadWriteOnce` volume. For production, use a managed PostgreSQL with the `vector` extension (see [Managed PostgreSQL](/platform/self-hosting/reference-architectures#managed-postgresql)) and add to your values:
-| Strategy | Configuration |
-| --- | --- |
-| Inline values | The chart writes `app.env`/`realtime.env` into a shared Kubernetes Secret. Values are also stored in Helm release data; do not commit credentials to Git. |
-| Existing Secret | Set `app.secrets.existingSecret.enabled=true` and its `name`. Prepare every required key using the standard env names. There is no key remapping. |
-| External Secrets Operator (ESO) | Set `externalSecrets.enabled=true` and map keys under `externalSecrets.remoteRefs.app`. ESO supplies the Secret; the chart does not create its inline app Secret. |
+```yaml
+postgresql:
+ enabled: false
+externalDatabase:
+ enabled: true
+ host: "your-db-host"
+ port: 5432
+ username: "sim"
+ password: "" # or externalDatabase.existingSecret, key EXTERNAL_DB_PASSWORD
+ database: "simstudio"
+ sslMode: "require"
+```
-In existing-Secret mode, non-empty `app.env` and `realtime.env` values are inlined into pod specs. Keep secret material in the pre-created Secret. In ESO mode, every non-empty key under those env maps must also have a remote reference; the chart rejects missing mappings. Put non-secret URL/configuration values in `envDefaults` instead.
+Decide before installing: switching later means migrating the data. An inline password must use only letters, digits, `.`, `_`, or `-`. If anything pools connections in front of the database, also set a direct [migration URL](/platform/self-hosting/upgrades#migration-environment).
-### 2. Prepare new-install secrets
+## 4. Generate secrets
-The following installation uses inline values to demonstrate a local release. For an existing release, recover and retain its current values rather than generating replacements. For a secret-store installation, store the same required values there and use the [secret-store examples](#secret-stores).
+For a new installation only. For an existing release, reuse its values (`helm get values sim -n simstudio` for inline mode).
```bash
-# The newest published chart, resolved once; record it and reuse it for every later command
-CHART_VERSION=$(helm show chart oci://ghcr.io/simstudioai/charts/sim | awk '/^version:/ {print $2}')
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
-INTERNAL_API_SECRET=$(openssl rand -hex 32)
API_ENCRYPTION_KEY=$(openssl rand -hex 32)
+INTERNAL_API_SECRET=$(openssl rand -hex 32)
CRON_SECRET=$(openssl rand -hex 32)
POSTGRES_PASSWORD=$(openssl rand -hex 24)
```
-
- Save the secrets durably before installing. `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY` must be 64-character hex strings. Losing a key makes the values encrypted with it unreadable. Without `API_ENCRYPTION_KEY`, legacy Sim API keys can be stored in plain text; the app logs a warning when its key getter is called.
-
+Store them durably before installing; the encryption keys cannot be recovered. See [Secrets](/platform/self-hosting/security#secrets). The chart refuses to render without `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, and, while `cronjobs.enabled` is true (the default), `CRON_SECRET`.
-`CRON_SECRET` is required with the default `cronjobs.enabled=true`. The chart rejects an absent inline value. With an existing Secret, the key must be present there; with ESO, it must be mapped. Set `cronjobs.enabled=false` only if you intend to run no chart-scheduled jobs.
+## 5. Write your values [#key-configuration]
-### 3. Install the pinned chart
-
-```bash
-helm install sim oci://ghcr.io/simstudioai/charts/sim \
- --version "$CHART_VERSION" \
- --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
- --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
- --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
- --set app.env.API_ENCRYPTION_KEY="$API_ENCRYPTION_KEY" \
- --set app.env.CRON_SECRET="$CRON_SECRET" \
- --set postgresql.auth.password="$POSTGRES_PASSWORD" \
- --namespace simstudio --create-namespace
-```
-
-Ingress is disabled by default. For local access, forward the app and realtime ports in separate terminals:
-
-```bash
-kubectl port-forward deployment/sim-app 3000:3000 -n simstudio
-```
-
-```bash
-kubectl port-forward deployment/sim-realtime 3002:3002 -n simstudio
-```
-
-Open [http://localhost:3000](http://localhost:3000). For public access, complete the topology below and apply it with the same secrets or secret-store configuration.
-
-## Public access [#key-configuration]
-
-Configure a public app origin and TLS together; realtime is served on the app host under `/socket.io` by default. This same-host example belongs in `public-values.yaml`; replace the ingress class with your installed controller's class:
+Save as `my-values.yaml`, replacing the host and ingress class:
```yaml
app:
- image:
- tag: "v0.9.72"
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
-realtime:
- image:
- tag: "v0.9.72"
-
-migrations:
- image:
- tag: "v0.9.72"
-
-postgresql:
- persistence:
- size: 50Gi
-
ingress:
enabled: true
className: ""
@@ -119,55 +89,62 @@ ingress:
tls:
enabled: true
secretName: sim-tls
+
+postgresql:
+ persistence:
+ size: 50Gi
```
-The app and realtime consume shared app env values: `BETTER_AUTH_URL` follows `NEXT_PUBLIC_APP_URL`, and realtime always admits that origin (`realtime.env.ALLOWED_ORIGINS` is only for extra origins). With `ingress.realtime.host` empty, the chart routes `/socket.io` on the app host before the app's `/` path. Keep app, realtime, and migrations on the same image release.
+- `BETTER_AUTH_URL` follows `NEXT_PUBLIC_APP_URL`, and realtime always admits that origin. In existing-Secret mode the chart derives neither: set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` in the Secret or `app.env`.
+- Realtime is served on the app host under `/socket.io`. For a separate realtime host, set `ingress.realtime.host`; the chart points the app at it with `NEXT_PUBLIC_SOCKET_URL` (in existing-Secret mode, set that yourself). Cover both hosts with the certificate.
+- The `null` removes the chart's default ingress-nginx annotation. Configure your controller's own HTTPS redirect, body size, WebSocket, timeout, and streaming settings; see [Networking](/platform/self-hosting/networking).
+- Add [object storage](/platform/self-hosting/object-storage), [email](/platform/self-hosting/email), and model provider keys through the same secret strategy. The chart refuses more than one app replica without object storage.
-Create `sim-tls` in `simstudio` from your certificate and private key, or configure your certificate manager to populate that Secret:
+Create the namespace and the TLS Secret, or let your certificate manager populate `sim-tls`:
```bash
-kubectl create secret tls sim-tls -n simstudio \
- --cert=fullchain.pem --key=privkey.pem
+kubectl create namespace simstudio
+kubectl create secret tls sim-tls -n simstudio --cert=fullchain.pem --key=privkey.pem
```
-For a fresh public installation, create the namespace before creating the Secret. Configure DNS and the controller's own HTTPS redirect, upload-size, WebSocket, timeout, and streaming settings. The `null` above removes the chart's legacy nginx redirect annotation; it does not configure another controller.
-
-A separate realtime hostname is optional. Set it, and the chart points the app at it through `NEXT_PUBLIC_SOCKET_URL` (unless you set that yourself, which you must in `app.secrets.existingSecret` mode):
+## 6. Install
-```yaml
-ingress:
- realtime:
- host: sim-ws.yourdomain.com
- paths:
- - path: /
- pathType: Prefix
+```bash
+helm install sim oci://ghcr.io/simstudioai/charts/sim \
+ --version "$CHART_VERSION" \
+ --namespace simstudio \
+ --values my-values.yaml \
+ --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
+ --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
+ --set app.env.API_ENCRYPTION_KEY="$API_ENCRYPTION_KEY" \
+ --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
+ --set app.env.CRON_SECRET="$CRON_SECRET" \
+ --set postgresql.auth.password="$POSTGRES_PASSWORD"
```
-Use a TLS certificate covering both hosts. App/auth URLs remain on `sim.yourdomain.com`.
+With an existing Secret or External Secrets, drop the `--set` lines. Render first with `helm template` and the same arguments to review what will be applied.
-Apply your complete values with `helm upgrade --install`, retaining the same secrets as installation. For inline mode, repeat the secret `--set` arguments from the install command and add `-f public-values.yaml`. For secret-store mode, use a complete values file defining that strategy.
+For a trial without ingress, install with `app.env.NEXT_PUBLIC_APP_URL=http://localhost:3000` and `ingress.enabled=false` in place of the public values, then forward both services and open [http://localhost:3000](http://localhost:3000):
-## Ingress and TLS
-
-The chart defaults still name `nginx` and its annotations. Kubernetes ingress-nginx retired in March 2026 and no longer receives security fixes. Use a maintained controller supported by your cluster; the chart renders Ingress objects and does not provision a controller or Gateway API resources. See the [Kubernetes retirement announcement](https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/).
+```bash
+kubectl port-forward -n simstudio deployment/sim-app 3000:3000 &
+kubectl port-forward -n simstudio deployment/sim-realtime 3002:3002
+```
-For an existing legacy ingress-nginx deployment, these settings describe the required body-size and streaming behavior:
+## Verify the release
-```yaml
-ingress:
- annotations:
- nginx.ingress.kubernetes.io/proxy-body-size: "250m"
- nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
- nginx.ingress.kubernetes.io/proxy-buffering: "off"
+```bash
+kubectl get pods -n simstudio
+kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
+kubectl get cronjobs -n simstudio
+curl -fsS https://sim.yourdomain.com/api/health
```
-These annotations do not apply to other controllers. On GKE, configure a `BackendConfig` timeout for long-lived WebSockets and create the `ManagedCertificate` referenced by the values. See [Networking](/platform/self-hosting/networking).
-
-## Secret stores
+Run `helm test sim -n simstudio --logs`, then [Verify your install](/platform/self-hosting/verify).
-### Existing Secret
+## Secret store examples [#secret-store-examples]
-Prepare an app Secret containing at least `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, `API_ENCRYPTION_KEY`, and `CRON_SECRET`, plus any provider credentials you use. For bundled PostgreSQL, prepare its password Secret too:
+**Existing Secret.** Create `sim-app-secrets` with `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `API_ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, `CRON_SECRET`, `NEXT_PUBLIC_APP_URL`, `BETTER_AUTH_URL`, and every provider credential you use, then:
```yaml
app:
@@ -180,29 +157,19 @@ postgresql:
existingSecret:
enabled: true
name: sim-postgresql-secret
- passwordKey: POSTGRES_PASSWORD
```
-Use the public URL configuration above without putting credentials under `app.env`. Both Deployments consume the app Secret. See the [complete existing-Secret example](https://github.com/simstudioai/sim/blob/v0.9.72/helm/sim/examples/values-existing-secret.yaml).
-
-### External Secrets Operator
-
-Populate the remote keys and create the referenced store before installing. For a same-host public installation, move URL values from `app.env` and `realtime.env` into these `envDefaults` maps, then add the ingress/TLS configuration above:
+**External Secrets Operator.** Create the store and remote keys first. Non-secret values go in `envDefaults`:
```yaml
app:
envDefaults:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
- BETTER_AUTH_URL: "https://sim.yourdomain.com"
- NEXT_PUBLIC_SOCKET_URL: "https://sim.yourdomain.com"
realtime:
envDefaults:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
- BETTER_AUTH_URL: "https://sim.yourdomain.com"
- ALLOWED_ORIGINS: "https://sim.yourdomain.com"
externalSecrets:
enabled: true
- apiVersion: "v1"
secretStoreRef:
name: sim-secret-store
kind: ClusterSecretStore
@@ -210,143 +177,51 @@ externalSecrets:
app:
BETTER_AUTH_SECRET: "sim/app/better-auth-secret"
ENCRYPTION_KEY: "sim/app/encryption-key"
- INTERNAL_API_SECRET: "sim/app/internal-api-secret"
API_ENCRYPTION_KEY: "sim/app/api-encryption-key"
+ INTERNAL_API_SECRET: "sim/app/internal-api-secret"
CRON_SECRET: "sim/app/cron-secret"
postgresql:
password: "sim/postgresql/password"
```
-Map additional credentials, such as `RESEND_API_KEY`, under `remoteRefs.app`. Remote value changes do not themselves restart processes; recreate the affected pods after credentials change. See the [complete ESO example](https://github.com/simstudioai/sim/blob/v0.9.72/helm/sim/examples/values-external-secrets.yaml).
+The chart repository has complete `values-existing-secret.yaml` and `values-external-secrets.yaml` examples under `helm/sim/examples/` at each `helm-chart-` tag.
-Configure model provider keys, such as `OPENAI_API_KEY`, through the same selected secret strategy. A healthy release does not establish that a model provider is configured.
+## Cloud example values
-## Cloud-specific values
-
-Use a cloud example as a starting file, not a complete install configuration. Fetch it from the release corresponding to the pinned chart example:
+`values-aws.yaml` (EKS), `values-azure.yaml` (AKS), and `values-gcp.yaml` (GKE) are starting points, not complete configurations. Fetch the one matching your chart and review every provider field before merging it into your values:
```bash
curl -fsSLO "https://raw.githubusercontent.com/simstudioai/sim/helm-chart-${CHART_VERSION}/helm/sim/examples/values-aws.yaml"
```
-Choose `values-aws.yaml` for EKS, `values-azure.yaml` for AKS, or `values-gcp.yaml` for GKE. Review and replace provider-specific fields before installation:
-
-| Example | Required review |
-| --- | --- |
-| AWS | StorageClass, region/buckets, IAM role ARN, ACM certificate ARN, ALB controller, and network policy. |
-| Azure | StorageClass, Blob account/containers/credentials, certificate issuer, and legacy ingress-nginx settings. |
-| GCP | Project/buckets, Workload Identity, static IP, ManagedCertificate, backend timeout, and network policy. |
-
-Each file also has six placeholder public-address values. In inline mode, reuse your saved secrets and override those addresses together:
-
-```bash
-helm upgrade --install sim oci://ghcr.io/simstudioai/charts/sim \
- --version "$CHART_VERSION" \
- --values values-aws.yaml \
- --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
- --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
- --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
- --set app.env.API_ENCRYPTION_KEY="$API_ENCRYPTION_KEY" \
- --set app.env.CRON_SECRET="$CRON_SECRET" \
- --set postgresql.auth.password="$POSTGRES_PASSWORD" \
- --set app.env.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
- --set app.env.BETTER_AUTH_URL="https://sim.yourdomain.com" \
- --set app.env.NEXT_PUBLIC_SOCKET_URL="https://sim-ws.yourdomain.com" \
- --set realtime.env.ALLOWED_ORIGINS="https://sim.yourdomain.com" \
- --set ingress.app.host="sim.yourdomain.com" \
- --set ingress.realtime.host="sim-ws.yourdomain.com" \
- --namespace simstudio --create-namespace
-```
-
-Replace the file name for another cloud and keep your reviewed file in your configuration repository. With ESO, use its env/default and remote-reference rules rather than the inline-secret arguments.
-
-
- When converting an existing generic release, retain its original encryption secrets and database name. The generic chart initializes database `sim`; cloud examples use `simstudio`, and changing the value does not rename an existing database. Add `--set postgresql.auth.database=sim` when retaining that database. `helm uninstall` does not delete StatefulSet PVCs; deleting them to start fresh erases the stored data.
-
-
-For an inline installation, `helm get values sim -n simstudio` can recover saved values. For external secret modes, use the existing secret store. Do not generate new encryption keys during conversion.
-
-## Code sandboxes
-
-Python, Shell, imported JavaScript, and Pi need a remote sandbox provider. On Helm, `sandbox.kubernetes.enabled: true` runs those sandboxes as pods in a dedicated namespace of the same cluster, under a microVM or gVisor RuntimeClass, instead of E2B or Daytona. See [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party) for the runtime each cloud needs and what the chart creates.
-
-## Verify the release
-
-```bash
-kubectl get pods -n simstudio
-kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
-kubectl get cronjobs -n simstudio
-curl -fsS https://sim.yourdomain.com/api/health
-```
+[Reference architectures](/platform/self-hosting/reference-architectures) lists what each example expects you to have created.
-Scheduled jobs cover workflows, polling triggers, connector syncs, token cleanup, data drains, and outbox processing. Inspect failed job pods and endpoint responses.
+## Ingress controllers
-Run `helm test sim -n simstudio --logs` to prove the install works: it checks the database and its migrations, Redis, realtime, and, with the Kubernetes sandbox provider, that sandboxes run user code confined. Then run [Verify your install](/platform/self-hosting/verify).
+The chart renders Ingress objects; it does not install a controller or Gateway API resources. Its defaults still name ingress-nginx, which [retired in March 2026](https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/). Use a maintained controller and set its class in `ingress.className`. [Networking](/platform/self-hosting/networking) covers the body-size, timeout, and streaming settings each controller needs, including ALB and GKE.
-## Verify the chart [#verifying-the-chart]
+## Air-gapped installs
-Published charts have Sigstore keyless signatures and build-provenance attestations in the source registry. Use cosign 3.0 or later for the bundle format; 3.1+ auto-detects old and new formats:
+Mirror the chart and every image it can render:
```bash
-cosign verify "ghcr.io/simstudioai/charts/sim:$CHART_VERSION" \
- --certificate-identity-regexp '^https://github.com/simstudioai/sim/' \
- --certificate-oidc-issuer https://token.actions.githubusercontent.com
-
-gh attestation verify "oci://ghcr.io/simstudioai/charts/sim:$CHART_VERSION" --repo simstudioai/sim
+helm pull oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION"
+helm push "sim-${CHART_VERSION}.tgz" oci://registry.internal.example.com/charts
+tar -xzOf "sim-${CHART_VERSION}.tgz" sim/images.yaml > images.yaml
+yq -r '.images[] | .source + " " + .mirror' images.yaml |
+ while read -r source mirror; do crane copy "$source" "registry.internal.example.com/${mirror}"; done
```
-There is no GPG `.prov` file; `helm install --verify` does not verify these signatures. When mirroring charts, copy the associated signature and attestation artifacts as well as the chart. A chart-only copy does not preserve verification material.
-
-## External database
+Use the `images.yaml` packaged in the chart you install: it also lists the sandbox images its release runs. Skip the `simstudioai/copilot*` images unless you run the Mothership; they pull from Docker Hub with the registry token Sim issues, and their `main-REPLACE` tag becomes the `main-` tag from its release notes, and the `simstudioai/sandbox-*` and `pause` images unless you use Kubernetes sandboxes. Then set `global.imageRegistry: registry.internal.example.com` and `global.useRegistryForAllImages: true`, and pin each image's `digest` to what your mirror resolved. Copy the chart's signature and attestation too if you [verify charts](/platform/self-hosting/security#verify-the-chart).
-Configure a database with pgvector and the required migration permissions. The chart constructs the shared app/realtime/migration DSN from:
-
-```yaml
-postgresql:
- enabled: false
-externalDatabase:
- enabled: true
- host: "your-db-host"
- port: 5432
- username: "postgres"
- password: "your-password"
- database: "simstudio"
- sslMode: "require"
-```
+## Code sandboxes
-Replace the credentials or supply the chart's external-database Secret strategy. Inline passwords must use letters, digits, `.`, `_`, or `-` to pass chart DSN validation. See [Cloud platforms](/platform/self-hosting/platforms#managed-postgresql) and [Upgrades](/platform/self-hosting/upgrades) for extensions and direct migration connections.
+`sandbox.kubernetes.enabled: true` runs Python, Shell, imported JavaScript, and Pi in sandbox pods on this cluster under a microVM or gVisor RuntimeClass, instead of E2B or Daytona. See [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party).
## Helm repository
-For tooling that requires a classic repository:
-
-```bash
-helm repo add sim https://charts.sim.ai
-helm repo update
-```
-
-Use `sim/sim` in place of the OCI URL in the install/upgrade command, preserving the version, complete values, namespace, and secret configuration. Signature/provenance verification above applies to the OCI artifact.
-
-## Operator commands [#commands]
-
-Upgrade with the full configuration and an explicitly chosen chart version:
-
-```bash
-helm upgrade sim oci://ghcr.io/simstudioai/charts/sim \
- --version "$CHART_VERSION" --namespace simstudio --values values.yaml
-```
-
-Retain the original secrets. See [Upgrades](/platform/self-hosting/upgrades) before changing the target version.
-
-Uninstall removes the release but leaves PostgreSQL StatefulSet PVCs:
-
-```bash
-helm uninstall sim --namespace simstudio
-```
+For tooling that needs a classic repository, `helm repo add sim https://charts.sim.ai` and use `sim/sim` in place of the OCI reference with the same version and values. Chart signatures are attached to the OCI artifact only.
-## Related docs
+## Upgrade and uninstall [#commands]
-- [Environment variables](/platform/self-hosting/environment-variables)
-- [Object storage](/platform/self-hosting/object-storage)
-- [Sandboxes](/platform/self-hosting/sandboxes)
-- [Scaling and high availability](/platform/self-hosting/scaling)
+Upgrade with your full values and an explicit chart version; read [Upgrades](/platform/self-hosting/upgrades) first. `helm uninstall sim -n simstudio` removes the release but keeps the PostgreSQL PVCs; deleting them erases the data.
diff --git a/apps/docs/content/docs/platform/self-hosting/local-models.mdx b/apps/docs/content/docs/platform/self-hosting/local-models.mdx
new file mode 100644
index 00000000000..def6c3c4abe
--- /dev/null
+++ b/apps/docs/content/docs/platform/self-hosting/local-models.mdx
@@ -0,0 +1,77 @@
+---
+title: Local models
+description: Run Agent blocks and embeddings on Ollama, LM Studio, vLLM, or LiteLLM
+---
+
+import { Callout } from '@/components/ui/callout'
+
+Point Sim at a model server you run. Set these on the app, then recreate it; models appear in the model picker.
+
+| Server | Variables | Models appear as |
+| --- | --- | --- |
+| Ollama | `OLLAMA_URL` | `ollama/` |
+| vLLM or LM Studio | `VLLM_BASE_URL`, optional `VLLM_API_KEY` | `vllm/` |
+| LiteLLM | `LITELLM_BASE_URL`, optional `LITELLM_API_KEY` | Models the proxy serves |
+
+`VLLM_BASE_URL` accepts the server root or its `/v1` URL. Knowledge bases can embed on Ollama too; see [Knowledge bases](/platform/self-hosting/environment-variables#knowledge-bases).
+
+
+ Inside a container, `localhost` is the container itself. Use `host.docker.internal` for a server on the Docker host: the Compose files map it to the host on every platform.
+
+
+## Ollama on the Docker host
+
+Save the address in `.env` beside `docker-compose.prod.yml`, then recreate the app:
+
+```bash
+OLLAMA_URL=http://host.docker.internal:11434
+```
+
+Ollama must listen where the container reaches the host. On Linux, bind it to the Docker bridge address, usually `OLLAMA_HOST=172.17.0.1:11434` (check with `ip -4 addr show docker0`). Its API has no authentication, so bind `0.0.0.0` only behind a firewall that blocks port 11434 from outside the host.
+
+## Ollama in the Compose stack
+
+`docker-compose.ollama.yml` adds an Ollama server to the production stack, reachable only inside the Compose network as `ollama:11434`. Add the address to `.env` first; the overlay refuses to start without it:
+
+```bash
+OLLAMA_URL=http://ollama:11434
+```
+
+Start the stack with one server profile, then pull the starter model, `gemma3:4b`:
+
+```bash
+# NVIDIA GPU (requires the NVIDIA Container Toolkit); use --profile cpu without a GPU
+docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu up -d
+docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile setup run --rm model-setup
+```
+
+Pull other models inside the server's container, `ollama` for the GPU profile or `ollama-cpu` for the CPU profile:
+
+```bash
+docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile gpu exec ollama ollama pull llama3.2
+```
+
+Set `COMPOSE_FILE=docker-compose.prod.yml:docker-compose.ollama.yml` and `COMPOSE_PROFILES=gpu` (or `cpu`) in `.env` so plain `docker compose` commands and `npx sim-setup update` include Ollama.
+
+## Ollama on Kubernetes
+
+Set `ollama.enabled: true` in the Helm values to deploy Ollama in the release; the chart points `OLLAMA_URL` at it. `ollama.gpu.enabled: true` adds GPU scheduling and the NVIDIA device plugin. The cloud example values carry GPU tolerations for it.
+
+## LM Studio
+
+Start [LM Studio's local server](https://lmstudio.ai/docs/developer/core/server), load a model, enable **Serve on Local Network**, and [turn on API authentication](https://lmstudio.ai/docs/developer/core/authentication). Then set:
+
+```bash
+VLLM_BASE_URL=http://host.docker.internal:1234
+VLLM_API_KEY=
+```
+
+Select the discovered `vllm/` entry in the model picker. A raw model ID typed by hand while the server is unreachable is treated as an Ollama model.
+
+## Check the connection
+
+```bash
+docker compose -f docker-compose.prod.yml exec simstudio printenv OLLAMA_URL VLLM_BASE_URL
+```
+
+Each variable the container received prints one line. A missing line means it never reached the container: confirm it is in `.env` and recreate the app with `docker compose -f docker-compose.prod.yml up -d`.
diff --git a/apps/docs/content/docs/platform/self-hosting/meta.json b/apps/docs/content/docs/platform/self-hosting/meta.json
index 1aa182f8433..e32115cf5c0 100644
--- a/apps/docs/content/docs/platform/self-hosting/meta.json
+++ b/apps/docs/content/docs/platform/self-hosting/meta.json
@@ -3,10 +3,11 @@
"pages": [
"architecture",
"---Install---",
- "reference-architectures",
"docker",
"kubernetes",
- "platforms",
+ "reference-architectures",
+ "local-models",
+ "verify",
"---Configure---",
"environment-variables",
"authentication",
@@ -19,7 +20,6 @@
"background-jobs",
"networking",
"security",
- "verify",
"desktop",
"---Operate---",
"observability",
diff --git a/apps/docs/content/docs/platform/self-hosting/observability.mdx b/apps/docs/content/docs/platform/self-hosting/observability.mdx
index 233bbee7418..b2beda102ce 100644
--- a/apps/docs/content/docs/platform/self-hosting/observability.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/observability.mdx
@@ -120,7 +120,7 @@ Log records at or above `LOG_LEVEL` carry structured metadata, error messages, a
`OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` is **off by default**. Setting it to `true`, `1`, or `yes` enables Chat message capture, including prompts, assistant text, tool arguments, and previews. Treat it as an explicit content-sharing decision before enabling it.
-`NEXT_TELEMETRY_DISABLED=1` stops the server's OpenTelemetry SDK and disables browser collection on newly loaded pages. It does not affect Trigger.dev task telemetry, configured separately below. The **Settings → General → Privacy → Allow browser telemetry** toggle stops optional browser performance and error diagnostics, discards queued events, and remembers the choice. It does not stop server spans.
+`NEXT_TELEMETRY_DISABLED=1` stops the server's OpenTelemetry SDK and disables browser collection on newly loaded pages. The **Settings → General → Privacy → Allow browser telemetry** toggle stops optional browser performance and error diagnostics, discards queued events, and remembers the choice. It does not stop server spans.
## Tracing
@@ -155,20 +155,6 @@ The app does not read `OTEL_SERVICE_NAME`: server spans use the literal service
If you enable the chart's Jaeger export, point `telemetry.jaeger.endpoint` at Jaeger's **OTLP gRPC port (4317)** — the collector exports over OTLP.
-### Trigger.dev task telemetry
-
-`GRAFANA_OTLP_ENDPOINT`, `GRAFANA_OTLP_HEADERS`, and `GRAFANA_DEPLOYMENT_ENVIRONMENT` are read only by `apps/sim/trigger.config.ts`. They route **Trigger.dev background-task** telemetry to Grafana Cloud and have no effect on the app's own OTLP export — for that, use `OTEL_EXPORTER_OTLP_ENDPOINT` above.
-
-| Variable | Purpose |
-|---|---|
-| `GRAFANA_OTLP_ENDPOINT` | Grafana OTLP gateway base URL |
-| `GRAFANA_OTLP_HEADERS` | e.g. `Authorization=Basic ` |
-| `GRAFANA_DEPLOYMENT_ENVIRONMENT` | Deployment tier label |
-
-
- All three or none. Setting one or two throws at startup with a message naming them, so a partially configured worker will not boot.
-
-
## Related docs
- [Background jobs](/platform/self-hosting/background-jobs)
diff --git a/apps/docs/content/docs/platform/self-hosting/platforms.mdx b/apps/docs/content/docs/platform/self-hosting/platforms.mdx
deleted file mode 100644
index a2a3de22a40..00000000000
--- a/apps/docs/content/docs/platform/self-hosting/platforms.mdx
+++ /dev/null
@@ -1,64 +0,0 @@
----
-title: Cloud platforms
-description: Provider-specific requirements for Railway, a VPS, or managed Kubernetes
----
-
-import { Callout } from '@/components/ui/callout'
-
-Use [Docker](/platform/self-hosting/docker) for a single node or [Kubernetes](/platform/self-hosting/kubernetes) for a cluster. This page covers provider-specific prerequisites and configuration differences.
-
-## Railway
-
-The [Sim deployment template](https://railway.com/new/template/sim-studio) provides a starting installation. Review its current services and variables before using it for production:
-
-1. Confirm PostgreSQL has pgvector and that migrations complete.
-2. Confirm the app and realtime services share `BETTER_AUTH_SECRET` and `INTERNAL_API_SECRET`.
-3. Retain generated secrets, set `API_ENCRYPTION_KEY`, and configure durable storage.
-4. Configure your domain under **Settings → Networking**. Set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` to that app origin; match `NEXT_PUBLIC_SOCKET_URL` to the realtime endpoint.
-5. Add a model provider key such as `OPENAI_API_KEY` and configure email if needed.
-6. Confirm Redis and the scheduler rather than assuming the template includes them. Sim refuses to start without Redis, and the app and realtime services share one `REDIS_URL`.
-
-
- Railway Cron Jobs run no more often than every five minutes. They cannot reproduce Sim's bundled minute-level scheduler cadence. Use a continuously running Sim scheduler service or another scheduler supporting the schedules in [Background jobs](/platform/self-hosting/background-jobs). See [Railway's cron requirements](https://docs.railway.com/cron-jobs).
-
-
-## VPS
-
-Run Compose on a Linux server such as DigitalOcean, EC2, Azure VM, or Hetzner. Use the [resource examples](/platform/self-hosting#requirements) as a starting point, then size for your workload.
-
-Install Docker Engine and the Compose plugin using [Docker's instructions for your operating system](https://docs.docker.com/engine/install/). The shipped file requires Compose 2.24.0 or later. Docker's `get.docker.com` convenience script is intended for development; use its package installation instructions for production.
-
-Follow [Docker](/platform/self-hosting/docker) for secrets, durable uploads, service startup, and TLS.
-
-## Managed Kubernetes
-
-EKS, AKS, and GKE have example values files in the chart's source repository. They contain provider resources and placeholders you must review: storage classes, bucket names, workload identities, certificates, static addresses, and network policy.
-
-Use the pinned example in [Kubernetes](/platform/self-hosting/kubernetes), then follow [Networking](/platform/self-hosting/networking) for the provider's load balancer. GKE requires the referenced `ManagedCertificate` and an appropriate backend timeout for WebSockets. The AKS example retains legacy ingress-nginx settings; that controller retired in March 2026. Use a maintained controller already supported by your cluster and its own configuration.
-
-## Managed PostgreSQL
-
-An external database must support the `vector` extension and the migration permissions Sim needs. Availability does not mean the extension is enabled in your database.
-
-| Service | Setup |
-| --- | --- |
-| AWS RDS / Aurora PostgreSQL | Choose an engine version with pgvector support and enable `vector`. |
-| GCP Cloud SQL for PostgreSQL | Enable the supported `vector` extension. |
-| Azure Database for PostgreSQL Flexible Server | Allow `vector` in `azure.extensions`, then enable it in the database. |
-| Supabase / Neon | Enable `vector` in the database you use for Sim. |
-
-See [Cloud SQL extensions](https://docs.cloud.google.com/sql/docs/postgres/extensions), [Azure extension allowlisting](https://learn.microsoft.com/en-us/azure/postgresql/extensions/how-to-allow-extensions), and [Neon pgvector setup](https://neon.com/docs/extensions/pgvector) for provider requirements.
-
-An app or source checkout can use a connection string such as:
-
-```bash
-DATABASE_URL="postgresql://:@:5432/simstudio?sslmode=require"
-```
-
-For Helm, disable bundled PostgreSQL and configure [`externalDatabase`](/platform/self-hosting/kubernetes#external-database). Production Compose overrides `DATABASE_URL` with its bundled database connection; changing `.env` alone does not switch it. An operator-owned Compose configuration must give the same external DSN to the app, realtime, and migrations and adjust their bundled-database dependencies. See [Docker configuration](/platform/self-hosting/docker#production-setup).
-
-## Related docs
-
-- [Reference architectures](/platform/self-hosting/reference-architectures)
-- [Verify your install](/platform/self-hosting/verify)
-- [Database upgrades and backups](/platform/self-hosting/upgrades)
diff --git a/apps/docs/content/docs/platform/self-hosting/reference-architectures.mdx b/apps/docs/content/docs/platform/self-hosting/reference-architectures.mdx
index 43890ee6233..e165570133f 100644
--- a/apps/docs/content/docs/platform/self-hosting/reference-architectures.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/reference-architectures.mdx
@@ -1,203 +1,109 @@
---
title: Reference architectures
-description: What you provision and what the chart provisions, per cloud, before you run helm install
+description: What you provision on AWS, Azure, or GCP before installing the Helm chart
---
import { Tab, Tabs } from '@/components/ui/tabs'
import { Callout } from '@/components/ui/callout'
-Provision a Kubernetes cluster, durable database storage, object storage, networking, and secrets before installing Sim. The Helm chart installs application workloads on that infrastructure; it does not provision cloud resources.
+The Helm chart installs Sim's workloads; it does not create cloud resources. Provision the cluster, database, object storage, networking, and secrets first, then follow [Kubernetes](/platform/self-hosting/kubernetes). There is no official Terraform module: call the chart from your infrastructure code, for example with Terraform's `helm_release` and a pinned `version`.
-There is no official Terraform module or CloudFormation template. Call the chart from your infrastructure as code (IaC), for example with Terraform's `helm_release` or a Helm pipeline task.
-
-## The boundary
-
-The chart bundles PostgreSQL and Redis for evaluation. For production, decide how each stateful dependency is backed up, restored, and made available.
+## What the chart provides
| Component | Chart default | Production |
-|---|---|---|
-| App, realtime, migrations | Deployed | Deployed by the chart |
-| Scheduled jobs (CronJobs) | Deployed | Deployed by the chart |
-| PostgreSQL | Deployed in-cluster | **Replace** with managed Postgres — set `externalDatabase.*` and `postgresql.enabled: false` |
-| Redis | Deployed in-cluster | Replace with a managed cache, or keep the bundled one — it holds no committed data |
-| Object storage | None — local disk | **Required.** S3, Azure Blob, or GCS. Local disk is lost when a container is recreated and is not shared across replicas |
-| Ingress | Off | You install the controller; the chart renders the Ingress |
-| TLS certificates | Off | You provision them |
-| Remote sandbox | Off | Required for Python, Shell, and imported JavaScript — a provider **and** an immutable Function image. See [Sandboxes](/platform/self-hosting/sandboxes) |
-| Pi execution | Off | A separate image from the Function one, set with `E2B_PI_TEMPLATE_ID` (a template name, an alias, or an immutable `:` ref) or `DAYTONA_PI_SNAPSHOT_ID`. Unlike the Function base these are not format-validated, but execution still fails closed when unset |
-| PII redaction, Ollama, telemetry collector | Off | Optional, off unless you enable them |
-
-The bundled Postgres uses a 10 Gi `ReadWriteOnce` volume and is intended for evaluation. Moving to managed Postgres is the single most important production change.
+| --- | --- | --- |
+| App, realtime, migrations, scheduled jobs | Deployed | Deployed by the chart |
+| PostgreSQL | One in-cluster pod on a 10 GiB volume | Managed PostgreSQL with `vector`: `postgresql.enabled: false` and `externalDatabase.*` |
+| Redis | One in-cluster pod | A managed cache, or keep the bundled one; it holds no committed data |
+| Object storage | None (pod filesystem) | Required: S3, Azure Blob, or GCS. See [Object storage](/platform/self-hosting/object-storage) |
+| Ingress controller and TLS | None | You install the controller and provide the certificate |
+| Remote sandbox | Off | A provider and its images, for Python, Shell, imported JavaScript, and Pi. See [Sandboxes](/platform/self-hosting/sandboxes) |
- The AWS and GCP example values set `networkPolicy.enabled: true`, and the chart's default egress allows the bundled pods, DNS, and TCP 443 (minus the cloud metadata CIDRs). Moving Postgres or Redis outside the cluster without opening a path leaves them unreachable — add the rules to `networkPolicy.egress`, or set `networkPolicy.allowExternalEgress: true`, in the same change that points the app at the managed instance.
+ The AWS and GCP examples enable `networkPolicy`, whose egress allows only the bundled pods, DNS, and port 443. When you move PostgreSQL or Redis out of the cluster, add their ports to `networkPolicy.egress` (or set `networkPolicy.allowExternalEgress: true`) in the same change. See [NetworkPolicy](/platform/self-hosting/security#networkpolicy).
## Per-cloud requirements
+Each tab names the chart's example values file. Fetch it at your chart's `helm-chart-` tag as shown in [Cloud example values](/platform/self-hosting/kubernetes#cloud-example-values).
+
-Use `helm/sim/examples/values-aws.yaml` as a starting point. It configures EBS GP3 storage, ALB ingress with AWS Certificate Manager, IRSA-style ServiceAccount annotations, and GPU tolerations for Ollama. Ollama itself ships disabled, and its node selectors are present but commented out.
-
-**You provision**
-
-| Resource | Notes |
-|---|---|
-| EKS cluster | A supported cloud-provider Kubernetes release compatible with the chart's `>=1.25` minimum |
-| EBS CSI driver add-on | For a standard EKS cluster using the EBS CSI provisioner, install `aws-ebs-csi-driver` with the cluster name and region. Match the StorageClass provisioner to the cluster's storage mode |
-| gp3 StorageClass | The example selects `gp3`. Confirm that StorageClass exists and uses the provisioner installed in your cluster; create it or select an existing class before installing |
-| AWS Load Balancer Controller | Required for ALB ingress |
-| ACM certificate | ALB discovers it from the ingress hosts, or pin it with `alb.ingress.kubernetes.io/certificate-arn` |
-| RDS PostgreSQL | With the `vector` extension available. Reachable from the cluster subnets |
-| S3 buckets | One per file purpose — see [Object storage](/platform/self-hosting/object-storage) |
-| ElastiCache | Recommended for production; Sim requires Redis, and the bundled one is a supported alternative |
-
-
- ALB does not consume a Kubernetes TLS Secret directly. Supply an ACM certificate or a supported certificate-discovery configuration. A cert-manager-created Secret alone is not sufficient.
-
+`values-aws.yaml` configures gp3 storage, ALB ingress with ACM, IRSA ServiceAccount annotations, and GPU tolerations for the optional Ollama.
-**Identity.** Bind an IAM role to the ServiceAccount with IRSA rather than issuing static keys. The role needs S3 access to the buckets you configured; grant nothing else unless you have enabled a feature that needs it.
+| You provision | Notes |
+| --- | --- |
+| EKS cluster | Kubernetes 1.25 or later |
+| EBS CSI driver and a `gp3` StorageClass | The example selects `gp3`; confirm it exists with the installed provisioner |
+| AWS Load Balancer Controller | ALB ingress |
+| ACM certificate | ALB discovers it from the ingress hosts, or pin it with `alb.ingress.kubernetes.io/certificate-arn`. ALB cannot use a Kubernetes TLS Secret |
+| RDS or Aurora PostgreSQL | Reachable from the cluster subnets |
+| S3 buckets | One per file purpose |
+| ElastiCache | Optional; the bundled Redis also works |
-**Timeouts.** ALB's default idle timeout will cut long-running executions and websockets. See [Networking](/platform/self-hosting/networking) before you go live.
+**Identity.** Bind an IAM role to the ServiceAccount with IRSA. Grant it access to your buckets and to anything else you enable, such as Bedrock or SES. **Timeouts.** Raise the ALB idle timeout; see [Networking](/platform/self-hosting/networking#aws-alb-ingress). **Sandboxes.** EKS sandboxes run under Nitro Sandboxes; see [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party).
#### AWS GovCloud (US)
-Sim runs in `us-gov-west-1` and `us-gov-east-1` with the same chart. The differences from a commercial Region:
+The same chart runs in `us-gov-west-1` and `us-gov-east-1`. What changes:
-| Area | What changes |
-|---|---|
-| ARNs | Use the `aws-us-gov` partition in IAM policies, the IRSA role annotation, and `alb.ingress.kubernetes.io/certificate-arn`, for example `arn:aws-us-gov:s3:::myorg-sim-workspace-files/*` |
-| Region | Set `AWS_REGION`, `AWS_SES_REGION` (email), and `AWS_BEDROCK_REGION` (Agent blocks on Bedrock) to your GovCloud Region |
-| FIPS endpoints | Set `AWS_USE_FIPS_ENDPOINT=true` on the app. Every AWS SDK client in Sim then uses the Region's FIPS endpoint, including S3, SES, Bedrock, and the AWS integration blocks; a call to a service with no FIPS endpoint in its Region fails. A custom `S3_ENDPOINT` replaces the FIPS endpoint, so leave it unset |
-| Images | The chart pulls from GHCR and Docker Hub. To keep pulls inside GovCloud, mirror the images to ECR under the same repository paths and point the chart at it with `global.imageRegistry` and `global.useRegistryForAllImages: true` |
-| Telemetry | The chart leaves Sim's anonymous telemetry off. Keep `NEXT_TELEMETRY_DISABLED=1` if you override `app.env` |
-| Background jobs | Use the chart's CronJobs. Trigger.dev cloud and AWS Marketplace metering are not available in GovCloud; leave `TRIGGER_DEV_ENABLED` and `AWS_MARKETPLACE_PRODUCTS` unset |
+| Area | Change |
+| --- | --- |
+| ARNs | Use the `aws-us-gov` partition in IAM policies, the IRSA role annotation, and the ACM certificate ARN |
+| Region | Set `AWS_REGION`, `AWS_SES_REGION`, and `AWS_BEDROCK_REGION` to your GovCloud Region |
+| FIPS | Set `AWS_USE_FIPS_ENDPOINT=true`; every AWS client in Sim then uses FIPS endpoints, and a service without one in the Region fails. Leave `S3_ENDPOINT` unset, since it replaces the FIPS endpoint |
+| Images | Mirror them to ECR and set `global.imageRegistry` with `global.useRegistryForAllImages: true`; see [Air-gapped installs](/platform/self-hosting/kubernetes#air-gapped-installs) |
+| Not available | AWS Marketplace metering; leave `AWS_MARKETPLACE_PRODUCTS` unset |
-**Agent blocks on Bedrock.** With IRSA, give the role `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` (which also cover the Converse API) on the `us-gov` inference profiles and the models they route to. An Agent block that leaves **AWS Region** empty calls Bedrock in `AWS_BEDROCK_REGION`. Claude models resolve to their `us-gov.` inference profiles, the only profiles GovCloud serves. Enable access to each Claude model first in the commercial account linked to your GovCloud account (in `us-east-1` or `us-west-2`), then on the **Model access** page of the Bedrock console in the GovCloud account's `us-gov-west-1` Region.
+**Bedrock.** Give the IRSA role `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on the `us-gov` inference profiles and the models they route to. Claude models resolve to their `us-gov.` profiles. Enable model access in the linked commercial account first, then on the Bedrock **Model access** page in `us-gov-west-1`.
-**Chat.** Run the mothership in the cluster with the chart's `copilot` values and route its models to Bedrock in the same Region. Its runtime license still needs outbound HTTPS to `www.license.copilot.sim.ai`; model inference stays in GovCloud. The mothership installation guide ships with its release bundle.
+**Chat.** Run the Mothership in the cluster with the chart's `copilot` values and route its models to Bedrock in the same Region. Its license check still needs outbound HTTPS to `www.license.copilot.sim.ai`; see [Chat service](/platform/self-hosting/chat).
-The Azure example provides `managed-csi` / `managed-csi-premium` storage, node targeting, and GPU tolerations. Its ingress-nginx configuration is legacy: that community controller [retired in March 2026](https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/). For a new deployment, configure a maintained ingress controller supported by your AKS environment; [Networking](/platform/self-hosting/networking) describes the required behavior.
+`values-azure.yaml` configures `managed-csi` storage, node targeting, and GPU tolerations. Its ingress-nginx settings are legacy; use a maintained controller and its own settings.
-**You provision**
+| You provision | Notes |
+| --- | --- |
+| AKS cluster | Kubernetes 1.25 or later |
+| Ingress controller and certificates | For a controller that reads TLS Secrets, cert-manager with a ClusterIssuer can issue them |
+| Azure Database for PostgreSQL Flexible Server | Allow `vector` in `azure.extensions` |
+| Blob Storage containers | One per file purpose |
+| Azure Managed Redis | Optional; choose a non-clustered or proxy configuration. Azure Cache for Redis is [retiring](https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/retirement-faq) |
+| GPU node pool | Only for Ollama; taint it `sku=gpu:NoSchedule` to match the example |
-| Resource | Notes |
-|---|---|
-| AKS cluster | A supported cloud-provider Kubernetes release compatible with the chart's `>=1.25` minimum |
-| Ingress controller | A maintained controller supported by your cluster; adapt the legacy example's annotations |
-| TLS certificate mechanism | Match your selected ingress controller. For one that consumes TLS Secrets, cert-manager with a ClusterIssuer can issue the Secret |
-| Azure Database for PostgreSQL | With `pgvector` enabled |
-| Azure Blob Storage containers | One per file purpose |
-| Managed Redis | Recommended for production (Sim requires Redis; the bundled one is a supported alternative); select a configuration compatible with Sim's single-endpoint clients. Existing Azure Cache for Redis deployments need [retirement/migration planning](https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/retirement-faq) |
-| GPU node pool | Only for Ollama. Taint it `sku=gpu:NoSchedule` to match the example tolerations |
-
-**Identity.** Azure Blob authenticates with a storage account key or connection string — Sim has no Azure workload-identity path for Blob. Keep the key out of `app.env` by supplying `AZURE_ACCOUNT_KEY` or `AZURE_CONNECTION_STRING` through `app.secrets.existingSecret` or External Secrets.
+**Identity.** Blob authenticates with an account key or connection string; Sim has no workload-identity path for Blob. Supply `AZURE_ACCOUNT_KEY` or `AZURE_CONNECTION_STRING` through an existing Secret or External Secrets. **Sandboxes.** AKS sandboxes run under Pod Sandboxing; see [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party).
-Use `helm/sim/examples/values-gcp.yaml` as a starting point. It configures Persistent Disk storage, Google Cloud Load Balancer with managed certificates, Workload Identity annotations, and GPU tolerations for Ollama. Ollama itself ships disabled, and the T4 node selectors are present but commented out.
-
-**You provision**
-
-| Resource | Notes |
-|---|---|
-| GKE cluster | A supported cloud-provider Kubernetes release compatible with the chart's `>=1.25` minimum |
-| Workload Identity | Must be enabled for the IAM-bound ServiceAccount |
-| Global static IP | Reserved before install. The example annotates `kubernetes.io/ingress.global-static-ip-name: simstudio-ip`; nothing in the chart creates it |
-| ManagedCertificate | Created before the first deploy — nothing in the chart creates it. The example values reference `simstudio-ssl-cert`; match whatever name your ingress annotation uses |
-| Cloud SQL for PostgreSQL | With `pgvector` |
-| GCS buckets | One per file purpose. Every purpose-specific bucket falls back to the general one |
-| Memorystore | Recommended for production; Sim requires Redis, and the bundled one is a supported alternative |
-
-
- When using only a ManagedCertificate, keep `ingress.tls.enabled: false` so the chart does not reference a missing Secret. GCE Ingress also supports provisioned TLS Secrets and can retain self-managed certificates while a managed certificate becomes active. If you enable chart TLS, create the referenced Secret. See [Google's certificate setup and migration guide](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/secure-traffic-management).
-
+`values-gcp.yaml` configures Persistent Disk storage, the Google Cloud load balancer with a managed certificate, Workload Identity annotations, and GPU tolerations.
-**Identity.** Workload Identity binds the ServiceAccount to a Google service account. Grant it object access to your buckets — and, because there is no private key in that mode, `roles/iam.serviceAccountTokenCreator` **on itself**, or signed upload and download URLs cannot be generated. Setting `GCS_CREDENTIALS_JSON` instead signs locally and needs no extra role. See [Object storage](/platform/self-hosting/object-storage).
+| You provision | Notes |
+| --- | --- |
+| GKE cluster | Kubernetes 1.25 or later, with Workload Identity enabled |
+| Global static IP | The example references `simstudio-ip`; the chart does not create it |
+| ManagedCertificate | The example references `simstudio-ssl-cert`; create it before the first deploy and keep `ingress.tls.enabled: false` |
+| Cloud SQL for PostgreSQL | Enable `vector` |
+| GCS buckets | One per file purpose; each falls back to the general bucket |
+| Memorystore | Optional; the bundled Redis also works |
-**Timeouts.** GCLB's default backend timeout closes websockets every 30 seconds. See [Networking](/platform/self-hosting/networking) for the `BackendConfig` fix.
+**Identity.** Grant the Google service account object access to the buckets and `roles/iam.serviceAccountTokenCreator` on itself, or signed upload URLs fail; see [Object storage](/platform/self-hosting/object-storage#set-up-google-cloud-storage). **Timeouts.** The load balancer closes WebSockets after 30 seconds by default; see [GKE](/platform/self-hosting/networking#gke-gce-ingress). **Sandboxes.** GKE sandboxes run under GKE Sandbox (gVisor); see [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party).
-## Secrets
-
-The chart offers three strategies. Pick one before you write any IaC, because it decides what your pipeline has to create.
-
-| Strategy | What your IaC creates | When |
-|---|---|---|
-| Inline (`app.env`, or `--set`) | Nothing | Evaluation. Values land in your values file, your shell history, and `helm get values` |
-| `app.secrets.existingSecret.enabled` + `.name` | A Kubernetes Secret carrying **every** key the app needs, under the standard key names — it is consumed wholesale via `envFrom`, so key remapping is not supported | You already manage secrets out of band |
-| External Secrets Operator | The operator itself, a `ClusterSecretStore` or `SecretStore` named in `externalSecrets.secretStoreRef.name`, entries in your cloud's secret manager, and `externalSecrets.remoteRefs.app.` mappings | Most production deployments |
-
-Non-inline modes handle missing keys differently:
-
-- **`existingSecret` fails quietly.** The chart renders no Secret of its own, so a key absent from yours and from `app.env` is simply empty at runtime. A key you also set in `app.env` is inlined onto the pod spec, where it shadows the Secret — so the Secret is not always the source of truth.
-- **External Secrets fails loudly.** The chart refuses to render when a key is set in `app.env` but not mapped, on the grounds that a silently empty secret is worse than a failed install.
-
-See [Security](/platform/self-hosting/security) for the full secret inventory, which keys are unrecoverable if lost, and what to back up.
-
-## Sizing
-
-| Component | Requests | Limits |
-|---|---|---|
-| app | 4 Gi / 1000m | 8 Gi / 2000m |
-| realtime | 512 Mi / 250m | 1 Gi / 500m |
-| PostgreSQL (bundled) | 1 Gi / 500m | 2 Gi (no CPU limit) |
-
-These are chart defaults, not capacity benchmarks. Measure memory, CPU, execution concurrency, and database connections with representative workloads. See [Scaling](/platform/self-hosting/scaling) for pool budgets and sizing estimates. A node must fit an app pod plus system overhead.
-
-## Calling the chart from Terraform
-
-If you already run Terraform, the chart is the resource to wrap — not something to reimplement. Point `repository` at the OCI registry and pin `version`; there is no need to vendor the repo.
-
-```hcl
-resource "helm_release" "sim" {
- name = "sim"
- namespace = "sim"
- create_namespace = true
-
- # Always pin `version`. Without it Terraform resolves the newest published
- # chart at apply time, which is how an unplanned apply moves Sim to a new
- # release with new migrations.
- repository = "oci://ghcr.io/simstudioai/charts"
- chart = "sim"
- version = "" # see the note below the example
-
- # Or the classic repository, if your tooling does not speak OCI:
- # repository = "https://charts.sim.ai"
-
- # Your own values file. The examples under helm/sim/examples/ carry
- # placeholder secrets and are starting points, not deployable as-is.
- values = [file("${path.module}/values-aws.yaml")]
-
- # helm provider v3 syntax. On v2 each of these is a set_sensitive { } block.
- set_sensitive = [
- { name = "app.env.BETTER_AUTH_SECRET", value = var.better_auth_secret },
- { name = "app.env.ENCRYPTION_KEY", value = var.encryption_key },
- { name = "app.env.API_ENCRYPTION_KEY", value = var.api_encryption_key },
- { name = "app.env.INTERNAL_API_SECRET", value = var.internal_api_secret },
- { name = "app.env.CRON_SECRET", value = var.cron_secret },
- # Only when the bundled Postgres is in use. With managed Postgres, set
- # externalDatabase.* and postgresql.enabled=false instead.
- { name = "postgresql.auth.password", value = var.postgres_password },
- ]
-}
-```
-
-
- The example values files leave every secret empty, and the chart refuses to install while a required secret is empty or still holds a placeholder such as `your-...` or `CHANGE-ME-...`. Examples from chart versions before `1.11.20` shipped literal placeholders that passed this check, so if you installed from one of them, rotate any secret you did not override.
-
+## Managed PostgreSQL
-Pin `version` above. Empty image tags use the selected chart's `appVersion`, so a pinned chart also selects that default app version. Explicit image tags or digests override it; pin them separately when you need that control, and keep app, realtime, and migrations aligned. To choose the version, `helm show chart oci://ghcr.io/simstudioai/charts/sim | grep -E '^(version|appVersion):'` prints the newest published chart and the app version it defaults to, and `crane ls ghcr.io/simstudioai/charts/sim` lists every published version. See [Upgrades](/platform/self-hosting/upgrades).
+The database must have the `vector` extension available and let the migration user create it. A provider supporting pgvector does not mean it is enabled in your database.
-## Related docs
+| Service | Setup |
+| --- | --- |
+| AWS RDS / Aurora PostgreSQL | Choose an engine version with pgvector and enable `vector` |
+| GCP Cloud SQL for PostgreSQL | Enable the [supported `vector` extension](https://docs.cloud.google.com/sql/docs/postgres/extensions) |
+| Azure Database for PostgreSQL Flexible Server | [Allow `vector`](https://learn.microsoft.com/en-us/azure/postgresql/extensions/how-to-allow-extensions) in `azure.extensions`, then enable it |
+| Supabase / Neon | Enable [`vector`](https://neon.com/docs/extensions/pgvector) in the database Sim uses |
-- [Install with Kubernetes](/platform/self-hosting/kubernetes)
-- [Pre-launch checklist](/platform/self-hosting/security#pre-launch-checklist)
-- [Verify your install](/platform/self-hosting/verify)
+Point Helm at it with [`externalDatabase`](/platform/self-hosting/kubernetes#external-database), or Compose with an [overlay](/platform/self-hosting/docker#external-postgresql-and-redis). Behind a transaction pooler such as PgBouncer, give migrations a direct URL; see [Migration environment](/platform/self-hosting/upgrades#migration-environment).
diff --git a/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx b/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx
index ab275611474..49b05f882a5 100644
--- a/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/sandboxes.mdx
@@ -146,7 +146,7 @@ On a Helm install, Sim can run sandboxes as pods in your own cluster. User code
### Quick start
-Two values turn it on: `sandbox.kubernetes.enabled` and the `runtimeClass.preset` for your platform. Everything else has a safe default. Leave `SANDBOX_PROVIDER`, the `E2B_*` and `DAYTONA_*` variables, and `TRIGGER_DEV_ENABLED` unset in `app.env`.
+Two values turn it on: `sandbox.kubernetes.enabled` and the `runtimeClass.preset` for your platform. Everything else has a safe default. Leave `SANDBOX_PROVIDER` and the `E2B_*` and `DAYTONA_*` variables unset in `app.env`.
@@ -258,7 +258,7 @@ sandbox:
effect: NoSchedule
```
-Leave `SANDBOX_PROVIDER`, `E2B_*`, `DAYTONA_*`, and `TRIGGER_DEV_ENABLED` unset in `app.env`: the chart sets `SANDBOX_PROVIDER=kubernetes`, and refuses `TRIGGER_DEV_ENABLED` because Trigger.dev workers cannot reach sandbox pods. Keep `cronjobs.enabled` and `cronjobs.jobs.cleanupSessionSandboxes.enabled` on, or idle session pods run until their 24-hour limit. For custom sandboxes on a billing-disabled deployment, also set `SANDBOXES_ENABLED=true` ([Enable sandbox access and controls](#enable-sandbox-access-and-controls)).
+Leave `SANDBOX_PROVIDER`, `E2B_*`, and `DAYTONA_*` unset in `app.env`: the chart sets `SANDBOX_PROVIDER=kubernetes`. Keep `cronjobs.enabled` and `cronjobs.jobs.cleanupSessionSandboxes.enabled` on, or idle session pods run until their 24-hour limit. For custom sandboxes on a billing-disabled deployment, also set `SANDBOXES_ENABLED=true` ([Enable sandbox access and controls](#enable-sandbox-access-and-controls)).
Installing needs cluster-scoped rights as well as rights in the release namespace: the chart creates a ClusterRole and ClusterRoleBinding, the sandbox Namespace (with `namespace.create: true`) and a RuntimeClass (with `runtimeClass.create: true`), the ValidatingAdmissionPolicy and its binding, and, with `warmCapacity.sandboxes` above 0, a PriorityClass.
@@ -332,7 +332,7 @@ What the policies cannot do:
Leave `sandbox.kubernetes.images.*` empty to use the images your Sim version names. `global.imageRegistry` applies to them as it does to the app images, and the chart passes it to the app as `SANDBOX_K8S_IMAGE_REGISTRY`. Set a `tag` or `digest` to pin an image; an image's own `registry` and `repository` apply once it has one, as for the app images.
-The agent, Function, and Pi images are public on GHCR, so pulling them needs no credentials. The exact tags your version runs are in `apps/sim/lib/execution/remote-sandbox/kubernetes/images.generated.json` at its release tag: `https://github.com/simstudioai/sim/blob//apps/sim/lib/execution/remote-sandbox/kubernetes/images.generated.json`, for example `v0.9.73`, the first release that includes them. The chart's `images.yaml` does not list them, because the app, not the chart, creates sandbox pods. For an air-gapped install, mirror each of those three references under the same path (`ghcr.io/simstudioai/sandbox-agent:` to `/simstudioai/sandbox-agent:`), and mirror again on every upgrade: a new Sim version may name new tags.
+The agent, Function, and Pi images are public on GHCR, so pulling them needs no credentials. The exact tags your version runs are in `apps/sim/lib/execution/remote-sandbox/kubernetes/images.generated.json` at its release tag: `https://github.com/simstudioai/sim/blob//apps/sim/lib/execution/remote-sandbox/kubernetes/images.generated.json`, for example `v0.9.73`, the first release that includes them. The `images.yaml` packaged in each published chart lists them too. For an air-gapped install, mirror them under the same path (`ghcr.io/simstudioai/sandbox-agent:` to `/simstudioai/sandbox-agent:`), as in [Air-gapped installs](/platform/self-hosting/kubernetes#air-gapped-installs), and mirror again on every upgrade: a new Sim version may name new tags.
Each image is signed with Sigstore keyless signing and carries a build-provenance attestation (and an SBOM per architecture), from a `staging` or `main` run of the `sandbox` workflow. Verify one before you mirror or run it:
diff --git a/apps/docs/content/docs/platform/self-hosting/scaling.mdx b/apps/docs/content/docs/platform/self-hosting/scaling.mdx
index ae04fbfe7ea..c5535591361 100644
--- a/apps/docs/content/docs/platform/self-hosting/scaling.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/scaling.mdx
@@ -9,11 +9,7 @@ Configure shared storage and database capacity, and size Redis, before adding re
## Prerequisites before scaling past one replica
-
- Every replica must reach the same Redis. Redis is required at any replica count, and it is what carries rate limits and live events across pods. If you disable or remove bundled Redis, supply a working `REDIS_URL` for app and realtime; see [Redis](/platform/self-hosting/redis).
-
-
-You also need shared object storage — local-disk storage is per-pod, so a file uploaded through one replica is invisible to the others. See [Object Storage](/platform/self-hosting/object-storage).
+Every replica must reach the same [Redis](/platform/self-hosting/redis), and uploads need shared [object storage](/platform/self-hosting/object-storage): local storage is per pod, and the chart refuses more than one app replica without it.
## What scales how
@@ -84,7 +80,6 @@ Each process can open more than one database pool. Budget the sum of active pool
|---|---|---|---|
| `web` | 10 | 4 | Main app pool |
| `realtime` | 5 | 3 | Realtime process |
-| `trigger` | 5 | 2 | Trigger.dev worker process |
| `exec` | 10 | 4 | Execution subpool profile; current `dbFor` client opens a primary pool |
| `cleanup` | 5 | 2 | Cleanup subpool profile; current `dbFor` client opens a primary pool |
| `search` | 5 | 0 | File-search subpool |
@@ -110,7 +105,6 @@ Reads fall back to the primary when unset. Per-role overrides exist if different
| `DATABASE_REPLICA_URL` | Default for all roles |
| `DATABASE_REPLICA_URL_WEB` | The web app |
| `DATABASE_REPLICA_URL_REALTIME` | The realtime service |
-| `DATABASE_REPLICA_URL_TRIGGER` | Trigger.dev workers |
Read replicas can lag. Recently written logs may briefly be absent from reads routed to a replica. Monitor replication lag and use the primary where immediate visibility is required.
@@ -128,7 +122,7 @@ Embeddings, logs, and table data grow with usage and retention, not just member
## Execution concurrency
-`SCHEDULE_EXECUTION_CONCURRENCY_LIMIT` (default `30`) bounds scheduled executions across the default database-backed queue. The other three `*_EXECUTION_CONCURRENCY_LIMIT` variables apply only to Trigger.dev and are inert on a default self-host — see [Background Jobs](/platform/self-hosting/background-jobs#concurrency).
+`SCHEDULE_EXECUTION_CONCURRENCY_LIMIT` (default `30`) bounds scheduled executions across the deployment; see [Environment variables](/platform/self-hosting/environment-variables#networking--limits).
Adding replicas does not multiply this shared cap. If the queue is full, consider raising it only with memory and database headroom. If memory is exhausted, reduce concurrency or add capacity before raising the limit.
diff --git a/apps/docs/content/docs/platform/self-hosting/security.mdx b/apps/docs/content/docs/platform/self-hosting/security.mdx
index 2e4aeafd043..04c6936ee4e 100644
--- a/apps/docs/content/docs/platform/self-hosting/security.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/security.mdx
@@ -9,9 +9,9 @@ Review access, secrets, networking, and code execution before exposing a self-ho
## Pre-launch checklist
-- All five secrets generated fresh, stored in a secret manager, and **`ENCRYPTION_KEY` backed up separately**
-- `BETTER_AUTH_SECRET` identical on app and realtime
-- Images pinned to an explicit tag or digest on app, realtime, and migrations
+- Every secret generated fresh, stored in a secret manager, and the encryption keys backed up separately
+- Installed from a chart example older than 1.11.20? Those shipped literal placeholder secrets that passed validation; rotate any you did not override
+- A pinned chart version or `SIM_VERSION`, so app, realtime, and migrations run one release
- TLS terminating at the ingress; HTTP redirected or disabled
- `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` set to the real public origin
- `AUTH_TRUSTED_PROXIES` set if behind a load balancer
@@ -27,31 +27,27 @@ Review access, secrets, networking, and code execution before exposing a self-ho
- Sandbox strategy and required immutable images configured for user code
- Stored PII policy and internal masking path verified if redaction is required
-## Restricting who can use the instance
+## Access and client IPs
-Signup allowlists and blocklists, social-login toggles, SSO, and the `DISABLE_AUTH` escape hatch are all covered in [Authentication](/platform/self-hosting/authentication). Restrict signup before exposing the instance, and never set `DISABLE_AUTH=true` behind an internet-facing ingress.
-
-## Client IP and forwarded headers
-
-Behind a load balancer, `X-Forwarded-For` is client-controllable. Set `AUTH_TRUSTED_PROXIES` to your proxies' actual addresses so Better Auth resolves the real client IP, and `TRUSTED_ORIGINS` if users reach Sim from more than one origin. Both are covered in [Authentication](/platform/self-hosting/authentication#behind-a-load-balancer).
+Restrict sign-up before exposing the instance, and never set `DISABLE_AUTH=true` behind a public ingress; see [Authentication](/platform/self-hosting/authentication). Behind a load balancer, set `AUTH_TRUSTED_PROXIES` to your proxies so a client cannot forge its IP through `X-Forwarded-For`; see [Behind a load balancer](/platform/self-hosting/authentication#behind-a-load-balancer).
## Secrets
-Five secrets drive the security of a deployment. Generate each with `openssl rand -hex 32`.
+Generate each secret with `openssl rand -hex 32` and keep it in a secret manager, with a recovery copy stored apart from database backups.
-| Secret | Protects | Rotatable |
+| Secret | Protects | Rotate |
|---|---|---|
-| `BETTER_AUTH_SECRET` | Session tokens | Yes — invalidates all sessions |
-| `ENCRYPTION_KEY` | Workspace env vars, stored provider keys, MCP OAuth credentials, connected-account OAuth tokens, deployment/chat secrets | **No** — see below |
-| `API_ENCRYPTION_KEY` | Encrypted stored API-key material when configured | Rotation needs re-encryption; existing hash-based authentication continues, but old encrypted material cannot be decrypted with a new key |
-| `INTERNAL_API_SECRET` | Service-to-service calls | Yes — roll app and realtime together |
-| `CRON_SECRET` | Background job endpoints | Yes — roll app and cron together |
+| `ENCRYPTION_KEY` | Workspace and personal environment variables, stored provider keys, MCP OAuth credentials, connected-account tokens, deployment and Chat secrets. Must be 64 hex characters | **Never.** There is no re-encryption procedure |
+| `API_ENCRYPTION_KEY` | Stored Sim API-key material. Without it, legacy API keys can be stored in plain text. Must be 64 hex characters | Not without re-encryption; stored material becomes unreadable |
+| `BETTER_AUTH_SECRET` | Sessions. Must be identical on the app and realtime | Signs everyone out |
+| `INTERNAL_API_SECRET` | Calls between the app, realtime, and a self-run Mothership | Roll all of them together |
+| `CRON_SECRET` | The background job endpoints | Roll the app and scheduler together |
- Changing `ENCRYPTION_KEY` without re-encrypting existing data makes that data unreadable until the original key is restored. Losing the original key makes the data unrecoverable. Back it up independently of the database.
+ A database backup is only readable with the `ENCRYPTION_KEY` and `API_ENCRYPTION_KEY` that encrypted it. Lose or change a key and every value it protected is unrecoverable: integrations and saved keys fail even though the app still loads and signs in. Back the keys up separately from the database, and never generate new ones for an existing installation.
-`BETTER_AUTH_SECRET` must be **identical** on the app and realtime services — they share sessions through the database, and a mismatch means realtime rejects every authenticated socket.
+On Helm, choose how secrets reach pods with the [secret strategy](/platform/self-hosting/kubernetes#secret-stores). A secret committed to a values file stays in Git history.
### Account token sealing
@@ -66,23 +62,18 @@ Sim seals the OAuth access and refresh tokens of connected accounts at rest with
Once tokens are sealed, do not roll back to a release older than v0.9.33. Those releases cannot read sealed tokens, so every connected account would have to be reconnected. Opting out does not unseal stored tokens.
-### Storing them
-
-Choose how to supply secrets:
-
-1. **`--set` on the command line** — dev only. Values appear in `helm get values` output and shell history.
-2. **A pre-created Kubernetes Secret** — set `app.secrets.existingSecret.enabled: true` and the secret name. Works with Sealed Secrets and SOPS. The secret is consumed wholesale and must use the standard key names.
-3. **External Secrets Operator** — sync from Vault, AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager. Recommended.
+## Verify the chart [#verify-the-chart]
-The delivery mode changes how values reach pods:
+Published charts carry Sigstore keyless signatures and build-provenance attestations in the registry. With cosign 3.0 or later:
-| Mode | Behavior |
-|---|---|
-| Default | `app.env` and `realtime.env` keys go into a chart-managed Secret consumed through `envFrom` |
-| External Secrets | The operator populates the app Secret from `externalSecrets.remoteRefs.app`; an unmapped non-empty `app.env` key fails rendering |
-| `existingSecret` | The pre-created Secret supplies values. Non-empty `app.env` overrides are inlined on the pod and shadow Secret values; supply secrets through the Secret in this mode |
+```bash
+cosign verify "ghcr.io/simstudioai/charts/sim:$CHART_VERSION" \
+ --certificate-identity-regexp '^https://github.com/simstudioai/sim/' \
+ --certificate-oidc-issuer https://token.actions.githubusercontent.com
+gh attestation verify "oci://ghcr.io/simstudioai/charts/sim:$CHART_VERSION" --repo simstudioai/sim
+```
-A secret committed to `values.yaml` remains in Git history.
+There is no GPG `.prov` file, so `helm install --verify` does not apply. When you mirror a chart, copy its signature and attestation too.
## Network boundaries
@@ -205,14 +196,7 @@ The Function block's Sandbox selector, Shell, and **Settings → Sandboxes** fol
With the default local sandbox, treat everyone who can author a workflow as someone running code in your app container's security context. If your Sim instance is open to a wide or partly-trusted audience, use a remote sandbox provider and enable the NetworkPolicy egress restrictions.
-Resource ceilings for the local-worker path:
-
-| Variable | Controls |
-|---|---|
-| `IVM_MAX_EXECUTIONS_PER_WORKER` | Executions before a worker is recycled |
-| `IVM_MAX_BROKERS_PER_EXECUTION` | Host-call brokers per execution |
-| `IVM_MAX_BROKER_ARGS_JSON_CHARS` | Max argument payload size |
-| `IVM_MAX_BROKER_RESULT_JSON_CHARS` | Max result payload size |
+Worker limits for local JavaScript (`IVM_*`) are in [Code execution](/platform/self-hosting/environment-variables#code-execution).
## The SSRF boundary
@@ -262,19 +246,10 @@ EGRESS_ALLOWED_HOSTS=host.docker.internal
An allowlist widens what every workflow author on the instance can reach. Name specific hosts and narrow ranges rather than whole private networks, and pair it with a NetworkPolicy that constrains what the app can actually reach. When `networkPolicy.enabled` is true the chart permits broad egress on port 443 only, so an allowlisted in-cluster target on another port also needs a `networkPolicy.egress` rule — or `networkPolicy.allowExternalEgress: true` for unrestricted egress.
-### Upgrading from an earlier release
-
-Review these compatibility cases when upgrading:
+### Content fetches and redirects
-- **`ALLOW_PRIVATE_DATABASE_HOSTS`** has been removed and no longer has any effect; the app logs an error at startup if it is still set. Name the specific database, cache, and mail hosts you use in `EGRESS_ALLOWED_HOSTS`. A host you reach by IP address needs a single-address entry in `EGRESS_ALLOWED_IP_RANGES` instead (for example `10.0.0.5/32`, or `fd00::5/128`); IPv6 literals in particular must go there, since `EGRESS_ALLOWED_HOSTS` rejects them. Do not allowlist whole private ranges in its place, since the allowlist also applies to workflow HTTP blocks and that would widen what every workflow author can reach, and do not allowlist `localhost`, where Sim's own database and Redis listen.
-- **1Password Connect** on a private, non-loopback address, and an **MCP server** on a private address or reached through a DNS name that points at loopback, are no longer reachable implicitly. Name them.
-- **`ALLOWED_MCP_DOMAINS`** governs which domains may be used; it no longer disables the address check, so an MCP server on a private address needs the allowlist too.
-- **Content fetches** — an image URL, a file imported by URL, an MCP OAuth endpoint on a different origin than the MCP server itself — never use the allowlist. Those destinations have to be publicly routable. (An SSO OIDC *discovery* URL is a configured endpoint and does use the allowlist; the endpoints named *inside* the discovery document are validated as content when Sim registers the provider, so an internal IdP endpoint is refused there and cannot be allowlisted — provide the endpoints explicitly to have them validated as configured endpoints instead.)
-- **Redirects** are re-judged at every hop under the request's own provenance. Four rules follow from that:
- - A hop landing on a blocked port is refused, and one downgrading to plain HTTP is refused for every provenance except the self-hosted-service and proxy classes, which expect it by design.
- - Only 301, 302, 303, 307 and 308 are followed. 300, 305 and 306 are not.
- - A cross-origin hop drops every header when the caller supplied no redirect policy, so no credential — `Authorization`, `Cookie`, or a custom one like `PRIVATE-TOKEN` — reaches the new origin. A caller that supplies a policy keeps its non-credential headers and drops the ones it marked sensitive.
- - A cross-origin hop that would carry a request body is refused rather than replayed. A body-preserving hop (307, 308, or any hop in a legacy-replay workflow) fails with a message saying so; a 301, 302 or 303 drops the body to a GET and continues.
+- **Content fetches** (an image URL, a file imported by URL, an MCP OAuth endpoint on another origin than its MCP server) never use the allowlist and must be publicly routable. An SSO OIDC discovery URL is a configured endpoint, but the endpoints inside the discovery document are validated as content; supply them explicitly to reach an internal identity provider.
+- **Redirects** are judged again at every hop. A hop to a blocked port is refused, and a downgrade to plain HTTP is refused except for self-hosted services and the proxy. Only 301, 302, 303, 307, and 308 are followed. A cross-origin hop drops credential headers, and a cross-origin hop that would replay a request body is refused.
### Response size cap
diff --git a/apps/docs/content/docs/platform/self-hosting/troubleshooting.mdx b/apps/docs/content/docs/platform/self-hosting/troubleshooting.mdx
index 4a65438307f..372a25d7266 100644
--- a/apps/docs/content/docs/platform/self-hosting/troubleshooting.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/troubleshooting.mdx
@@ -3,154 +3,48 @@ title: Troubleshooting
description: Diagnose deployment, network, storage, model, and scheduler failures
---
-Start with the checks for your deployment type, then follow the symptom below.
+On Compose, start with `npx sim-setup doctor` in the directory holding `.env`; it checks configuration and reachable services and `--fix` repairs what it safely can. See [Run doctor](/platform/self-hosting/verify#sim-setup-doctor). On Helm, start with the pod and migrations logs.
-## Run `sim-setup doctor`
+## The app does not start
-On a production or local-development Compose install (including one running the Ollama overlay), or a source checkout, run the built-in checker first. It checks configuration and common dependency failures. It reads env files, so it is not a Kubernetes tool — on Helm, skip to the checks below.
+**"`` is partially or incorrectly configured … Run npx sim-setup add ``."** Some variables for a feature (Email, File storage, Remote sandbox, Async jobs, PDF OCR, or Knowledge embeddings) are set and others are missing or malformed. The message names each provider and its missing or invalid variables.
-```bash
-npx sim-setup doctor
-npx sim-setup doctor --fix # repair what it safely can
-npx sim-setup doctor --json # machine-readable, for CI
-```
-
-On a standalone Compose install, run it from the directory holding your `.env` and Compose file. From a source checkout, run it there — it resolves the per-application env files itself and needs no root `.env`. It exits `1` when any check fails, so scripts can use the exit status. See [Verify Your Install](/platform/self-hosting/verify#sim-setup-doctor) for what each group of checks covers.
-
-## 502 Bad Gateway
-
-```bash
-# Check app is running — use the file that started your install
-docker compose -f docker-compose.prod.yml ps simstudio
-docker compose -f docker-compose.prod.yml logs simstudio
-
-# Common causes: out of memory, database not ready
-```
-
-## Database connection failed
-
-```bash
-# The file that started your install — no bare `docker compose` works, the
-# repo ships no default docker-compose.yml.
-COMPOSE_FILE=docker-compose.prod.yml
-
-# Check database is running
-docker compose -f "$COMPOSE_FILE" ps db
-
-# Test connection
-docker compose -f "$COMPOSE_FILE" exec db psql -U postgres -c "SELECT 1"
-```
-
-Verify `DATABASE_URL` format: `postgresql://user:pass@host:5432/database`
-
-## Migration errors
-
-Migrations run in their own `migrations` service and image — the app image does not contain the migration tooling.
-
-```bash
-# View migration logs
-docker compose -f docker-compose.prod.yml logs migrations
-
-# Re-run them
-docker compose -f docker-compose.prod.yml up --force-recreate migrations
-```
-
-On Kubernetes, migrations are an init container on the app pod:
-
-```bash
-kubectl logs -n simstudio deploy/sim-app -c migrations --tail=200
-```
-
-## pgvector not found
-
-Use the correct PostgreSQL image:
-```yaml
-image: pgvector/pgvector:pg17 # NOT postgres:17
-```
-
-## Kubernetes app pods never become ready
-
-Check the migrations init container first — a failed migration deliberately blocks the rollout:
-
-```bash
-kubectl logs -n simstudio deploy/sim-app -c migrations --tail=200
-kubectl describe pod -n simstudio ''
-```
-
-Common causes: `DATABASE_URL` unreachable, the database user lacking rights to create the `vector` extension, or an OOMKill from insufficient memory. See [Upgrades](/platform/self-hosting/upgrades) for migration-failure recovery.
-
-## Kubernetes `ImagePullBackOff`
-
-Either the tag does not exist in the registry (`helm get values sim` and check), or you are pulling from a private registry without `global.imagePullSecrets`. When mirroring into a private registry, set `global.useRegistryForAllImages: true` — otherwise third-party images still point at Docker Hub.
-
-## Kubernetes PostgreSQL pod pending
-
-```bash
-kubectl describe pvc -n simstudio
-```
-
-Common causes are no default StorageClass, no PV provisioner, or a StorageClass that does not support `ReadWriteOnce`. Set `global.storageClass` to pick a specific one.
-
-## Blank page after login
-
-1. Check browser console for errors
-2. Verify `NEXT_PUBLIC_APP_URL` matches your actual domain
-3. After collecting the error, try a fresh browser session to distinguish a stale session from a deployment failure
-4. Check that all services are running: `docker compose -f docker-compose.prod.yml ps`
-
-## WebSocket and realtime not working
-
-1. Verify reverse proxy routes `/socket.io` to the realtime service (default port 3002). `NEXT_PUBLIC_SOCKET_URL` is only needed if realtime is on a separate host.
-2. Verify realtime service is running: `docker compose -f docker-compose.prod.yml ps realtime`
-3. Ensure the proxy passes WebSocket upgrades (see [Networking](/platform/self-hosting/networking))
-
-## WebSockets disconnect every 30 seconds
+- **Compose:** run the printed `npx sim-setup add ` beside `.env`, or set or delete the named variables, then `docker compose -f docker-compose.prod.yml up -d`.
+- **Helm:** `sim-setup add` does not edit Helm values. Complete or remove the named variables where you set them (`app.env`, your existing Secret, or `externalSecrets.remoteRefs.app`) and run `helm upgrade`. On Helm, set a key to `null` to remove it; an empty string does not.
-The load balancer's backend timeout is closing them. On GKE, attach a `BackendConfig` with `timeoutSec: 3600` to the realtime Service; on AWS, raise the ALB `idle_timeout`. Clients may reconnect; repeated disconnects still interrupt collaboration. See [Networking](/platform/self-hosting/networking).
+**`REDIS_URL` is required.** The app and realtime refuse to start without a `redis://` or `rediss://` URL. Compose and Helm wire the bundled Redis; with `redis.enabled: false`, supply `REDIS_URL` through your secret strategy. For a `rediss://` URL with an IPv4 address, the app also needs `REDIS_TLS_SERVERNAME`; see [TLS to an IP address](/platform/self-hosting/redis#tls-to-an-ip-address).
-## Agent output arrives all at once
+**Migrations fail.** The app waits for them. Read `docker compose -f docker-compose.prod.yml logs migrations` or `kubectl logs -n simstudio deploy/sim-app -c migrations`, then see [When a migration fails](/platform/self-hosting/upgrades#when-a-migration-fails). `permission denied to create extension "vector"` means the database user cannot create pgvector; the bundled image is `pgvector/pgvector:pg17`, not `postgres`.
-Your reverse proxy is buffering the response stream. Set `proxy_buffering off` (Nginx) or `flush_interval -1` (Caddy). See [Networking](/platform/self-hosting/networking).
+**Compose: `required variable POSTGRES_PASSWORD is missing a value`.** Set the password the database volume was created with; installs created before it was required use `postgres`. See [Postgres on Compose](/platform/self-hosting/security#postgres-on-compose).
-## Collaboration breaks with multiple replicas
+**Kubernetes: `ImagePullBackOff` or a pending PostgreSQL pod.** Check that the image tag exists and that a private registry has `global.imagePullSecrets` (and `global.useRegistryForAllImages: true` for mirrors). For a pending database, `kubectl describe pvc -n simstudio`: there is no default StorageClass, no provisioner, or no `ReadWriteOnce` support; set `global.storageClass`.
-If members on different replicas do not see edits or live status, check that both services reach the same Redis:
+**502 Bad Gateway.** The app is not running or not ready. Check `docker compose -f docker-compose.prod.yml ps simstudio` and its logs for out-of-memory kills and database errors.
-```bash
-kubectl exec -n simstudio deploy/sim-app -- sh -c 'test -n "$REDIS_URL" && echo "REDIS_URL is set"'
-kubectl exec -n simstudio deploy/sim-realtime -- sh -c 'test -n "$REDIS_URL" && echo "REDIS_URL is set"'
-```
-
-Both pods must have `REDIS_URL`. On Helm they share one Secret, so setting it under `app.env` covers both. See [Redis](/platform/self-hosting/redis).
+## Sign-in fails or redirects to the wrong place
-## App refuses to start: REDIS_URL is required
+The browser's origin must equal `NEXT_PUBLIC_APP_URL`, including scheme and port, and `BETTER_AUTH_URL` must match it. Compose and Helm derive `BETTER_AUTH_URL` from `NEXT_PUBLIC_APP_URL`, except in Helm's existing-Secret mode. Add other origins users reach (apex and `www`, aliases) to `TRUSTED_ORIGINS`. Behind a TLS-terminating proxy, forward `X-Forwarded-Proto`, and set `AUTH_TRUSTED_PROXIES`. A blank page after sign-in usually means the same mismatch; read the browser console. Realtime rejects every socket when its `BETTER_AUTH_SECRET` differs from the app's.
-Redis is required. The app validates `REDIS_URL` at boot and exits when it is missing or is not a `redis://` or `rediss://` URL. Set it for both the app and realtime services: Compose wires the bundled `redis` service by default, and Helm deploys a bundled Redis unless `redis.enabled=false`, in which case supply `REDIS_URL` through `app.env`, your existing Secret, or External Secrets. See [Redis](/platform/self-hosting/redis).
+## Realtime and streaming
-## App crashes at startup with a REDIS_TLS_SERVERNAME error
+| Symptom | Fix |
+| --- | --- |
+| Socket never connects | Route `/socket.io` to realtime on port 3002 with WebSocket upgrades. A separate realtime host needs `NEXT_PUBLIC_SOCKET_URL`. See [Networking](/platform/self-hosting/networking). |
+| WebSockets drop every 30 seconds | The load balancer's backend timeout. On GKE attach a `BackendConfig`; on AWS raise the ALB idle timeout. |
+| Agent output arrives all at once | The proxy buffers responses: `proxy_buffering off` on Nginx, `flush_interval -1` on Caddy. |
+| Edits do not reach users on other replicas | Every app and realtime replica must use the same `REDIS_URL`. See [Redis](/platform/self-hosting/redis). |
-The app requires `REDIS_TLS_SERVERNAME` for an IPv4-literal `rediss://` URL. That override is not read by realtime and does not cover IPv6 literals. Prefer a DNS hostname matching the certificate for the shared deployment; see [Redis](/platform/self-hosting/redis#tls-to-an-ip-address).
+## Chat is unavailable
-## Certificate errors (CERT_HAS_EXPIRED)
+Requests fail with `401`, or Chat reports it is not configured: `COPILOT_API_KEY` is missing, or is not a key `SIM_AGENT_API_URL` accepts. For the Sim-hosted service, create a key at [sim.ai/selfhost/settings/chat-keys](https://www.sim.ai/selfhost/settings/chat-keys); a Mothership you run expects its `COPILOT_INBOUND_API_KEY`. Recreate the app after setting it. To hide Chat instead, set `NEXT_PUBLIC_CHAT_DISABLED=true`. See [Chat service](/platform/self-hosting/chat).
-Rule out expiry and clock drift first: the endpoint's certificate may genuinely have expired, or the host's clock may have drifted far enough to put a valid certificate outside its window. Check the certificate dates and the host date before changing any trust configuration — no CA bundle fixes either.
+## Certificate errors
-For a private certificate authority (CA), such as a corporate TLS-inspecting proxy or an internal service, mount the trusted CA certificates and configure `NODE_EXTRA_CA_CERTS`. For `UNABLE_TO_GET_ISSUER_CERT`, check whether the endpoint omits an intermediate certificate and repair its served chain. A trusted bundle can contain multiple certificates, but adding a root alone does not supply a missing intermediate.
-
-The image ships CA certificates and runs as a non-root account. Mount your corporate CA bundle and set the runtime variable; do not disable verification. Verify the affected transport, because a client with explicit TLS `ca` settings may use its own trust configuration:
-
-```yaml
-# docker-compose.prod.yml
-services:
- simstudio:
- volumes:
- - /etc/ssl/certs/corporate-ca.crt:/certs/corporate-ca.crt:ro
- environment:
- - NODE_EXTRA_CA_CERTS=/certs/corporate-ca.crt
-```
+Check the endpoint's certificate dates and the host clock first. For a private CA, such as a TLS-inspecting proxy, mount the CA bundle and set `NODE_EXTRA_CA_CERTS`; never set `NODE_TLS_REJECT_UNAUTHORIZED=0` outside a throwaway test. `UNABLE_TO_GET_ISSUER_CERT` usually means the server omits an intermediate certificate, which a root in your bundle does not replace.
```yaml
-# Helm — mount a ConfigMap holding the CA
+# Helm: mount a ConfigMap holding the CA
app:
env:
NODE_EXTRA_CA_CERTS: /certs/corporate-ca.crt
@@ -164,127 +58,43 @@ app:
readOnly: true
```
-`NODE_TLS_REJECT_UNAUTHORIZED=0` disables certificate verification entirely and should never be used outside a throwaway test.
+On Compose, mount the file into `simstudio` and set the same variable in an overlay.
## A workflow cannot reach a service on your network
-Guarded requests to private and reserved addresses are blocked unless a supported self-hosted exception or allowlist applies. Loopback exceptions are scoped by URL provenance and port, so a workflow pointed at your Docker host, a LAN service, or a Kubernetes service name fails with a message naming the blocker — the private or loopback address it resolved to, a blocked port, or `must use https:// to a public destination` when the URL is plain HTTP — and pointing at the allowlist variables.
-
-Name the destination:
+Private and loopback addresses are blocked by default. Name the destination:
```bash
EGRESS_ALLOWED_HOSTS=host.docker.internal,vllm.ai.svc.cluster.local
-EGRESS_ALLOWED_IP_RANGES=10.4.2.17/32,10.4.9.0/24
-```
-
-What naming a destination does and does not grant — plain HTTP, the blocked-port list, database hosts, cloud metadata, Sim Cloud — is covered once in [Security](/platform/self-hosting/security#the-ssrf-boundary).
-
-Two things this does not cover:
-
-- Inside a container `localhost` is the container itself, so it will never reach a service on your host. Use `host.docker.internal` (the Compose files map it) and name it above.
-- URLs harvested from content or from a third-party API response — an image URL, a file imported by URL, an MCP OAuth endpoint on a different origin than the MCP server itself — never reach a private network, allowlist or not. Nor does an HTTP block's `proxyUrl`.
-
-## Ollama models not showing
-
-Inside Docker, `localhost` = the container, not your host machine.
-
-```bash
-# For host-machine Ollama, use:
-OLLAMA_URL=http://host.docker.internal:11434
+EGRESS_ALLOWED_IP_RANGES=10.4.2.17/32
```
-On Linux, Ollama must also listen where the container reaches the host: bind it to the Docker bridge address, usually `OLLAMA_HOST=172.17.0.1:11434`. Its API has no authentication, so do not bind `0.0.0.0` unless a firewall blocks port 11434 from outside the host.
-
-## LM Studio requests route to Ollama
-
-Sim identifies dynamically discovered LM Studio and vLLM models by their `vllm/` prefix. If the endpoint is unavailable and you manually enter the raw LM Studio model identifier, Sim treats that unknown identifier as an Ollama model.
-
-1. Set `VLLM_BASE_URL`, and `VLLM_API_KEY` too if you enabled LM Studio's API authentication — without the key, discovery requests omit the bearer token and fail. No Compose file sets either for you, so add them to the `.env` file next to your Compose file — `simstudio` declares `env_file: .env` in every shipped file — then recreate the service and confirm it landed:
-
- Use the Compose file that started your installation — `docker-compose.prod.yml` for the documented production setup (also when you run the Ollama overlay on top of it) or `docker-compose.local.yml` for a source-built stack:
-
- ```bash
- COMPOSE_FILE=docker-compose.prod.yml # or docker-compose.local.yml
- docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
- docker compose -f "$COMPOSE_FILE" exec simstudio printenv VLLM_BASE_URL
- ```
-
- An empty result means the variable never reached the container, and model discovery cannot run.
-
-2. In LM Studio, enable **Serve on Local Network** and API authentication so the container can connect safely.
-3. With the shipped Compose host alias, use `http://host.docker.internal:1234` rather than `localhost`, including on Linux. If you use a custom container setup without that alias, configure it or use a reachable host IP.
-4. The server root and a URL ending in `/v1` are both accepted.
-5. Reload the workspace and select the discovered `vllm/` option from the model picker.
-
-## File uploads fail with a CORS error
+Inside a container, `localhost` is the container; use `host.docker.internal`. URLs taken from content or third-party responses never reach a private network. See [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary).
-The bucket's CORS policy does not allow your Sim origin. Uploads go directly from the browser to object storage via presigned `PUT`, so server-side configuration being correct is not enough.
+## Models and knowledge bases
-If small uploads succeed but cloud uploads over 50 MiB fail during completion, check the app logs for the provider's part-listing request. The server completes multipart uploads from provider-authoritative state; for S3, its identity needs `s3:ListMultipartUploadParts`. See [Object Storage](/platform/self-hosting/object-storage).
+**Local models missing.** See [Local models](/platform/self-hosting/local-models): the server URL must be reachable from the container, and LM Studio models appear as `vllm/` only while discovery succeeds.
-## Knowledge base upload fails
+**Knowledge base upload fails.** Configure an [embedding provider](/platform/self-hosting/environment-variables#knowledge-bases) and confirm pgvector. `vector 0 has N unexpected dimensions` means `EMBEDDING_OUTPUT_DIMS` does not match the model's output: set it to the width the message names if that is `384`, `768`, `1024`, `1536`, or `3072`, and recreate the knowledge base; otherwise choose another model.
-Embeddings need a provider — set `OPENAI_API_KEY`, configure Azure OpenAI, set `KB_EMBEDDING_MODEL=gemini-embedding-001` with a Gemini key, or set `KB_EMBEDDING_MODEL=ollama/` with `OLLAMA_URL` to embed on your own Ollama. On a self-hosted deployment `OPENROUTER_API_KEY` also serves the OpenAI-family models on its own, as a fallback behind any OpenAI or Azure credentials you have. If one is configured, verify pgvector is installed on the database.
+## File uploads fail
-A document that fails with `vector 0 has N unexpected dimensions` means `EMBEDDING_OUTPUT_DIMS` does not match what the model actually emits. The message names both widths. If the width the model returned is one of `384`, `768`, `1024`, `1536`, or `3072`, set the variable to it and recreate the knowledge base. If it is anything else, no column can store it — choose a model that emits one of those five instead, since setting an unstorable width silently falls back to `1536` and the next document fails the same way. Existing knowledge bases keep the width they were created with.
+A CORS error means the bucket does not allow the Sim origin; browsers upload straight to the bucket. If uploads over 50 MiB fail at completion on S3, grant `s3:ListMultipartUploadParts`. On local storage, check proxy body limits. See [Object storage](/platform/self-hosting/object-storage).
-## Scheduled workflows never run
+## Scheduled workflows and polling triggers never run
-Scheduled workflows need the scheduler and a deployed Schedule trigger.
-
-**Docker Compose** — check the `cron` service is running and read its logs:
-
-```bash
-docker compose -f docker-compose.prod.yml logs --tail=50 cron
-```
-
-A `401` there means the app and the scheduler disagree on `CRON_SECRET`.
-
-**Kubernetes** — check the CronJobs are present and firing:
-
-```bash
-kubectl get cronjobs -n simstudio
-kubectl get jobs -n simstudio --sort-by=.metadata.creationTimestamp | tail
-```
-
-For stale `LAST SCHEDULE`, inspect CronJob suspension, controller events, active Jobs, and scheduling deadlines. `Forbid` can skip a tick while an earlier Job is active. For a failed Job, inspect its logs; a 401 indicates authentication. Call the endpoint by hand to distinguish those cases:
+Check the scheduler: `docker compose -f docker-compose.prod.yml logs --tail=50 cron`, or `kubectl get cronjobs,jobs -n simstudio`. A `401` means `CRON_SECRET` differs between the scheduler and the app. Call the endpoint from inside the pod, quoting so `$CRON_SECRET` expands there:
```bash
kubectl exec -n simstudio deploy/sim-app -- sh -c \
- 'curl -s -o /dev/null -w "%{http_code}\n" \
- -H "Authorization: Bearer $CRON_SECRET" \
- http://localhost:3000/api/schedules/execute'
+ 'curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $CRON_SECRET" http://localhost:3000/api/schedules/execute'
```
-Wrap it in `sh -c` with single quotes so `$CRON_SECRET` expands **inside the pod** — otherwise your local shell substitutes an empty value and you get a misleading `401`.
-
-`401` means the secret does not match. `202` means the endpoint accepted the run; it does not tell you whether a schedule was actually due, so confirm in the Logs view.
-
-## Gmail, Drive, and Outlook triggers never fire
-
-These are **polling** triggers, driven by the per-minute `/api/webhooks/poll/*` jobs. Check the scheduler is running them — `docker compose -f docker-compose.prod.yml logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
-
-Microsoft Teams chat triggers are the different case: they use a Microsoft Graph subscription capped at about three days, renewed by the twice-daily `renew-subscriptions` job. If Teams triggers work for a couple of days and then stop, that job is not running. See [Background Jobs](/platform/self-hosting/background-jobs).
+`202` means the call was accepted, not that a schedule was due. Gmail, Drive, Calendar, Sheets, and Outlook triggers poll every minute; Microsoft Teams chat triggers stop after about three days if `renew-subscriptions` is not running. See [Background jobs](/platform/self-hosting/background-jobs).
## Credentials unreadable after a restore
-Integrations show as connected but fail, or provider keys error on decrypt. `ENCRYPTION_KEY` does not match the value in use when the backup was taken. Restore the original key. A different key cannot decrypt that stored data.
-
-## Windows-specific issues
-
-These apply to running Sim **from source** for development, not to the Docker or Kubernetes deployments, which are unaffected by the host OS.
-
-**Turbopack errors on Windows:** run the source development environment in WSL2.
-
-```bash
-wsl --install
-```
-
-**Line ending issues:**
-```bash
-# Configure git to use LF
-git config --global core.autocrlf input
-```
+Integrations show as connected but fail, or provider keys fail to decrypt: the running `ENCRYPTION_KEY` is not the one the backup was encrypted with. Restore the original key; no other key can read that data.
## Get help
diff --git a/apps/docs/content/docs/platform/self-hosting/upgrades.mdx b/apps/docs/content/docs/platform/self-hosting/upgrades.mdx
index 4f429532af5..7102cda04a2 100644
--- a/apps/docs/content/docs/platform/self-hosting/upgrades.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/upgrades.mdx
@@ -1,349 +1,175 @@
---
title: Upgrades
-description: Pinning versions, running migrations safely, and rolling back
+description: Pin a release, back up, migrate, and roll back
---
import { Tab, Tabs } from '@/components/ui/tabs'
import { Callout } from '@/components/ui/callout'
-import { Step, Steps } from '@/components/ui/steps'
-Choose and pin a release, back up the database, and rehearse the migration before upgrading. Schema migrations are forward-only, so some rollbacks require a database restore and lose writes made after the backup.
+Migrations are forward-only. Back up before every upgrade: rolling back across a schema change means restoring that backup and losing writes made since.
## Pin your version
-
- Pin a release tag or digest for production. `latest` can change between pulls; restarting with a pull policy that refreshes it can introduce an unplanned version and migration.
-
+The app, realtime, and migrations images must run the same release; they share the schema.
-Sim publishes images to GHCR, tagged by release alongside `latest`:
-
-```
-ghcr.io/simstudioai/simstudio
-ghcr.io/simstudioai/realtime
-ghcr.io/simstudioai/migrations
-```
-
-
- Keep `app`, `realtime`, and `migrations` on the same release. They share a schema; mismatched versions can expect missing columns or incompatible behavior. An application-only rollback needs verified compatibility with the migrated schema.
-
+
+
-
-
+Set `SIM_VERSION` in `.env` to a tag from the [releases page](https://github.com/simstudioai/sim/releases). One variable drives all three images; without it they track `latest`.
-```yaml
-app:
- image:
- tag: "v0.9.72" # a tag from the releases page
-realtime:
- image:
- tag: "v0.9.72" # a tag from the releases page
-migrations:
- image:
- tag: "v0.9.72" # a tag from the releases page
+```bash
+SIM_VERSION=
```
-When `image.tag` is unset it uses the selected chart's `appVersion`; `helm show chart oci://ghcr.io/simstudioai/charts/sim --version ` prints it, and local checkout metadata can differ. Setting tags explicitly decouples image selection from chart upgrades. For maximum determinism, pin `image.digest` instead:
-
-```yaml
-app:
- image:
- digest: "sha256:..."
-```
+The `cron` image shares no schema and follows `SIM_CRON_VERSION`, or `latest`.
-
-
-Images track `latest` by default. To pin, set `SIM_VERSION` in `.env` to a tag from the [releases page](https://github.com/simstudioai/sim/releases):
-
-```bash
-# .env
-SIM_VERSION=v0.9.72
-```
+
-One variable drives all three schema-coupled images, so they cannot drift apart. The `cron` service is deliberately excluded — it only makes HTTP calls and shares no schema, so it tracks `latest` unless you pin `SIM_CRON_VERSION`.
+Pin the chart with `--version`. Each chart version installs its `appVersion` release on all three images. Leave the `image.tag` of app, realtime, and migrations unset unless you need a digest (`image.digest`), and then set the same release on app, realtime, and migrations.
## Configuration changes by release [#configuration-changes]
-Check the changes for every release between your current version and the target before upgrading. Each entry names the setting and what to do about it.
+Read every entry between your current release and the target. Chart-only value changes are listed in the chart's [upgrade notes](https://github.com/simstudioai/sim/blob/main/helm/sim/README.md); read those for every chart version you cross.
-### Helm chart 1.15
+### v0.9.74
| Change | What to do |
-|---|---|
-| **Redis is required.** Sim refuses to start without `REDIS_URL`; there is no PostgreSQL or in-memory fallback. | Keep the bundled Redis, or point `REDIS_URL` at a managed instance before upgrading. App and realtime must reach the same Redis. See [Redis](/platform/self-hosting/redis). |
-| **`REGISTRATION_MODE` replaces `DISABLE_REGISTRATION`, `DISABLE_EMAIL_SIGNUP`, and `EMAIL_PASSWORD_SIGNUP_ENABLED`** (and its `NEXT_PUBLIC_` twin). The old variables are still honored as deprecated aliases, and the most restrictive setting wins. `NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED=false` now also disables email/password sign-in on the server. | Move to `REGISTRATION_MODE`. See [Control registration and sign-in](/platform/self-hosting/authentication#controlling-who-can-sign-up). |
-| **Enterprise `NEXT_PUBLIC_*` flags and `NEXT_PUBLIC_SANDBOXES_ENABLED` are no longer read, nor are `NEXT_PUBLIC_BILLING_ENABLED`, `NEXT_PUBLIC_E2B_ENABLED`, `NEXT_PUBLIC_SLACK_EXTENDED_SCOPES`, `NEXT_PUBLIC_DISABLE_INVITATIONS`, and `NEXT_PUBLIC_DISABLE_PUBLIC_API`.** The browser reads the server's resolved settings. | Set the server variable of the same name without the `NEXT_PUBLIC_` prefix (`BILLING_ENABLED`, `E2B_ENABLED`, `DISABLE_INVITATIONS`, …). The enterprise flags are listed in the [feature flag reference](/platform/enterprise/self-hosted#feature-flag-reference). |
-| **`ALLOW_PRIVATE_DATABASE_HOSTS` was removed.** The app logs an error at startup if it is still set. | Name your database, cache, and mail hosts in the egress allowlists. See [Upgrading from an earlier release](/platform/self-hosting/security#upgrading-from-an-earlier-release). |
-| **White-labeling was removed.** `NEXT_PUBLIC_BRAND_*`, `NEXT_PUBLIC_CUSTOM_CSS_URL`, `NEXT_PUBLIC_SUPPORT_EMAIL`, `NEXT_PUBLIC_DOCUMENTATION_URL`, `NEXT_PUBLIC_TERMS_URL`, `NEXT_PUBLIC_PRIVACY_URL`, `WHITELABELING_ENABLED`, and `NEXT_PUBLIC_WHITELABELING_ENABLED` are ignored. | Remove them at your convenience; leaving them set is harmless. |
-| **`docker-compose.ollama.yml` is now an overlay on `docker-compose.prod.yml`.** | A stack started from the previous standalone file needs its project name carried over, or it starts on an empty database. See [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack). |
-| **Helm chart 1.12 to 1.15 removed values.** `branding` (1.12), `monitoring.serviceMonitor` and `sharedStorage` (1.13), and the enterprise `NEXT_PUBLIC_*` keys (1.14) are gone; `sharedStorage.enabled: true` with volumes fails the render. | Read the chart's [upgrade notes](https://github.com/simstudioai/sim/blob/main/helm/sim/README.md#upgrading-to-1150) for each version you cross. |
-
-## Upgrade procedure
-
-Before applying an upgrade, configure a direct, non-pooled `MIGRATION_DATABASE_URL` on the migrator if the app uses a pooler. Session advisory locks do not survive transaction pooling. Pass the URL through the migrator's database Secret on Helm or its explicit environment on Compose; `app.env` or `.env` alone does not reach it. See [Migration environment](#migration-environment) for the exact setup.
+| --- | --- |
+| Compose stores local uploads in the `sim_uploads` volume. Earlier files kept them inside the app container, where recreating it discards them. | Before switching to the new Compose file, [copy the uploads out](#keep-uploads-from-before-the-volume). `sim-setup update` asks before recreating a container that still holds uploads. |
+| Helm chart 1.21.0 serves realtime on the app host under `/socket.io`, derives `BETTER_AUTH_URL` from `NEXT_PUBLIC_APP_URL`, and requires object storage for more than one app replica. | Read the chart's "Upgrading to 1.21.0" notes, and remove a copied `BETTER_AUTH_URL: http://localhost:3000`. |
-
+#### Keep uploads from before the volume
-
-
-### Read the release notes
-
-Check the [releases page](https://github.com/simstudioai/sim/releases) for new required environment variables and breaking changes. When the chart's minor version moves, also read its `README.md` upgrade notes — chart upgrades occasionally rename or remove values keys.
+```bash
+docker compose -f docker-compose.prod.yml cp simstudio:/app/apps/sim/uploads ./uploads-backup
+# switch to the new docker-compose.prod.yml, or run npx sim-setup update, then:
+docker compose -f docker-compose.prod.yml cp ./uploads-backup/. simstudio:/app/apps/sim/uploads
+docker compose -f docker-compose.prod.yml exec -u 0 simstudio chown -R nextjs:nodejs /app/apps/sim/uploads
+```
-
+### v0.9.65
-
+| Change | What to do |
+| --- | --- |
+| Redis is required; there is no fallback. | Keep the bundled Redis, or point `REDIS_URL` at yours before upgrading. See [Redis](/platform/self-hosting/redis). |
+| `REGISTRATION_MODE` replaces `DISABLE_REGISTRATION`, `DISABLE_EMAIL_SIGNUP`, and `EMAIL_PASSWORD_SIGNUP_ENABLED`, which still work as aliases; the most restrictive setting wins. | Move to `REGISTRATION_MODE`. See [Control registration](/platform/self-hosting/authentication#controlling-who-can-sign-up). |
+| Enterprise `NEXT_PUBLIC_*` flags and `NEXT_PUBLIC_BILLING_ENABLED`, `NEXT_PUBLIC_E2B_ENABLED`, `NEXT_PUBLIC_SANDBOXES_ENABLED`, `NEXT_PUBLIC_SLACK_EXTENDED_SCOPES`, `NEXT_PUBLIC_DISABLE_INVITATIONS`, and `NEXT_PUBLIC_DISABLE_PUBLIC_API` are no longer read. | Set the server variable without the prefix, such as `BILLING_ENABLED`. `npx sim-setup doctor` reports leftovers. |
+| `ALLOW_PRIVATE_DATABASE_HOSTS` was removed; the app logs an error while it is set. | Name each database, cache, and mail host in `EGRESS_ALLOWED_HOSTS`, or a single address in `EGRESS_ALLOWED_IP_RANGES` (`10.0.0.5/32`). Do not allowlist whole private ranges or `localhost`. See [the SSRF boundary](/platform/self-hosting/security#the-ssrf-boundary). |
+| White-labeling was removed; its variables are ignored. | Remove them at your convenience. |
+| `docker-compose.ollama.yml` became an overlay on `docker-compose.prod.yml`. | [Carry over the old stack's project](#migrating-from-the-previous-ollama-stack), or it starts on an empty database. |
-### Take a backup
+#### Migrate from the standalone Ollama stack [#migrating-from-the-previous-ollama-stack]
-Snapshot the database immediately before upgrading. Because migrations are forward-only, this snapshot is your only rollback path for schema changes.
+The old standalone file used the project name `sim-with-ollama`, so its data lives in `sim-with-ollama_postgres_data` and `sim-with-ollama_ollama_data`. Stop it without removing volumes, keep its project name and database password in `.env`, then start the overlay as in [Local models](/platform/self-hosting/local-models#ollama-in-the-compose-stack):
```bash
-# Managed Postgres — take a manual snapshot
-aws rds create-db-snapshot --db-instance-identifier sim-db \
- --db-snapshot-identifier "sim-pre-upgrade-$(date +%Y%m%d)"
-
-# Bundled Postgres — the Helm chart's database is named `sim` by default
-# (Docker Compose uses `simstudio`; the cloud example values files override to `simstudio`)
-kubectl exec -n simstudio statefulset/sim-postgresql -- \
- pg_dump -U postgres -Fc sim > "pre-upgrade-$(date +%F).dump"
+docker compose -p sim-with-ollama down
+cat >> .env << EOF
+COMPOSE_PROJECT_NAME=sim-with-ollama
+POSTGRES_PASSWORD=postgres
+OLLAMA_URL=http://ollama:11434
+EOF
```
-
-
-
+Use the old password if you set one; it defaulted to `postgres`. Ollama is no longer published on host port 11434.
-### Rehearse against real data
+### v0.9.33
-Migration surprises are usually data-shaped rather than schema-shaped, so a staging run against a copy of production data catches far more than a run against an empty database.
+Connected-account tokens are sealed with `ENCRYPTION_KEY` once a release at or after v0.9.33 runs. Releases before it cannot read them, so never roll back below v0.9.33 afterwards. A rolling upgrade from an earlier release leaves old pods unable to read tokens the new ones seal; upgrade to v0.9.33 first, stop old pods before starting new ones, or set `ENCRYPT_ACCOUNT_TOKENS=false` until every pod runs the new release. See [Account token sealing](/platform/self-hosting/security#account-token-sealing).
-
+## Upgrade procedure
-
+1. **Read the release notes** on the [releases page](https://github.com/simstudioai/sim/releases), and the entries above.
+2. **Back up the database** immediately before upgrading, with the uploads and secrets it depends on.
+3. **Rehearse** against a copy of production data. Migration problems are usually data-shaped.
+4. **Apply** the new version.
+5. **Verify** with [Verify your install](/platform/self-hosting/verify).
-### Apply
+If a pooler such as PgBouncer sits in front of the database, give migrations a direct URL first; see [Migration environment](#migration-environment).
-
-
+
+
```bash
-helm upgrade sim oci://ghcr.io/simstudioai/charts/sim \
- --version \
- --namespace simstudio \
- --values my-values.yaml
-```
-
-Preview changed chart values before applying. The following command requires the `helm-diff` plugin:
+# Back up (use your POSTGRES_USER and POSTGRES_DB if you changed them)
+docker compose -f docker-compose.prod.yml exec -T db pg_dump -U postgres simstudio > "pre-upgrade-$(date +%F).sql"
-```bash
-helm diff upgrade sim oci://ghcr.io/simstudioai/charts/sim --version -n simstudio --values my-values.yaml
+# Set SIM_VERSION in .env to the target release, then:
+npx sim-setup update
+docker compose -f docker-compose.prod.yml logs migrations
```
-Then watch the rollout:
-
-```bash
-kubectl rollout status -n simstudio deploy/sim-app --timeout=10m
-kubectl logs -n simstudio deploy/sim-app -c migrations --tail=100
-```
+`update` refreshes its managed copy of the Compose file, pulls the images for `SIM_VERSION`, and recreates the stack, keeping the data volumes. It applies every Compose file the stack uses, as recorded in `COMPOSE_FILE`. It refuses to overwrite a Compose file you edited; keep customizations in an overlay. Compose has no rolling updates, so plan a short maintenance window.
-
+
```bash
-npx sim-setup update
-# The file that started your install. A stack running the Ollama overlay is a
-# docker-compose.prod.yml install — see below.
-COMPOSE_FILE=docker-compose.prod.yml
-# COMPOSE_FILE=docker-compose.local.yml
-docker compose -f "$COMPOSE_FILE" logs migrations
-```
-
-`npx sim-setup update` obtains the new images, then brings the stack up with
-`docker compose up -d`, keeping data volumes. What it runs depends on which Compose file the
-install uses:
-
-| Install | What it runs |
-|---|---|
-| `docker-compose.prod.yml` | Refreshes its managed copy of the Compose file, writes `POSTGRES_PASSWORD` to `.env` if it is missing, then `docker compose pull` — the versions configured by `SIM_VERSION`, or `latest` when unset |
-| `docker-compose.local.yml` | `docker compose build --pull` — rebuilds from source against refreshed base images, no pull of published images |
-
-Inspect the result with `npx sim-setup logs`, which targets whichever Compose file the install uses.
-
-If your install predates the `sim_uploads` volume, copy its uploads out first: see [keep uploads from before the volume](/platform/self-hosting/docker#existing-installs-keep-uploads-from-before-the-volume). `sim-setup update` stops and asks before recreating an app container that still holds uploads.
-
-`docker-compose.prod.yml` requires `POSTGRES_PASSWORD`. If you manage the file yourself and Compose stops with `required variable POSTGRES_PASSWORD is missing a value`, confirm which password initialized the existing database volume. If it was never set, the old default was `postgres`; restore that value first, then see [Postgres on Compose](/platform/self-hosting/security#postgres-on-compose) to rotate it.
-
-Before updating a pinned production install, replace `SIM_VERSION` in `.env` with the chosen release tag. The update command pulls that configured tag; it does not automatically advance a pin.
+# Back up the bundled database (the chart's database is named sim unless you changed it)
+kubectl exec -n simstudio statefulset/sim-postgresql -- pg_dump -U postgres -Fc sim > "pre-upgrade-$(date +%F).dump"
-The CLI detects installs by those two files. For a stack started with more files, such as the `docker-compose.ollama.yml` overlay, `update` applies every file the stack was started with and saves the set as `COMPOSE_FILE` in `.env`, so it still applies after `docker compose down`. Compose does not record profiles, so the profile-scoped Ollama service is updated only when `.env` sets `COMPOSE_PROFILES` (for example `COMPOSE_PROFILES=gpu`). Otherwise refresh it by hand:
-
-```bash
-# The Ollama service is profile-scoped, so pass the profile you installed
-# with or Compose silently skips it.
-PROFILE=gpu # or cpu
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile "$PROFILE" pull
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile "$PROFILE" up -d
+helm diff upgrade sim oci://ghcr.io/simstudioai/charts/sim --version -n simstudio --values my-values.yaml
+helm upgrade sim oci://ghcr.io/simstudioai/charts/sim --version -n simstudio --values my-values.yaml
+kubectl rollout status -n simstudio deploy/sim-app --timeout=10m
```
-Upgrading from the previous, standalone `docker-compose.ollama.yml`? Follow [Migrating from the previous Ollama stack](/platform/self-hosting/docker#migrating-from-the-previous-ollama-stack) first, or Sim starts on an empty database.
-
-
- `sim-setup update` refuses two install kinds outright rather than doing something surprising:
-
- - **Kubernetes** — it does not upgrade Helm releases. Use `helm upgrade` after reading the chart and release notes.
- - **Source / dev** — the `dev` mode that manages only Postgres and Redis. Update the checkout with git, run `bun install`, and restart `bun run dev:full`. A source checkout running `docker-compose.local.yml` is a Compose install and does update, by rebuilding.
+For a managed database, take a provider snapshot instead. `helm diff` needs the helm-diff plugin. Pass your full values each time; `--reuse-values` does not pick up new chart defaults.
- On a standalone `docker-compose.prod.yml` install it also refuses to overwrite its managed Compose file if you have edited it by hand, comparing the file against the hash it recorded in `.sim-setup.json`: preserve or remove your customizations first.
-
-
-Compose does not provide rolling updates. Plan a maintenance window while containers restart. Kubernetes supports rolling deployments, but database compatibility and in-flight execution behavior still need a rehearsal.
+Realtime pods do not wait for migrations. A new realtime pod that starts before they finish fails editor writes that touch new columns until they do; to avoid that window, run the migrations image yourself before `helm upgrade`.
-
-
-
-
-### Verify
+### Convert an existing generic release
-Run the [verification checklist](/platform/self-hosting/verify). At minimum: sign in, open a workflow, execute it, upload a file, and confirm the [background jobs](/platform/self-hosting/background-jobs) are still firing.
-
-
-
-
+Moving an existing Helm release onto a cloud example values file keeps its data only if you keep its secrets and database name. Reuse the original encryption keys, and add `--set postgresql.auth.database=sim`: the chart's default database is `sim`, the cloud examples use `simstudio`, and changing the value does not rename an existing database.
## Rolling back
-**Application-only rollback** is possible when no migrations ran, or when you have verified the previous app is compatible with the migrated schema. Additive migrations alone do not prove compatibility:
-
-```bash
-helm rollback sim -n simstudio
-```
-
-```bash
-# Production Compose — set SIM_VERSION in .env so the pin persists, replacing
-# any existing line rather than appending a second one. Substitute the previous
-# release tag from the releases page.
-docker compose -f docker-compose.prod.yml up -d
-```
-
-A stack running the Ollama overlay rolls back the same way: it reads `SIM_VERSION` from `.env` like any production install. Pass both files and your profile so Compose manages the Ollama service in the same run:
+**Application only**, when no migrations ran or the previous release is verified compatible with the migrated schema: `helm rollback sim -n simstudio`, or set the previous `SIM_VERSION` in `.env` and run `docker compose -f docker-compose.prod.yml up -d`.
-```bash
-PROFILE=gpu # or cpu
-docker compose -f docker-compose.prod.yml -f docker-compose.ollama.yml --profile "$PROFILE" up -d
-```
+**Across a schema change**, restore the pre-upgrade backup; writes since the backup are lost:
-The local stack builds the app from source and ignores `SIM_VERSION`, so roll it back by checking out the previous tag and rebuilding:
+1. Stop everything that writes to the database: app, realtime, and scheduler.
+2. Restore the backup, with the encryption keys it was taken with.
+3. Deploy the previous release on app, realtime, and migrations, then start the scheduler again.
+4. Run [Verify your install](/platform/self-hosting/verify) before reopening traffic.
```bash
-git checkout ""
-docker compose -f docker-compose.local.yml up -d --build
+# Compose restore into the bundled database
+docker compose -f docker-compose.prod.yml exec -T db psql -U postgres simstudio < pre-upgrade-.sql
```
-Never roll back below v0.9.33 once account tokens are sealed: those releases cannot read them, and every connected account would have to be reconnected. See [Account token sealing](/platform/self-hosting/security#account-token-sealing).
-
-**Rollback after an incompatible schema change** requires restoring the pre-upgrade database backup. This loses writes made since the snapshot. Stop all writers before restoring:
-
-1. Stop traffic and all processes that can write to the database, including the app, realtime service, scheduled jobs, and any background workers.
-2. Restore the pre-upgrade database snapshot.
-3. Redeploy the previous image tag on the app, realtime, and migrations services, then resume the matching background workers and scheduler.
-4. Verify.
-
-Run the verification checklist before reopening traffic. Preserve the original encryption secrets with the restored database.
-
## When a migration fails
-The app pods will not become ready — this is by design.
+The app does not start while migrations fail. Read the logs:
```bash
kubectl logs -n simstudio deploy/sim-app -c migrations --tail=200
-```
-
-```bash
-# Or the file that started your install.
docker compose -f docker-compose.prod.yml logs migrations
```
-Common causes:
-
| Symptom | Cause |
-|---|---|
-| `permission denied to create extension "vector"` | The database user lacks superuser rights. Create the pgvector extension manually as an admin, then re-run. |
-| Connection refused / timeout | `DATABASE_URL` wrong, or the database is not reachable from the pod. Check network policy and credentials. |
-| `Timed out ... waiting for the migration advisory lock` | Another replica's migrator is wedged holding the lock. This replica waited 30 minutes and gave up. Find the runner that is actually stuck and read its logs. |
-| SQLSTATE `55P03` — lock timeout on a large table | A long-running query is holding a lock the DDL needs. The migrator sets `lock_timeout = 5s` on DDL rather than queueing every other query on that table behind it. Drain traffic and retry during a quiet window. |
-| Constraint violation | Pre-existing data conflicts with a new constraint. Capture the error, restore the pre-upgrade backup, and open an issue with the exact message. |
-
-Do not manually edit the migrations table to skip a failed migration — the schema and Sim's expectations will diverge in ways that surface much later.
-
-## Migration reference
-
-Migrations are Drizzle SQL files plus registered script (data) migrations, applied by a dedicated image in one locked session. A failure in either stage fails the migration container.
-
-- **Kubernetes** — an **init container on the app Deployment**. Every app pod waits for migrations to complete before it starts, so a failed migration blocks the rollout instead of starting an app against a mismatched schema.
-- **Docker Compose** — a one-shot `migrations` service with `restart: no` that runs before the app.
-
-
- On Kubernetes only the app waits for migrations: realtime pods have no migrations init container. A realtime pod of the new release that starts before its migrations finish fails the editor writes that read a new table or column, such as deleting a block or a variable, until they do. Run the migration image yourself before `helm upgrade` (see [Migration environment](#migration-environment)). On Docker Compose, `realtime` also waits for the `migrations` service to exit successfully.
-
-
-Migrations are **forward-only**. Take the backup described in the upgrade procedure before applying them; there are no down-migrations.
-
-
- Upgrading from a release older than v0.9.33 with a rolling deploy leaves old pods running next to new ones for a while. Old pods cannot read sealed account tokens, so integrations can fail on them until the rollout finishes. The `migrate` backfill waits an hour after such an upgrade before it seals stored tokens, but tokens the new pods write are sealed straight away. To avoid that window, upgrade to v0.9.33 first, stop the old pods before starting the new ones, or set `ENCRYPT_ACCOUNT_TOKENS=false` for the upgrade and remove it once every pod runs the new release.
-
-
-Migrations apply in sequence, so skipping several releases at once generally works mechanically. It is riskier — those combinations get less testing, and you take several releases' worth of behavior changes in one step. Upgrade in smaller increments where you can.
-
-### How concurrent replicas are handled
-
-Every app replica runs the full migrator — there is no leader. They are serialized by a **Postgres session advisory lock**, taken with a bounded try-lock loop rather than a blocking wait:
-
-1. One runner takes the lock and applies the pending files. The rest retry every 5 seconds.
-2. The applied files are journaled, so the runners that follow find nothing to do and exit.
-3. A runner that cannot get the lock within **30 minutes** fails with a message naming the deadline.
-
-A stuck runner holds up later replicas until their 30-minute lock-acquisition deadline. Inspect the earliest migration container's logs to find the holder; a later timeout may come from a runner that was only waiting.
-
-### Migration environment
-
-These control the migrator and are set on the `migrations` container, not the app.
-
-| Variable | Purpose |
-|---|---|
-| `MIGRATION_DATABASE_URL` | A **direct, non-pooled** database connection URL (DSN). Falls back to `DATABASE_URL`. Setting it also arms the backend-pid check that aborts the run if the session — and with it the advisory lock — is silently recycled mid-migration; with only `DATABASE_URL` set, that check is skipped |
-| `ENCRYPTION_KEY`, `ENCRYPT_ACCOUNT_TOKENS` | Let the migrator seal account tokens stored before [account token sealing](/platform/self-hosting/security#account-token-sealing) was on. The Helm init container reads both from the app Secret, and the Compose `migrations` services pass the `.env` values. Without a usable key the step stays pending and does nothing |
-
-
- Set `MIGRATION_DATABASE_URL` if anything sits between Sim and Postgres. Session advisory locks and session-level `SET`s do not survive PgBouncer transaction pooling — the lock silently does not hold, and consecutive statements can land on different backends. Point it at the database directly, bypassing the pooler.
-
-
-
-Supply the migration URL separately from the app URL:
-
-| Deployment | How to pass `MIGRATION_DATABASE_URL` |
-|---|---|
-| Helm | The init container reads the database Secret, plus only `ENCRYPTION_KEY` and `ENCRYPT_ACCOUNT_TOKENS` from the app Secret. Include the key in a Secret supplied through `postgresql.auth.existingSecret` or `externalDatabase.existingSecret`; `app.env` does not reach it. The chart-managed database Secret carries only the password, and there is no dedicated values key for the migration URL |
-| Compose | Add the variable to the `migrations` service's explicit `environment:` list. Setting it in `.env` alone does not pass it to that service |
-| Separate migration run | Run the migration image yourself with a direct DSN before upgrading |
+| --- | --- |
+| `permission denied to create extension "vector"` | Create the extension as an administrator, then rerun. |
+| Connection refused or timeout | The database URL or network path is wrong; check NetworkPolicy and credentials. |
+| `Timed out ... waiting for the migration advisory lock` | Another runner is stuck holding the lock. Read the earliest migrations container's logs. |
+| SQLSTATE `55P03` (lock timeout) | A long query holds a lock the migration needs. Drain traffic and retry in a quiet window. |
+| Constraint violation | Existing data conflicts with a new constraint. Restore the backup and open an issue with the message. |
-Behavior that is fixed in the migrator and not configurable, but that explains what you see in the logs:
+Never edit the migrations table to skip a migration.
-| Behavior | Value |
-|---|---|
-| Advisory-lock acquire deadline | 30 minutes, retried every 5s |
-| `lock_timeout` on the migration session | 5 seconds for ordinary DDL — a statement that waits longer fails with SQLSTATE `55P03`. An individual migration can set it to `0` for statements that must not be interrupted, such as `CREATE INDEX CONCURRENTLY`. `statement_timeout` is `0` on the same session by default, so a long migration is not cut off once it holds its locks — though a migration can narrow it for its own statements, as `0076_damp_vector.sql` does with a 180-second local setting |
-| SQL migration retry budget | 20 minutes, with exponential backoff and jitter, and only for a lock timeout (`55P03`). Script (data) migrations run once — a failure there exits immediately. They also run with `lock_timeout = 0` and `statement_timeout = 0`, so one blocked on an app-held lock waits indefinitely: a stuck script migration looks like a hung migration container, not a `55P03` |
-| Connection attempts at startup | 10, for transient failures — `53300` (`too_many_connections`), `53400`, the `08xxx` connection-exception class, and socket-level errors such as `ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `EHOSTUNREACH`, and `ENOTFOUND`. A database that is simply down is retried with backoff, not failed immediately |
+## Migration reference [#migration-environment]
-The `lock_timeout` deliberately trades a table-wide stall for a failed migration: without it, DDL waiting on an `AccessExclusiveLock` queues every other query on that table behind it for the whole wait.
+Every app pod on Helm, and the one-shot `migrations` service on Compose, runs the migrator. Runners take a PostgreSQL session advisory lock in turn, retrying every 5 seconds for up to 30 minutes; the first applies pending migrations and the rest find nothing to do. DDL runs with a 5-second `lock_timeout` and is retried for up to 20 minutes, so a migration fails rather than stalling every query on a busy table. Data migrations run once with no timeout, so one blocked on a lock looks like a hung container.
-## Related docs
+| Variable | Set on the migrator |
+| --- | --- |
+| `MIGRATION_DATABASE_URL` | A direct, non-pooled database URL. Falls back to `DATABASE_URL`. Required behind a transaction pooler, where session advisory locks do not hold |
+| `ENCRYPTION_KEY`, `ENCRYPT_ACCOUNT_TOKENS` | Let the migrator seal tokens stored before sealing was on. Both deployments pass the app's values |
-- [Verify your install](/platform/self-hosting/verify)
-- [Security and hardening](/platform/self-hosting/security)
+`app.env` and `.env` do not reach the migrator. On Helm, put `MIGRATION_DATABASE_URL` in the database Secret you supply through `postgresql.auth.existingSecret` or `externalDatabase.existingSecret`. On Compose, add it to the `migrations` service's `environment:` in an overlay.
diff --git a/apps/docs/content/docs/platform/self-hosting/verify.mdx b/apps/docs/content/docs/platform/self-hosting/verify.mdx
index 31c83039718..b1794eac2a8 100644
--- a/apps/docs/content/docs/platform/self-hosting/verify.mdx
+++ b/apps/docs/content/docs/platform/self-hosting/verify.mdx
@@ -5,73 +5,60 @@ description: Check authentication, collaboration, execution, storage, and schedu
import { Callout } from '@/components/ui/callout'
-Run these checks after installation, an upgrade, or a restore. Use a test workspace and the providers you configured. Also test optional features you enabled, such as SSO, SCIM, data drains, and remote sandboxes.
+Run these checks after installing, upgrading, or restoring. Use a test workspace, and also test the optional features you enabled, such as SSO, SCIM, data drains, and remote sandboxes.
## Run doctor [#sim-setup-doctor]
-For Compose or a source checkout, run from the directory holding your env files:
+On Compose, run from the directory holding `.env`:
```bash
npx sim-setup doctor
```
-Doctor reports these groups:
-
-| Group | Checks and limits |
+| Group | Checks |
| --- | --- |
-| Env files | Required env files exist. `--fix` seeds missing files from examples and values already in `apps/sim/.env`. |
-| Schema | Required keys are present, no longer placeholders, and have usable formats. `ENCRYPTION_KEY` is checked as 64 hex characters; other required secrets have minimum lengths. Optional secrets are not shape-checked, so an invalid `API_ENCRYPTION_KEY` can pass this group. |
-| Consistency | Shared secrets agree between app and realtime; the app and migrator point to the same database. `--fix` mirrors the app's value across split files. |
-| Coherence | Feature flags agree with dependencies, storage configuration is complete, and server flags agree with their UI counterparts. |
-| Live | Checks database reachability, pgvector, applied migrations, Redis, and HTTP health when their configuration is available. |
-
-Doctor reads env files, not live container configuration. Production Compose derives `DATABASE_URL` and Redis settings in the service definition, so those probes can be skipped when the keys are absent from `.env`. A standalone published package has no migration journal: it can report applied migrations, but cannot establish that they match a current checkout. Read the skipped findings and continue with the checks below.
+| Env files | Required files exist. `--fix` creates missing ones. |
+| Schema | Required keys are set, not placeholders, and well-formed. `ENCRYPTION_KEY` must be 64 hex characters. Optional secrets, including `API_ENCRYPTION_KEY`, are not shape-checked. |
+| Consistency | Shared secrets agree between app and realtime, and the app and migrations use the same database. |
+| Coherence | Feature flags agree with their dependencies, and storage configuration is complete. |
+| Live | Database reachability, pgvector, applied migrations, Redis, and HTTP health, where configured. |
-`--json` prints structured findings; the command exits `1` when a check fails. `--fix` writes env-file repairs and reruns the checks. Review those changes and recreate the affected services to apply them; retain existing encryption secrets on upgrades and restores.
+Doctor reads env files, not running containers. Compose sets `DATABASE_URL` and `REDIS_URL` on the services, so those probes can be skipped; read the skipped findings. `--json` prints structured findings, the command exits `1` when a check fails, and `--fix` writes repairs you then apply by recreating the containers. Doctor does not inspect Helm releases.
- Use your own domain. A `NEXT_PUBLIC_APP_URL` on `sim.ai` or a subdomain identifies the instance as Sim Cloud and disables self-hosted overrides. Doctor flags this configuration.
+ Use your own domain. A `NEXT_PUBLIC_APP_URL` on `sim.ai` or a subdomain identifies the instance as Sim Cloud and disables self-hosted behavior. Doctor flags it.
-Doctor is not a Helm runtime diagnostic. For Kubernetes, use the infrastructure commands below. See [Setup commands](/platform/self-hosting/docker#the-sim-setup-cli) for the supported layouts and commands.
-
## Core checks [#checklist]
| # | Action | Expected result | If it fails |
| --- | --- | --- | --- |
-| 1 | Open the public URL and create an account. If registration is disabled, use a provisioned account. | App, database, TLS, and migrations work. | Read app and migrations logs. |
-| 2 | Sign out and sign back in. | Session handling works at the configured origin. | Compare `NEXT_PUBLIC_APP_URL`, `BETTER_AUTH_URL`, and the browser origin. |
-| 3 | Open a workflow, add blocks, and confirm the browser establishes its socket connection. | Realtime is reachable. | Check browser socket errors and proxy routing. |
-| 4 | Open that workflow in a second browser window and edit it. | Edits propagate between clients. | Check realtime and Redis configuration. |
-| 5 | Save a model API key in settings and run a two-block workflow. | Credential encryption, execution, and provider egress work. | Check app logs, `ENCRYPTION_KEY`, and outbound connectivity. |
-| 6 | Upload and download a small file in Files. | Storage works end to end. | Check signed-URL/CORS settings for cloud storage, or app/proxy logs for local storage. |
-| 7 | Upload a file larger than 50 MiB and confirm completion. | Multipart upload works on cloud or local storage. | Read part-upload and completion errors in app logs. |
+| 1 | Open the public URL and create an account, or use a provisioned one. | App, database, TLS, and migrations work. | Read the app and migrations logs. |
+| 2 | Sign out and sign back in. | Sessions work at the public origin. | Compare `NEXT_PUBLIC_APP_URL`, `BETTER_AUTH_URL`, and the browser's address. |
+| 3 | Open a workflow in two browser windows and edit it. | Edits appear in both. | Check `/socket.io` routing, realtime, and Redis. |
+| 4 | Save a model API key and run a two-block workflow. | Encryption, execution, and provider egress work. | Check app logs, `ENCRYPTION_KEY`, and outbound access. |
+| 5 | Upload and download a small file in Files. | Storage works. | Check bucket CORS for cloud storage, or app and proxy logs for local storage. |
+| 6 | Upload a file larger than 50 MiB. | Multipart upload completes. | Read part-upload and completion errors in app logs. |
-Two windows verify collaboration between clients. To establish cross-replica operation, also confirm their socket connections reach different realtime pods. A load balancer can send both windows to one process. Every replica of the app and realtime services must reach the same Redis through `REDIS_URL`.
-
-Cloud uploads use multipart above 50 MiB; local uploads use it above 8 MiB. Local parts pass through Sim, while cloud parts use signed provider URLs. See [Object storage](/platform/self-hosting/object-storage).
+Two windows can land on the same realtime pod. To prove cross-replica delivery, confirm the sockets reach different pods; every app and realtime replica must use the same `REDIS_URL`.
## Feature checks
-Run the checks for each feature you intend to use:
-
-| # | Action | Expected result | Prerequisite or diagnosis |
+| # | Action | Expected result | Prerequisite |
| --- | --- | --- | --- |
-| 8 | Create a knowledge base and upload a PDF. | Parsing, embeddings, and vector storage complete. | Configure an embedding provider and enable pgvector. |
-| 9 | Invite a teammate from workspace settings. | The invitation arrives and can be accepted. | Configure and verify email delivery. |
-| 10 | Connect an OAuth integration account. | The provider returns to Sim and the account is listed. | Match registered callbacks to the public origin. |
-| 11 | Deploy a workflow with a Schedule trigger set to every minute, then wait two minutes. | The workflow runs on schedule. | Confirm the scheduler is running and its `CRON_SECRET` matches the app. |
-| 12 | Use a Sim API key to trigger a workflow through the public API. | API-key authentication and execution work. | Enable the public API and use the intended key scope. |
+| 7 | Create a knowledge base and upload a PDF. | Parsing and embedding complete. | An [embedding provider](/platform/self-hosting/environment-variables#knowledge-bases) and pgvector. |
+| 8 | Invite a teammate. | The invitation arrives and can be accepted. | [Email](/platform/self-hosting/email) delivery. |
+| 9 | Connect an OAuth integration. | The provider returns to Sim and the account is listed. | Callbacks registered for the public origin. |
+| 10 | Deploy a workflow with an every-minute Schedule trigger and wait two minutes. | It runs on schedule. | The scheduler running with the app's `CRON_SECRET`. |
+| 11 | Trigger a workflow through the public API with a Sim API key. | The run succeeds. | The public API enabled. |
- A healthy app does not prove scheduled work is running. Scheduled workflows and polling triggers depend on the scheduler; verify an actual run and inspect scheduler responses.
+ A healthy app does not prove scheduled work runs. Confirm an actual scheduled run and the scheduler's responses.
-Knowledge bases can use OpenAI, Azure OpenAI, OpenRouter, or Gemini embeddings, or an Ollama model selected by `KB_EMBEDDING_MODEL=ollama/` with `OLLAMA_URL`. See [Environment variables](/platform/self-hosting/environment-variables#knowledge-bases).
-
## Infrastructure checks
-For the Helm example release `sim` in namespace `simstudio`:
+For the Helm release `sim` in namespace `simstudio`:
```bash
kubectl get pods -n simstudio
@@ -84,53 +71,34 @@ The migrations init container must complete before the app starts. Inspect faile
Then run `helm test sim -n simstudio --logs`. One test pod checks the app and realtime Services answer; the other calls the app's authenticated self-check, which passes only when the database answers and is migrated, Redis answers, realtime is healthy, and, with the Kubernetes sandbox provider, a sandbox runs user code confined (sandbox user, no cloud metadata credentials or Kubernetes API, no reach into the app, its data stores, or another sandbox). `--logs` prints each check's result. It skips, passing, when `CRON_SECRET` is not in the app Secret.
-To check whether Redis is configured without printing the connection string:
-
-```bash
-kubectl exec -n simstudio deploy/sim-app -- sh -c 'test -n "$REDIS_URL"'
-```
-
-A zero exit status only confirms a non-empty variable. It does not prove Redis answers or that cross-pod events propagate; use the collaboration check above.
-
For Compose:
```bash
docker compose -f docker-compose.prod.yml ps -a
-docker compose -f docker-compose.prod.yml logs migrations
-docker compose -f docker-compose.prod.yml logs cron
+docker compose -f docker-compose.prod.yml logs migrations cron
curl -fsS http://localhost:3000/api/health
```
-Expect `simstudio`, `realtime`, `db`, `redis`, and `cron` to be running, with `migrations` and `uploads-init` completed successfully. Without `CRON_SECRET`, the cron service exits instead of running schedules.
+Expect `simstudio`, `realtime`, `db`, `redis`, and `cron` running, and `migrations` and `uploads-init` exited with status 0.
## Read failures [#reading-the-failures]
| Failure | Check |
| --- | --- |
-| App does not load | Database connectivity and migration logs. On Helm, failed migrations block the app init sequence. On Compose, the app waits for successful migrations. |
-| Sign-in loops or is rejected | Public app/auth origins, scheme, and trusted origins. Confirm the app and realtime use the same `BETTER_AUTH_SECRET`. |
-| Socket is unavailable | WebSocket upgrades and `/socket.io` routing. Realtime defaults to the app host; for a separate realtime host, `NEXT_PUBLIC_SOCKET_URL` must point at it (the Helm chart sets it from `ingress.realtime.host` unless you do). `ALLOWED_ORIGINS` is only for origins beyond `NEXT_PUBLIC_APP_URL`. |
-| Edits do not propagate | Realtime connectivity and Redis on every replica; verify which pods hold the connections. |
-| Workflow execution fails | Provider egress, saved credentials, and app logs. A decryption error can mean the current `ENCRYPTION_KEY` differs from the key that encrypted the credential. |
-| Cloud upload fails | Bucket CORS for the Sim origin and signed headers; server permissions to complete multipart uploads. S3 completion needs `s3:ListMultipartUploadParts`. |
-| Local upload fails | App logs, writable persistent upload storage, and proxy/body limits. Bucket CORS does not apply. |
-| Knowledge upload fails | Embedding credentials/model/width, parsing errors, and `vector` availability. |
-| Email never arrives | Provider configuration and delivery dashboard. Without a provider, Sim reports success without delivery; it logs only recipient, subject, and sender at INFO. |
-| OAuth connection fails | Exact callback URI, client credentials, requested scopes, and provider approval. |
-| Schedule does not run | Cron service or CronJob pod logs. `401` means scheduler authentication failed; compare `CRON_SECRET`. |
-
-Set `LOG_LEVEL=INFO` and restart/recreate the app to see email no-op logs. Log-level values are uppercase; the production default is `ERROR`, which hides those INFO messages. Message bodies are not logged and cannot be recovered from that no-op entry.
-
-## After an upgrade
-
-Repeat app sign-in, realtime collaboration, workflow execution, file upload/download, and scheduled-run checks at minimum. Also test each optional feature affected by the release.
-
-## After a restore
-
-Run all applicable checks. Run a workflow using a previously saved provider key and an OAuth-backed integration to confirm the restored database and `ENCRYPTION_KEY` still match. An app can load and sign in while stored credentials remain unreadable.
-
-## Related docs
-
-- [Background jobs](/platform/self-hosting/background-jobs)
-- [Networking](/platform/self-hosting/networking)
-- [Troubleshooting](/platform/self-hosting/troubleshooting)
+| App does not load | Database connectivity and migrations logs. Failed migrations keep the app from starting. |
+| Sign-in loops or is rejected | The public origin and scheme, `TRUSTED_ORIGINS`, and the same `BETTER_AUTH_SECRET` on app and realtime. |
+| Socket unavailable | WebSocket upgrades and `/socket.io` routing. A separate realtime host needs `NEXT_PUBLIC_SOCKET_URL`. |
+| Edits do not propagate | Realtime reachability and the same Redis on every replica. |
+| Workflow fails on a saved credential | A decryption error means the current `ENCRYPTION_KEY` is not the one that encrypted it. |
+| Cloud upload fails | Bucket CORS for the Sim origin; for S3, `s3:ListMultipartUploadParts` on the server's identity. |
+| Local upload fails | Writable upload storage and proxy body limits. |
+| Knowledge upload fails | Embedding credentials, model and width, and `vector` availability. |
+| Email never arrives | Provider configuration. Without one, Sim reports success and sends nothing; set `LOG_LEVEL=INFO` to see the skipped sends. |
+| OAuth connection fails | Exact callback URI, client credentials, scopes, and provider approval. |
+| Schedule does not run | Scheduler logs. `401` means `CRON_SECRET` differs between the scheduler and the app. |
+
+More symptoms are in [Troubleshooting](/platform/self-hosting/troubleshooting).
+
+## After an upgrade or restore
+
+After an upgrade, repeat sign-in, collaboration, a workflow run, a file upload, and a scheduled run, plus any feature the release changed. After a restore, also run a workflow that uses a previously saved provider key and an OAuth integration: the app can load and sign in while stored credentials are unreadable under the wrong `ENCRYPTION_KEY`.
diff --git a/apps/docs/lib/redirects.ts b/apps/docs/lib/redirects.ts
index cbc6cc8008f..a9b5eea182a 100644
--- a/apps/docs/lib/redirects.ts
+++ b/apps/docs/lib/redirects.ts
@@ -125,6 +125,12 @@ const PATH_REDIRECTS: DocsRedirect[] = [
destination: '/platform/enterprise',
permanent: true,
},
+ // the cloud-platforms page merged into reference architectures
+ {
+ source: '/platform/self-hosting/platforms',
+ destination: '/platform/self-hosting/reference-architectures',
+ permanent: true,
+ },
// mothership/* renamed to chat/* — the surface is "Chat", the agent is "Sim"
{ source: '/mothership', destination: '/chat', permanent: true },
{ source: '/mothership/:path*', destination: '/chat/:path*', permanent: true },
diff --git a/apps/docs/scripts/fixtures/content-baseline.json b/apps/docs/scripts/fixtures/content-baseline.json
index cefa7727e4a..2dc56e3d155 100644
--- a/apps/docs/scripts/fixtures/content-baseline.json
+++ b/apps/docs/scripts/fixtures/content-baseline.json
@@ -171936,41 +171936,6 @@
"url": "#services",
"depth": 2
},
- {
- "title": "App",
- "url": "#app",
- "depth": 3
- },
- {
- "title": "Realtime",
- "url": "#realtime",
- "depth": 3
- },
- {
- "title": "Migrations",
- "url": "#migrations",
- "depth": 3
- },
- {
- "title": "PostgreSQL",
- "url": "#postgresql",
- "depth": 3
- },
- {
- "title": "Redis",
- "url": "#redis",
- "depth": 3
- },
- {
- "title": "Scheduler",
- "url": "#scheduler",
- "depth": 3
- },
- {
- "title": "Optional Chat service",
- "url": "#optional-chat-service",
- "depth": 3
- },
{
"title": "Where state lives",
"url": "#where-state-lives",
@@ -171980,16 +171945,6 @@
"title": "Request paths",
"url": "#request-paths",
"depth": 2
- },
- {
- "title": "Network boundaries",
- "url": "#network-boundaries",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -172272,26 +172227,6 @@
"title": "Schedule upload-session cleanup",
"url": "#schedule-upload-session-cleanup",
"depth": 2
- },
- {
- "title": "Verifying",
- "url": "#verifying",
- "depth": 2
- },
- {
- "title": "Shipped job reference",
- "url": "#shipped-job-reference",
- "depth": 2
- },
- {
- "title": "Concurrency",
- "url": "#concurrency",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -172327,93 +172262,51 @@
{
"lang": "bash",
"meta": null,
- "sha256": "8ce735aac44b2574c5feafcd5e0ab5fba3f118fdb4aefa2ff357b46fa7c07074",
- "bytes": 124,
- "line": 12
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "7d97a6b426ef74cb32e0ffa6e79ca0077d52c7310571598a2c5afd90294fdb8c",
- "bytes": 20,
- "line": 20
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "1d98bef29c85a244d009716ad4ef46640168e1ca67469885ec18852af9521187",
- "bytes": 25,
- "line": 34
+ "sha256": "3219aa4a21768511924e33a152be600a99455b2b4c489c44367b22048bdb6123",
+ "bytes": 93,
+ "line": 10
},
{
"lang": "yaml",
"meta": null,
"sha256": "07643f4f1db20caf6395caee255f0a7a006a1aa935882830d69e5413cf370317",
"bytes": 65,
- "line": 54
+ "line": 22
},
{
"lang": "bash",
"meta": null,
"sha256": "57383a26f776f5f7c1f2cddcdf00bd3706a9c9598dbb6fcdf510389824e7dd3a",
"bytes": 151,
- "line": 65
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "7d97a6b426ef74cb32e0ffa6e79ca0077d52c7310571598a2c5afd90294fdb8c",
- "bytes": 20,
- "line": 77
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "3428ca92c1894f3f15ac85ae0637c969c0c004b29b60bc9fe1393b2c397d245f",
- "bytes": 47,
- "line": 83
+ "line": 31
},
{
"lang": "bash",
"meta": null,
"sha256": "9a9a03e2cc32aa7b9e9e7b7f44c93923586a33c987a8eac7bd82d393295dafd1",
"bytes": 54,
- "line": 93
- },
- {
- "lang": null,
- "meta": null,
- "sha256": "1ea583586a1dfd8e2ed984de420605f00a73cadcb1455437888e8b487965a98c",
- "bytes": 105,
- "line": 99
+ "line": 43
},
{
"lang": "yaml",
"meta": null,
- "sha256": "022a5166874f149083d16c2812d3ff932bbfc8717104c7eed2dc2be323f95937",
- "bytes": 90,
- "line": 106
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "22b5dd669569de3cf5d364beb92f1730bcdd0c7ce6696f5548bcddee1d1ff981",
- "bytes": 71,
- "line": 114
+ "sha256": "df8f33d36a40a1661da5f1b6d95f826d2d6a45dd40532b0aa71241767d0b666a",
+ "bytes": 166,
+ "line": 49
},
{
"lang": "yaml",
"meta": null,
- "sha256": "7cee28c09287666792af49b7136a91ebdb0885adc6f6c6f1114895a72b0bf9ed",
- "bytes": 260,
- "line": 126
+ "sha256": "893f5b30064646ab35b6e47c8e34a98385b4f2a1034f37128049f613b07107d3",
+ "bytes": 228,
+ "line": 70
},
{
"lang": "text",
"meta": null,
"sha256": "0730564a1577a056eea1af5ac0b6c7b92e4a0c6bc295a4a60e65de530714e8ea",
"bytes": 113,
- "line": 141
+ "line": 84
}
],
"links": [
@@ -172633,51 +172526,11 @@
"url": "#production-setup",
"depth": 2
},
- {
- "title": "1. Configure the environment",
- "url": "#1-configure-the-environment",
- "depth": 3
- },
- {
- "title": "2. Configure durable uploads",
- "url": "#2-configure-durable-uploads",
- "depth": 3
- },
- {
- "title": "3. Start and verify services",
- "url": "#3-start-and-verify-services",
- "depth": 3
- },
- {
- "title": "4. Serve the public origin over TLS",
- "url": "#4-serve-the-public-origin-over-tls",
- "depth": 3
- },
{
"title": "Ollama",
"url": "#ollama",
"depth": 2
},
- {
- "title": "External Ollama",
- "url": "#external-ollama",
- "depth": 3
- },
- {
- "title": "Bundled Ollama",
- "url": "#bundled-ollama",
- "depth": 3
- },
- {
- "title": "Migrating from the previous Ollama stack",
- "url": "#migrating-from-the-previous-ollama-stack",
- "depth": 4
- },
- {
- "title": "LM Studio",
- "url": "#lm-studio",
- "depth": 2
- },
{
"title": "The sim-setup CLI",
"url": "#the-sim-setup-cli",
@@ -172687,11 +172540,6 @@
"title": "Back up and update",
"url": "#commands",
"depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -172734,142 +172582,51 @@
{
"lang": "bash",
"meta": null,
- "sha256": "115d390d2a2ce355d6ecfe6a662b9e2f6e73f285ec4186638f676cb9eb9007c6",
- "bytes": 13,
- "line": 20
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "fc4c41bd42c49d3d1e01e1c5b3bea596499a608d6e8b477667c20c94e6392569",
- "bytes": 55,
- "line": 28
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "8458fd352d5aa0c3bd2d0e4d4e362b72556f9a812206a9b1b311a17df776cffb",
- "bytes": 370,
- "line": 41
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "ac53018b6ccf14d539980fc8206ce97fadc6a32220a60333cf7a8bef91f27f77",
- "bytes": 377,
- "line": 80
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "895e38a2340e9bc60c742d7b2950ffadbe99a44f47bdb55f94e9c32363f4b126",
- "bytes": 196,
- "line": 80
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "9a9a03e2cc32aa7b9e9e7b7f44c93923586a33c987a8eac7bd82d393295dafd1",
- "bytes": 54,
- "line": 98
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "57272f564e9f8df27666b97601aa83289d7ca6df712285cf1170be56c945b7c4",
- "bytes": 208,
- "line": 108
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "6c7c578d5d5d42812a8dd29e3fde30d7282e4f02890c4fffd2055e2086982252",
- "bytes": 44,
- "line": 134
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "3428ca92c1894f3f15ac85ae0637c969c0c004b29b60bc9fe1393b2c397d245f",
- "bytes": 47,
- "line": 140
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "c04933e97d11eb1d70a6dc9bc4dd84de6567b91a5df4028d29f1fb0c7f9248d0",
- "bytes": 30,
- "line": 154
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "55ae5c7b92a538490f5b42e5be4f11dfd7fd43e6b60dc23c24a14adf9228457f",
- "bytes": 246,
- "line": 160
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "e3bbbc664b20d8e444548efdc9528e1156c0d4da50868bb87f01d2797894d785",
- "bytes": 107,
- "line": 170
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "0f620ad171fa8f8a7e4ee5e12a860c218ab48598886e69486f7562d983874f1e",
- "bytes": 268,
- "line": 176
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "7e1c423747795ea24732770b89f38ddeb4f942ebdf25770f23887c66266f0a32",
- "bytes": 38,
- "line": 190
+ "sha256": "808b782b3c44c576b4b7025f6e2d1cfb84f83370a74086ff7f4440d0198cc9d6",
+ "bytes": 46,
+ "line": 15
},
{
"lang": "bash",
"meta": null,
- "sha256": "894aecda7cae7ed3cd0bf0de86f635db75dd378b32f60e2e496b85b81c78c92a",
- "bytes": 94,
- "line": 196
+ "sha256": "377360e134dc5bd6a33825e33c29f03958f643b3d7772e57481c2e276fe75ea3",
+ "bytes": 148,
+ "line": 25
},
{
"lang": "bash",
"meta": null,
- "sha256": "83e50e313f3b2f086dc8a52ee3716a6a9e5ed6b44cd94b9a6e10e1f65f48bf9e",
- "bytes": 84,
- "line": 210
+ "sha256": "3ce95f4a776bb82c89f63f8dc4bc16304061e6569207d7b305b3e62044f98b8f",
+ "bytes": 447,
+ "line": 33
},
{
"lang": "bash",
"meta": null,
- "sha256": "cb42a5b8df8ca9d83b1b48868d129703a019f530c9efc041eedd7fcce06de357",
- "bytes": 236,
- "line": 219
+ "sha256": "21de33c96c81932ec92580a055aa726a8b9205fa2c4839a889eda2319f64dc8f",
+ "bytes": 138,
+ "line": 59
},
{
"lang": "bash",
"meta": null,
- "sha256": "d5bd2d83b2af1f760af5560bb09c66eefc40e39cf52352e1001cfad9a3c4eac4",
- "bytes": 95,
- "line": 254
+ "sha256": "974a28519efe7c2798b3c29d961c7964e3b6a22b0afbcb2f406eebf275466dcb",
+ "bytes": 66,
+ "line": 85
},
{
- "lang": "bash",
+ "lang": "yaml",
"meta": null,
- "sha256": "2f058f5665db6f9b709c6d84e196109453b1be9f9af60eee056f98d1a90fc076",
- "bytes": 92,
- "line": 260
+ "sha256": "1e6a7bab26620dbb590a1d8866c8c30e6d3d54c27504f8b26fdcd4cd2c01776b",
+ "bytes": 803,
+ "line": 96
},
{
"lang": "bash",
"meta": null,
- "sha256": "fed433dfd89f812c99e9b905b5040307b08f5f828e78a6f6aa9322b7302b2264",
- "bytes": 20,
- "line": 280
+ "sha256": "d0270034d1a4030bd51ab97a898797a3ed4f74bf4b77ecc7f4dc28285d85df41",
+ "bytes": 143,
+ "line": 128
}
],
"links": [
@@ -173253,11 +173010,6 @@
"url": "#observability",
"depth": 2
},
- {
- "title": "Example .env",
- "url": "#example-env",
- "depth": 2
- },
{
"title": "Related docs",
"url": "#related-docs",
@@ -173293,29 +173045,7 @@
}
],
"expressions": [],
- "codeFences": [
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "8212e97007004681330f0d78618939abbc4d7a29283580552542a576245c0826",
- "bytes": 79,
- "line": 294
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "fe9b36f2be8e8d7bf8f8af70f6b4e6209d6dfe0941b6cf2efeedc649566912f4",
- "bytes": 129,
- "line": 305
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "673549d971c13b6c90e7b362eff976c647ad34aa6282346e3b66b738d479478c",
- "bytes": 828,
- "line": 328
- }
- ],
+ "codeFences": [],
"links": [
"/platform/self-hosting/docker",
"/platform/self-hosting/kubernetes#secret-stores",
@@ -173366,35 +173096,15 @@
"url": "#choose-a-deployment",
"depth": 2
},
- {
- "title": "Quick start",
- "url": "#quick-start",
- "depth": 2
- },
{
"title": "Requirements",
"url": "#requirements",
"depth": 2
},
- {
- "title": "Before production use",
- "url": "#before-production-use",
- "depth": 2
- },
{
"title": "External dependencies",
"url": "#external-dependencies",
"depth": 2
- },
- {
- "title": "Enterprise features",
- "url": "#enterprise-features",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -173425,14 +173135,7 @@
"meta": null,
"sha256": "115d390d2a2ce355d6ecfe6a662b9e2f6e73f285ec4186638f676cb9eb9007c6",
"bytes": 13,
- "line": 24
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "c9ec4341bddca160d4c16be81aa710e6e4265299d72b66529e53d280fef31416",
- "bytes": 23,
- "line": 76
+ "line": 13
}
],
"links": [
@@ -173468,11 +173171,6 @@
"description": "Configure provider apps, callbacks, and credentials for your deployment"
},
"headings": [
- {
- "title": "Prerequisites",
- "url": "#prerequisites",
- "depth": 2
- },
{
"title": "Set up an OAuth client",
"url": "#setup",
@@ -173488,11 +173186,6 @@
"url": "#google",
"depth": 3
},
- {
- "title": "Member-account scopes",
- "url": "#member-account-scopes",
- "depth": 4
- },
{
"title": "Microsoft",
"url": "#microsoft",
@@ -173528,16 +173221,6 @@
"url": "#everything-else",
"depth": 3
},
- {
- "title": "Services with a different flow",
- "url": "#services-with-a-different-flow",
- "depth": 3
- },
- {
- "title": "Non-OAuth integration credentials",
- "url": "#non-oauth-integration-credentials",
- "depth": 2
- },
{
"title": "Triggers that need extra configuration",
"url": "#triggers-that-need-extra-configuration",
@@ -173672,77 +173355,21 @@
"meta": null,
"sha256": "9b08ca529580f85816ba6d76bd5ff290b459a4f9f8f64aa7a0d62a72a2e73122",
"bytes": 64,
- "line": 16
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "509537bd4971dcf99cf1d0105180ee6c4bf8aaede5bc09244ad1a3acb1a47f99",
- "bytes": 89,
- "line": 26
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "f151a38cdacac4da8ff263887b24828c2fffff9fcff3361532d0f6ca7965fe9a",
- "bytes": 129,
- "line": 59
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "734b39f8116b7c10d9184c32282ba4b30dcb919d9e4b998d77bd0881a4d6f35e",
- "bytes": 235,
- "line": 73
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "ca20a495083a895fdd1d32b23f9d044e548faf25ca186081a2bde2397c3dc275",
- "bytes": 183,
- "line": 87
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "6549ad0ff1800e9ac55106bb4160c1a836f7b387fa27cd0b617dce19e98b189e",
- "bytes": 143,
- "line": 100
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "f465118d691a65dd15231becee88541c225de708d7c6ae786514df582468b4c4",
- "bytes": 213,
- "line": 112
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "cba0be9f70280acb431564ae32d2cdf1b61a66391affb22fcfcb2b45033ed3c2",
- "bytes": 925,
- "line": 178
- },
- {
- "lang": "text",
- "meta": null,
- "sha256": "1be601d98e2c32e5875bc8539807023b0e31d3c26c993d90764cbb150a03adc1",
- "bytes": 1329,
- "line": 221
+ "line": 11
},
{
"lang": "text",
"meta": null,
"sha256": "de6ebe076fde243adfdbac0e03b9fd3ec1d73752092e47df1fb8b9b0c3f1826f",
"bytes": 66,
- "line": 284
+ "line": 86
},
{
"lang": "text",
"meta": null,
"sha256": "8c26e06087ee8ea0ae352d8de5c953711f021888816f40ccee07fab4d7c35613",
"bytes": 185,
- "line": 345
+ "line": 147
}
],
"links": [
@@ -173792,66 +173419,21 @@
"url": "#prerequisites",
"depth": 2
},
- {
- "title": "Installation",
- "url": "#installation",
- "depth": 2
- },
- {
- "title": "1. Choose the secret strategy",
- "url": "#1-choose-the-secret-strategy",
- "depth": 3
- },
- {
- "title": "2. Prepare new-install secrets",
- "url": "#2-prepare-new-install-secrets",
- "depth": 3
- },
- {
- "title": "3. Install the pinned chart",
- "url": "#3-install-the-pinned-chart",
- "depth": 3
- },
{
"title": "Public access",
"url": "#key-configuration",
"depth": 2
},
- {
- "title": "Ingress and TLS",
- "url": "#ingress-and-tls",
- "depth": 2
- },
{
"title": "Secret stores",
"url": "#secret-stores",
"depth": 2
},
- {
- "title": "Existing Secret",
- "url": "#existing-secret",
- "depth": 3
- },
- {
- "title": "External Secrets Operator",
- "url": "#external-secrets-operator",
- "depth": 3
- },
- {
- "title": "Cloud-specific values",
- "url": "#cloud-specific-values",
- "depth": 2
- },
{
"title": "Verify the release",
"url": "#verify-the-release",
"depth": 2
},
- {
- "title": "Verify the chart",
- "url": "#verifying-the-chart",
- "depth": 2
- },
{
"title": "External database",
"url": "#external-database",
@@ -173866,11 +173448,6 @@
"title": "Operator commands",
"url": "#commands",
"depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -173906,135 +173483,86 @@
{
"lang": "bash",
"meta": null,
- "sha256": "5f858f0089e9071159249d85d783547754a1b16757a6acea29a342d603334371",
- "bytes": 230,
- "line": 8
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "236b1b8015cc924ecda730d93ea0ce41b44ae5c5b0e50e035b959c3f44c8082d",
- "bytes": 439,
- "line": 42
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "1207989a26fa955c4393c00573ddef43c081589c29f31ac59e33c21ec5cbcd24",
- "bytes": 460,
- "line": 57
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "ebd6f30ec1291421eb6a701952e95b5e95d26c11da036967e1f8763ae3e53cb5",
- "bytes": 62,
- "line": 71
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "ef408cf27c701be6e6a5f6d18e697faaee73fa7c45fc9f10c73d2f27f3ced278",
- "bytes": 67,
- "line": 75
+ "sha256": "806e619ce818db9614b5c2889dd946a12430466bf12ab05b3e016a1d0513adc5",
+ "bytes": 283,
+ "line": 17
},
{
"lang": "yaml",
"meta": null,
- "sha256": "ca65367d373ed281d6a04c4677304bffbbc0c590d97d958f02404d65476790bd",
- "bytes": 701,
- "line": 85
+ "sha256": "84405c74a75c67ed1bc625e4e34d7b0b9478d45813f33123140b798558b77c1d",
+ "bytes": 246,
+ "line": 39
},
{
"lang": "bash",
"meta": null,
- "sha256": "2c02be05f3177ceb5daa6aa1598f3b56d79d929eadb8d3c64463697fc68cbfb4",
- "bytes": 89,
- "line": 129
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "b9ce9aab8d379f8e9173ab0d3fff2feaee5253bd26c6db477e96e984e9925970",
- "bytes": 176,
- "line": 138
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "ed8c55ae5557bb7dbe7bf3c4e6fea6d0a1afaab691bfaf5452bd19707cf5df59",
- "bytes": 193,
- "line": 160
+ "sha256": "0c90920382a178af3212ac2d26018c4f0aecb3f9217a14ed5d8488b9bc5e211e",
+ "bytes": 246,
+ "line": 58
},
{
"lang": "yaml",
"meta": null,
- "sha256": "49ba0eabaea74095c7bf5b0d0a73d16eb74cc1eba7a112fa2c98311345dd750e",
- "bytes": 214,
- "line": 176
+ "sha256": "f59ec3275ed7c68f6344730b88ef298e1ce783bbbcd44c3b9739bd41f35f66e8",
+ "bytes": 327,
+ "line": 73
},
{
- "lang": "yaml",
+ "lang": "bash",
"meta": null,
- "sha256": "a1f59ab8940c1e0727969aa6e93265c859abb5faadabf08c4cc9a4a4c0b42dfe",
- "bytes": 821,
- "line": 196
+ "sha256": "5be90d7d7543c70516f4484c8b28763e82fba5f7daa109ea1a4b844be44df315",
+ "bytes": 120,
+ "line": 101
},
{
"lang": "bash",
"meta": null,
- "sha256": "c970c43eea56151320bf4b5baa8118312be6dbfcf47eff7caf2210731151e359",
- "bytes": 130,
- "line": 232
+ "sha256": "48c99b9c742f1bc6ae99c9012f6b8802b3744d55ac8a7b2d04f0167ca620a501",
+ "bytes": 469,
+ "line": 108
},
{
"lang": "bash",
"meta": null,
- "sha256": "435f49c9e945d503a636fddd938177b9ad0a636c84beb105497ae112e8eec8a0",
- "bytes": 864,
- "line": 247
+ "sha256": "60db81cc5f0caa33c94f16c9b46e61c6a7828eba7476ea1b8a1b5462cd6540c2",
+ "bytes": 132,
+ "line": 125
},
{
"lang": "bash",
"meta": null,
"sha256": "1dfa426d61e4433a888e565f694495f8448d610d39b8ca1155a8618ff6fed976",
"bytes": 183,
- "line": 276
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "cd0ac7ab8f17cb150bab5af98e3f9e9cec28e9380e7ffe50de20b484545befa2",
- "bytes": 288,
- "line": 289
+ "line": 132
},
{
"lang": "yaml",
"meta": null,
- "sha256": "7829d9f42845f3c88229a162bca612db3a9e1dc7c09c70e530de7daf539c97a7",
- "bytes": 194,
- "line": 303
+ "sha256": "207088e025099f04bf89601a4f6aad7b26c573440c9069b2109a5e872fb35d3f",
+ "bytes": 177,
+ "line": 145
},
{
- "lang": "bash",
+ "lang": "yaml",
"meta": null,
- "sha256": "5c09247e6bc794856c1f448ef7995291c75ad497932c62ba34b939954f5fa008",
- "bytes": 56,
- "line": 322
+ "sha256": "306ec6bde91579a1af788025c03f1820346885fb17ef0e830924594486142d3e",
+ "bytes": 595,
+ "line": 160
},
{
"lang": "bash",
"meta": null,
- "sha256": "c5ced9ed370a89467beea58fd96e856c138a2c9e92835ba5a94e7ddaf2030a36",
- "bytes": 117,
- "line": 333
+ "sha256": "c970c43eea56151320bf4b5baa8118312be6dbfcf47eff7caf2210731151e359",
+ "bytes": 125,
+ "line": 189
},
{
"lang": "bash",
"meta": null,
- "sha256": "486ac558c4262f2f4cf319ccb39b6883911bb16cd173cabf47980a246bd1b32b",
- "bytes": 40,
- "line": 342
+ "sha256": "2b6415fa7efbc8b975a436aca07bccba951ff6829ac2972dca3bd792f25ab804",
+ "bytes": 381,
+ "line": 203
}
],
"links": [
@@ -174815,11 +174343,6 @@
"url": "#tracing",
"depth": 2
},
- {
- "title": "Trigger.dev task telemetry",
- "url": "#triggerdev-task-telemetry",
- "depth": 3
- },
{
"title": "Related docs",
"url": "#related-docs",
@@ -174916,33 +174439,43 @@
"media": []
},
{
- "source": "platform/self-hosting/platforms.mdx",
- "url": "/platform/self-hosting/platforms",
- "sha256": "367d318c30685039d01073d8242050b4e1de5671bd8a3bbed2d2de5b276faa7f",
- "bytes": 4693,
+ "source": "platform/self-hosting/redis.mdx",
+ "url": "/platform/self-hosting/redis",
+ "sha256": "96de7179b06aca1377adde853e1ee528aa394bba0f1f5739c73324cc53bac8ee",
+ "bytes": 6715,
"frontmatter": {
- "title": "Cloud platforms",
- "description": "Provider-specific requirements for Railway, a VPS, or managed Kubernetes"
+ "title": "Redis",
+ "description": "Why Sim requires Redis, what it backs, and how to configure it"
},
"headings": [
{
- "title": "Railway",
- "url": "#railway",
+ "title": "What it backs",
+ "url": "#what-it-backs",
"depth": 2
},
{
- "title": "VPS",
- "url": "#vps",
+ "title": "Eviction policy",
+ "url": "#eviction-policy",
+ "depth": 3
+ },
+ {
+ "title": "Configuration",
+ "url": "#configuration",
"depth": 2
},
{
- "title": "Managed Kubernetes",
- "url": "#managed-kubernetes",
+ "title": "Managed Redis",
+ "url": "#managed-redis",
+ "depth": 3
+ },
+ {
+ "title": "TLS to an IP address",
+ "url": "#tls-to-an-ip-address",
"depth": 2
},
{
- "title": "Managed PostgreSQL",
- "url": "#managed-postgresql",
+ "title": "Verify Redis",
+ "url": "#verify-redis",
"depth": 2
},
{
@@ -174953,118 +174486,19 @@
],
"explicitIds": [],
"imports": [
- {
- "source": "fumadocs-ui/components/callout",
- "names": [
- {
- "local": "Callout",
- "imported": "Callout"
- }
- ]
- }
- ],
- "components": [
- {
- "name": "Callout",
- "attributes": {
- "type": "warn"
- },
- "line": 17
- }
- ],
- "expressions": [],
- "codeFences": [
- {
- "lang": "bash",
- "meta": null,
- "sha256": "20ef913ead74628437378a3f1b6bfa0974ef419c43f8fd0ce6242e4c5477688b",
- "bytes": 83,
- "line": 54
- }
- ],
- "links": [
- "/platform/self-hosting/docker",
- "/platform/self-hosting/kubernetes",
- "https://railway.com/new/template/sim-studio",
- "/platform/self-hosting/background-jobs",
- "https://docs.railway.com/cron-jobs",
- "/platform/self-hosting#requirements",
- "https://docs.docker.com/engine/install/",
- "/platform/self-hosting/docker",
- "/platform/self-hosting/kubernetes",
- "/platform/self-hosting/networking",
- "https://docs.cloud.google.com/sql/docs/postgres/extensions",
- "https://learn.microsoft.com/en-us/azure/postgresql/extensions/how-to-allow-extensions",
- "https://neon.com/docs/extensions/pgvector",
- "/platform/self-hosting/kubernetes#external-database",
- "/platform/self-hosting/docker#production-setup",
- "/platform/self-hosting/reference-architectures",
- "/platform/self-hosting/verify",
- "/platform/self-hosting/upgrades"
- ],
- "media": []
- },
- {
- "source": "platform/self-hosting/redis.mdx",
- "url": "/platform/self-hosting/redis",
- "sha256": "96de7179b06aca1377adde853e1ee528aa394bba0f1f5739c73324cc53bac8ee",
- "bytes": 6715,
- "frontmatter": {
- "title": "Redis",
- "description": "Why Sim requires Redis, what it backs, and how to configure it"
- },
- "headings": [
- {
- "title": "What it backs",
- "url": "#what-it-backs",
- "depth": 2
- },
- {
- "title": "Eviction policy",
- "url": "#eviction-policy",
- "depth": 3
- },
- {
- "title": "Configuration",
- "url": "#configuration",
- "depth": 2
- },
- {
- "title": "Managed Redis",
- "url": "#managed-redis",
- "depth": 3
- },
- {
- "title": "TLS to an IP address",
- "url": "#tls-to-an-ip-address",
- "depth": 2
- },
- {
- "title": "Verify Redis",
- "url": "#verify-redis",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
- }
- ],
- "explicitIds": [],
- "imports": [
- {
- "source": "@/components/ui/tabs",
- "names": [
- {
- "local": "Tab",
- "imported": "Tab"
- },
- {
- "local": "Tabs",
- "imported": "Tabs"
- }
- ]
- },
+ {
+ "source": "@/components/ui/tabs",
+ "names": [
+ {
+ "local": "Tab",
+ "imported": "Tab"
+ },
+ {
+ "local": "Tabs",
+ "imported": "Tabs"
+ }
+ ]
+ },
{
"source": "fumadocs-ui/components/callout",
"names": [
@@ -175155,35 +174589,10 @@
"description": "What you provision and what the chart provisions, per cloud, before you run helm install"
},
"headings": [
- {
- "title": "The boundary",
- "url": "#the-boundary",
- "depth": 2
- },
{
"title": "Per-cloud requirements",
"url": "#per-cloud-requirements",
"depth": 2
- },
- {
- "title": "Secrets",
- "url": "#secrets",
- "depth": 2
- },
- {
- "title": "Sizing",
- "url": "#sizing",
- "depth": 2
- },
- {
- "title": "Calling the chart from Terraform",
- "url": "#calling-the-chart-from-terraform",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -175272,15 +174681,7 @@
}
],
"expressions": [],
- "codeFences": [
- {
- "lang": "hcl",
- "meta": null,
- "sha256": "354db2a0e5b33298a44cfe1ea9639369ba91f42bc2f6038a16a87c5da3bb53ae",
- "bytes": 1381,
- "line": 142
- }
- ],
+ "codeFences": [],
"links": [
"/platform/self-hosting/sandboxes",
"/platform/self-hosting/object-storage",
@@ -175731,16 +175132,6 @@
"url": "#pre-launch-checklist",
"depth": 2
},
- {
- "title": "Restricting who can use the instance",
- "url": "#restricting-who-can-use-the-instance",
- "depth": 2
- },
- {
- "title": "Client IP and forwarded headers",
- "url": "#client-ip-and-forwarded-headers",
- "depth": 2
- },
{
"title": "Secrets",
"url": "#secrets",
@@ -175751,11 +175142,6 @@
"url": "#account-token-sealing",
"depth": 3
},
- {
- "title": "Storing them",
- "url": "#storing-them",
- "depth": 3
- },
{
"title": "Network boundaries",
"url": "#network-boundaries",
@@ -175796,11 +175182,6 @@
"url": "#the-ssrf-boundary",
"depth": 2
},
- {
- "title": "Upgrading from an earlier release",
- "url": "#upgrading-from-an-earlier-release",
- "depth": 3
- },
{
"title": "Response size cap",
"url": "#response-size-cap",
@@ -175894,75 +175275,82 @@
],
"expressions": [],
"codeFences": [
+ {
+ "lang": "bash",
+ "meta": null,
+ "sha256": "d6c1bc7d7a1d0ac8476e5b0c0819755beb9d67564e8c0aae8ad0e49a88cc56b2",
+ "bytes": 307,
+ "line": 64
+ },
{
"lang": "yaml",
"meta": null,
"sha256": "d2548fced54a0f26df513f23562741d37cf411569e6070c0e5e83af42dea923f",
"bytes": 30,
- "line": 98
+ "line": 85
},
{
"lang": "yaml",
"meta": null,
"sha256": "4b119b9923af4a285af84dfe3ff39b5a42278ddbda2d450a0b9da7afeb27fbfd",
"bytes": 129,
- "line": 106
+ "line": 93
},
{
"lang": "yaml",
"meta": null,
"sha256": "1286f5b957d8aae8c5e5ba37b8deaa088e40642bd303c6ba0a4a4e6ef1a8c658",
"bytes": 295,
- "line": 119
+ "line": 106
},
{
"lang": "yaml",
"meta": null,
"sha256": "1d6790fb0ffae5ee4bde0dfe5b5fe40f091c241a4936378b37cd299aa107ff7c",
"bytes": 58,
- "line": 139
+ "line": 126
},
{
"lang": "bash",
"meta": null,
"sha256": "5380d663506380272ec502d0cceaef927d173f2836daec02c78c0fc892769919",
"bytes": 79,
- "line": 166
+ "line": 153
},
{
"lang": "bash",
"meta": null,
"sha256": "4fd1ce391cf85e5093c6348b4d57dac12c1302939037c308314bd8e12c260b38",
"bytes": 117,
- "line": 241
+ "line": 218
},
{
"lang": "bash",
"meta": null,
"sha256": "68d150e3ac8a0f2ab0a0a8e7b7f000dd0b4eeb533f074057fc3f0272e314b060",
"bytes": 41,
- "line": 259
+ "line": 236
},
{
"lang": "yaml",
"meta": null,
"sha256": "97a9e97bd237a84b46a8dd55ddde2685442b763d4b00279d9b4d6db05883cfae",
"bytes": 110,
- "line": 293
+ "line": 261
},
{
"lang": "yaml",
"meta": null,
"sha256": "dd2274ef28334de3fd41b204f57e8af3c3fba12c3af4457c44234c72da35b56c",
"bytes": 551,
- "line": 306
+ "line": 274
},
{
"lang": "yaml",
"meta": null,
"sha256": "a6efcc859a8531bfec1e7434aded7fbbacd567afe8875f4bdee025f428f267d2",
"bytes": 137,
- "line": 350
+ "line": 318
}
],
"links": [
@@ -175986,131 +175374,16 @@
"description": "Diagnose deployment, network, storage, model, and scheduler failures"
},
"headings": [
- {
- "title": "Run sim-setup doctor",
- "url": "#run-sim-setup-doctor",
- "depth": 2
- },
- {
- "title": "502 Bad Gateway",
- "url": "#502-bad-gateway",
- "depth": 2
- },
- {
- "title": "Database connection failed",
- "url": "#database-connection-failed",
- "depth": 2
- },
- {
- "title": "Migration errors",
- "url": "#migration-errors",
- "depth": 2
- },
- {
- "title": "pgvector not found",
- "url": "#pgvector-not-found",
- "depth": 2
- },
- {
- "title": "Kubernetes app pods never become ready",
- "url": "#kubernetes-app-pods-never-become-ready",
- "depth": 2
- },
- {
- "title": "Kubernetes ImagePullBackOff",
- "url": "#kubernetes-imagepullbackoff",
- "depth": 2
- },
- {
- "title": "Kubernetes PostgreSQL pod pending",
- "url": "#kubernetes-postgresql-pod-pending",
- "depth": 2
- },
- {
- "title": "Blank page after login",
- "url": "#blank-page-after-login",
- "depth": 2
- },
- {
- "title": "WebSocket and realtime not working",
- "url": "#websocket-and-realtime-not-working",
- "depth": 2
- },
- {
- "title": "WebSockets disconnect every 30 seconds",
- "url": "#websockets-disconnect-every-30-seconds",
- "depth": 2
- },
- {
- "title": "Agent output arrives all at once",
- "url": "#agent-output-arrives-all-at-once",
- "depth": 2
- },
- {
- "title": "Collaboration breaks with multiple replicas",
- "url": "#collaboration-breaks-with-multiple-replicas",
- "depth": 2
- },
- {
- "title": "App refuses to start: REDIS_URL is required",
- "url": "#app-refuses-to-start-redis_url-is-required",
- "depth": 2
- },
- {
- "title": "App crashes at startup with a REDIS_TLS_SERVERNAME error",
- "url": "#app-crashes-at-startup-with-a-redis_tls_servername-error",
- "depth": 2
- },
- {
- "title": "Certificate errors (CERT_HAS_EXPIRED)",
- "url": "#certificate-errors-cert_has_expired",
- "depth": 2
- },
{
"title": "A workflow cannot reach a service on your network",
"url": "#a-workflow-cannot-reach-a-service-on-your-network",
"depth": 2
},
- {
- "title": "Ollama models not showing",
- "url": "#ollama-models-not-showing",
- "depth": 2
- },
- {
- "title": "LM Studio requests route to Ollama",
- "url": "#lm-studio-requests-route-to-ollama",
- "depth": 2
- },
- {
- "title": "File uploads fail with a CORS error",
- "url": "#file-uploads-fail-with-a-cors-error",
- "depth": 2
- },
- {
- "title": "Knowledge base upload fails",
- "url": "#knowledge-base-upload-fails",
- "depth": 2
- },
- {
- "title": "Scheduled workflows never run",
- "url": "#scheduled-workflows-never-run",
- "depth": 2
- },
- {
- "title": "Gmail, Drive, and Outlook triggers never fire",
- "url": "#gmail-drive-and-outlook-triggers-never-fire",
- "depth": 2
- },
{
"title": "Credentials unreadable after a restore",
"url": "#credentials-unreadable-after-a-restore",
"depth": 2
},
- {
- "title": "Windows-specific issues",
- "url": "#windows-specific-issues",
- "depth": 2
- },
{
"title": "Get help",
"url": "#get-help",
@@ -176122,138 +175395,26 @@
"components": [],
"expressions": [],
"codeFences": [
- {
- "lang": "bash",
- "meta": null,
- "sha256": "28b55f7fe8f07a34e08d95fd5517b6d6bbbb21984c824825fdeaf8e008a8158f",
- "bytes": 137,
- "line": 12
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "f53db8ab234bd8bc5fcc3d58410b791feda6c3ee388860a2cfe3af51534c2ae3",
- "bytes": 229,
- "line": 22
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "fa72373581093369f53d01fe1fb8c39b3d718591d0ee29ee6e3e7bb14752cca0",
- "bytes": 318,
- "line": 32
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "3cecb71d565f222bc89348c8063e2a7bf072a97fda47d8f28777dd03ffdfe02f",
- "bytes": 167,
- "line": 50
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "689d5e0f169abc2f9a9fd1c5ef618ca9aa8257cc3fae3f15c70ec3e81e387f5a",
- "bytes": 65,
- "line": 60
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "d376cd2a53779eeac8931cbad3f40e5ebb4f8ef1ca1e8b232f86beee2b5ba471",
- "bytes": 48,
- "line": 67
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "0297fdeeaaad204b960ec9384c842991c7e6ef5a6fa46a3c0c37c512cd95b6b0",
- "bytes": 107,
- "line": 75
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "b8210a5f0b455614cd2657e2a4fc4e7d77a0c02524b56b77722f69c559391507",
- "bytes": 33,
- "line": 88
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "236c9446662bbb3595b6501e5d963453498a6064c7a66078dd437baadf3713b8",
- "bytes": 204,
- "line": 119
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "c54df79de3f702f739f9fe5c288c3a9fcc348197d33272df3187cf74b5ad8117",
- "bytes": 197,
- "line": 142
- },
{
"lang": "yaml",
"meta": null,
- "sha256": "7b4b8ea041d0669f220e56eeabcd0c5c906738646a647de5bb1a548983ffc2d3",
- "bytes": 280,
- "line": 152
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "4fd1ce391cf85e5093c6348b4d57dac12c1302939037c308314bd8e12c260b38",
- "bytes": 117,
- "line": 175
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "7a9aac79c13c638a232f991fc97e9076d7080ec7ac75d80c60eb780b42e1d4bd",
- "bytes": 76,
- "line": 191
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "ce7ef86fc4fbeab2fdae583b7e60a64259680ac3374b92e8c7641601ca35af93",
- "bytes": 207,
- "line": 204
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "8560a7167d89cfcd9241ccda8ad1ed21f36e8dc5f108714518fe306aadbd5222",
- "bytes": 61,
- "line": 235
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "a69235481ad1a0208b7ab7a563c83664dce5cc1ca5ec486ae08b9c10c194ca94",
- "bytes": 108,
- "line": 243
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "341e83bdf0029a50800e322164b960fd942b1344aa38b563aea95a5640ca103b",
- "bytes": 190,
- "line": 250
+ "sha256": "21df0c57e29055cd2455403c6a29266db4f624e393e227cd6f5c4839af495ce4",
+ "bytes": 277,
+ "line": 42
},
{
"lang": "bash",
"meta": null,
- "sha256": "62bb3e351950d9f5d7f8ed10bfae6fa61dddb02dcfbaa1a5a27f805d3c861df9",
- "bytes": 13,
- "line": 277
+ "sha256": "ddfa27bacdd33c18adb1372b067bbef95434cbafd9924ae646fc55cc17dd78d2",
+ "bytes": 105,
+ "line": 63
},
{
"lang": "bash",
"meta": null,
- "sha256": "7b2c4142afb1d9e4d4609bd3746ddf70d89307eda5cc804cf471c5527dbc3f3d",
- "bytes": 65,
- "line": 282
+ "sha256": "21bd4d10594243bfa2344276a6663e32b1072bf7531cece78e9174e0223cc4bb",
+ "bytes": 180,
+ "line": 84
}
],
"links": [
@@ -176292,41 +175453,11 @@
"url": "#configuration-changes",
"depth": 2
},
- {
- "title": "Helm chart 1.15",
- "url": "#helm-chart-115",
- "depth": 3
- },
{
"title": "Upgrade procedure",
"url": "#upgrade-procedure",
"depth": 2
},
- {
- "title": "Read the release notes",
- "url": "#read-the-release-notes",
- "depth": 3
- },
- {
- "title": "Take a backup",
- "url": "#take-a-backup",
- "depth": 3
- },
- {
- "title": "Rehearse against real data",
- "url": "#rehearse-against-real-data",
- "depth": 3
- },
- {
- "title": "Apply",
- "url": "#apply",
- "depth": 3
- },
- {
- "title": "Verify",
- "url": "#verify",
- "depth": 3
- },
{
"title": "Rolling back",
"url": "#rolling-back",
@@ -176337,25 +175468,10 @@
"url": "#when-a-migration-fails",
"depth": 2
},
- {
- "title": "Migration reference",
- "url": "#migration-reference",
- "depth": 2
- },
- {
- "title": "How concurrent replicas are handled",
- "url": "#how-concurrent-replicas-are-handled",
- "depth": 3
- },
{
"title": "Migration environment",
"url": "#migration-environment",
"depth": 3
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -176511,117 +175627,54 @@
],
"expressions": [],
"codeFences": [
- {
- "lang": null,
- "meta": null,
- "sha256": "f93d9b9699d57eef6c5baedda45e01aca67135784f44f13492672284f604eebb",
- "bytes": 89,
- "line": 20
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "33a7cb1f79416a3b078f4c2d3953ea8ecb51233ef385ded05fcff7c2de625747",
- "bytes": 206,
- "line": 33
- },
- {
- "lang": "yaml",
- "meta": null,
- "sha256": "5f0525543906c1d87f4f437be4b0e00016854267457f750a26617e34128ea749",
- "bytes": 38,
- "line": 47
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "604c9a7af00b436c8d715cd69060e20f2463e53e238cc37af9fd95b7e68941c1",
- "bytes": 26,
- "line": 58
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "2b11cb46a00678505e7f39b61358c1196e726b0096f84acb6944ffcdb9b4ff33",
- "bytes": 456,
- "line": 104
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "da6e6850a0e511be2f67ab172459517c51f2f4af3d9bb6252d5085937a6b3a92",
- "bytes": 128,
- "line": 132
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "c69cdeb2601d8c877245e94419c469259ed6978937626b1d81bf93a952a0e1b0",
- "bytes": 112,
- "line": 141
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "e91ed481dfd9e3b64d81b10df809bdd9b40543ff74d2d5cc32858912ffc85555",
- "bytes": 130,
- "line": 147
- },
{
"lang": "bash",
"meta": null,
- "sha256": "8b1b7dd0aa41d3378e82618677b50ff44a7b9cbbe71038d2c1d30b5480c070bc",
- "bytes": 274,
- "line": 157
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "ff1bd014f6d6327ed60b482b030a73278e8d7829940aa009687b6005698f5917",
- "bytes": 327,
- "line": 181
+ "sha256": "fdc9382fa13eeae01d99353655f8fe09c23a59e44f3bc979ca09a95e9fdad180",
+ "bytes": 25,
+ "line": 16
},
{
"lang": "bash",
"meta": null,
- "sha256": "f06da1c6caa3599e7e0498042c61dad4cb65c3fd390f1ca66f08d2d5d58f6b6a",
- "bytes": 30,
- "line": 221
+ "sha256": "b50d71970c84ee49664e12825a44282aa99b2bf5518e22802993072f6ca0a9d6",
+ "bytes": 376,
+ "line": 43
},
{
"lang": "bash",
"meta": null,
- "sha256": "2eeb472e1b9a01898d9b9f49f52fa6176917f9eb9e5ead4240b36a8061a47d26",
- "bytes": 245,
- "line": 225
+ "sha256": "feb3e18b75486b7c394f03202d9d0c9988cb9b5414b871bb1e1c9e714290b36f",
+ "bytes": 156,
+ "line": 65
},
{
"lang": "bash",
"meta": null,
- "sha256": "8446fa16e456c1c785b8888bcfc62395fc23e75a40795178bd70a276e26bcd36",
- "bytes": 119,
- "line": 234
+ "sha256": "e370616b78b0be7bde1ac989f2223a62480aaa0d4fe261bf58e0d6a8163ee501",
+ "bytes": 320,
+ "line": 93
},
{
"lang": "bash",
"meta": null,
- "sha256": "eaa8f9247177aab7ff05a6ee64cc60f48e8a6905fd3b4773b52568fc14e14ed0",
- "bytes": 94,
- "line": 241
+ "sha256": "02d668fc71ca114a5011b0ed94aa52605b6ea8f14acd9c8b19625ca7fb4ca224",
+ "bytes": 510,
+ "line": 107
},
{
"lang": "bash",
"meta": null,
- "sha256": "689d5e0f169abc2f9a9fd1c5ef618ca9aa8257cc3fae3f15c70ec3e81e387f5a",
- "bytes": 65,
- "line": 261
+ "sha256": "ab96ca8a7a2eec88c77420d9ef147117afca58e122788dc051b295727bd1e1d8",
+ "bytes": 148,
+ "line": 138
},
{
"lang": "bash",
"meta": null,
- "sha256": "e25438beeab6ee8d89c44a1d2e8c5b1d0f48973c6167530dc7b2ec0e7057a9c7",
- "bytes": 98,
- "line": 265
+ "sha256": "d26f485bd0d3d8f97660a88a62633bbe790d3041d12fd037594b86c77a4be76e",
+ "bytes": 123,
+ "line": 147
}
],
"links": [
@@ -176672,21 +175725,6 @@
"title": "Read failures",
"url": "#reading-the-failures",
"depth": 2
- },
- {
- "title": "After an upgrade",
- "url": "#after-an-upgrade",
- "depth": 2
- },
- {
- "title": "After a restore",
- "url": "#after-a-restore",
- "depth": 2
- },
- {
- "title": "Related docs",
- "url": "#related-docs",
- "depth": 2
}
],
"explicitIds": [],
@@ -176724,28 +175762,21 @@
"meta": null,
"sha256": "76422de41fcefba9fc85682b50cf9b41f5990ec1b095efb82638f80ac1d0bdc7",
"bytes": 20,
- "line": 14
+ "line": 10
},
{
"lang": "bash",
"meta": null,
"sha256": "2b429e9ae7f9db3458cc7454832e8efc7e3fc1b5488341a6550232366ee37b8a",
"bytes": 176,
- "line": 76
- },
- {
- "lang": "bash",
- "meta": null,
- "sha256": "972a14b714c62cc21bd264c9989fce138554e02c0ed15fa8b1e88186cc9e4524",
- "bytes": 72,
- "line": 87
+ "line": 59
},
{
"lang": "bash",
"meta": null,
- "sha256": "0ffd89002366f16afaeeda3a0f16f7b1a19c043b1ff893a2e48ee3f8aac6689d",
- "bytes": 200,
- "line": 95
+ "sha256": "cc57f42eda5615eb970b3186a04e5980abddc594f8ec674656f588cc53cf0232",
+ "bytes": 153,
+ "line": 70
}
],
"links": [
diff --git a/apps/sim/lib/mothership/generated/docs-manifest.ts b/apps/sim/lib/mothership/generated/docs-manifest.ts
index 802967e8f29..489c46fb56b 100644
--- a/apps/sim/lib/mothership/generated/docs-manifest.ts
+++ b/apps/sim/lib/mothership/generated/docs-manifest.ts
@@ -889,10 +889,10 @@ export const DOCS_MANIFEST: readonly string[] = [
'platform/self-hosting/environment-variables.mdx',
'platform/self-hosting/integrations-oauth.mdx',
'platform/self-hosting/kubernetes.mdx',
+ 'platform/self-hosting/local-models.mdx',
'platform/self-hosting/networking.mdx',
'platform/self-hosting/object-storage.mdx',
'platform/self-hosting/observability.mdx',
- 'platform/self-hosting/platforms.mdx',
'platform/self-hosting/redis.mdx',
'platform/self-hosting/reference-architectures.mdx',
'platform/self-hosting/sandboxes.mdx',
diff --git a/helm/sim/Chart.yaml b/helm/sim/Chart.yaml
index 58c4d257c85..7441336a4d4 100644
--- a/helm/sim/Chart.yaml
+++ b/helm/sim/Chart.yaml
@@ -2,7 +2,7 @@ apiVersion: v2
name: sim
description: A Helm chart for Sim - the open-source AI workspace where teams build, deploy, and manage AI agents
type: application
-version: 1.22.0
+version: 1.22.1
appVersion: "v0.8.26"
kubeVersion: ">=1.25.0-0"
home: https://sim.ai
diff --git a/helm/sim/README.md b/helm/sim/README.md
index 2c78cafc5ed..2de4d77fead 100644
--- a/helm/sim/README.md
+++ b/helm/sim/README.md
@@ -1,6 +1,6 @@
# Sim Helm Chart
-Deploy [Sim](https://sim.ai) — the open-source AI workspace where teams build, deploy, and manage AI agents — on Kubernetes.
+Deploy [Sim](https://sim.ai) — the open-source AI workspace where teams build, deploy, and manage AI agents — on Kubernetes. The full installation guide is at [docs.sim.ai](https://docs.sim.ai/platform/self-hosting/kubernetes).
* **Registry:** `oci://ghcr.io/simstudioai/charts/sim`
* **Helm repository:** `https://charts.sim.ai`
@@ -17,9 +17,10 @@ Deploy [Sim](https://sim.ai) — the open-source AI workspace where teams build,
# Generate required secrets
export BETTER_AUTH_SECRET=$(openssl rand -hex 32)
export ENCRYPTION_KEY=$(openssl rand -hex 32)
+export API_ENCRYPTION_KEY=$(openssl rand -hex 32)
export INTERNAL_API_SECRET=$(openssl rand -hex 32)
export CRON_SECRET=$(openssl rand -hex 32)
-export POSTGRES_PASSWORD=$(openssl rand -base64 24 | tr -d '/+=')
+export POSTGRES_PASSWORD=$(openssl rand -hex 24)
# Pin the newest published chart version; record it for upgrades
export CHART_VERSION=$(helm show chart oci://ghcr.io/simstudioai/charts/sim | awk '/^version:/ {print $2}')
@@ -30,12 +31,13 @@ helm install sim oci://ghcr.io/simstudioai/charts/sim \
--namespace sim --create-namespace \
--set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
--set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
+ --set app.env.API_ENCRYPTION_KEY="$API_ENCRYPTION_KEY" \
--set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
--set app.env.CRON_SECRET="$CRON_SECRET" \
--set postgresql.auth.password="$POSTGRES_PASSWORD"
```
-After install, follow the on-screen `NOTES.txt` to reach the app.
+After install, follow the on-screen `NOTES.txt` to reach the app. Store the secrets durably: the encryption keys cannot be recovered, and a new install with new keys cannot read an existing database.
---
@@ -47,14 +49,14 @@ This chart deploys the Sim platform on a Kubernetes cluster using the Helm packa
* **`realtime`** — the WebSocket service for live workflow updates (Deployment).
* **`postgresql`** — an in-cluster `pgvector/pgvector` Postgres (StatefulSet, with a headless Service for stable per-pod DNS).
* **`migrations`** — an init container on the app Deployment that applies database migrations before each app pod starts.
-* **`cronjobs`** — scheduled jobs for workflow schedule execution, inbox/calendar/drive polling (Gmail, Outlook, Calendar, Drive, Sheets, IMAP, RSS), workspace event and HubSpot webhook polling, outbox processing, subscription renewal, billing-seat and inbox-entitlement reconciliation, time-pause/resume polling, data drains, and connector syncs.
+* **`cronjobs`** — the scheduled jobs: workflow schedules, polling triggers, connector syncs, outbox processing, and cleanup. Each job's purpose is its `description` in `values.yaml`; see [Background jobs](https://docs.sim.ai/platform/self-hosting/background-jobs).
* **`serviceaccount`** — a dedicated ServiceAccount with `automountServiceAccountToken: false`.
Optional components (off by default):
* **`copilot`** — the Sim Copilot service plus its own Postgres StatefulSet.
* **`ollama`** — local LLM inference, with optional NVIDIA GPU support.
-* **`pii`** — Presidio PII redaction service (analyzer + anonymizer) for the Guardrails PII block and log redaction. See [PII redaction](#pii-redaction).
+* **`pii`** — Presidio PII redaction service (analyzer + anonymizer) for the Guardrails PII block and log redaction. See [PII redaction](#pii-redaction-and-troubleshooting).
* **`telemetry`** — OpenTelemetry Collector wired to Jaeger / Prometheus / OTLP backends.
* **`ingress`** — NGINX-style Ingress for the app and realtime services.
* **`networkPolicy`** — east-west and egress isolation (blocks cloud metadata endpoints by default).
@@ -79,26 +81,6 @@ Optional components (off by default):
---
-## Generate required secrets
-
-Sim will not start without these. Generate them once and feed them via `--set`, an existing Kubernetes Secret, or External Secrets Operator.
-
-```bash
-# Application secrets (32 bytes hex each)
-openssl rand -hex 32 # BETTER_AUTH_SECRET - signs auth JWTs
-openssl rand -hex 32 # ENCRYPTION_KEY - encrypts sensitive env vars
-openssl rand -hex 32 # INTERNAL_API_SECRET - service-to-service auth
-openssl rand -hex 32 # CRON_SECRET - required if cronjobs.enabled (default true)
-openssl rand -hex 32 # API_ENCRYPTION_KEY - optional; encrypts user API keys at rest
-
-# Postgres password
-openssl rand -base64 24 | tr -d '/+='
-```
-
-If you set `app.secrets.existingSecret.enabled=true` and point at a pre-created Secret, you do **not** also pass these via `--set` — pick one path.
-
----
-
## Installing the chart
### From the registry
@@ -113,16 +95,6 @@ helm show chart oci://ghcr.io/simstudioai/charts/sim | grep -E '^(version|appVer
# Every published version (or `helm search repo sim/sim --versions` after adding the Helm repository below)
crane ls ghcr.io/simstudioai/charts/sim
-
-# $CHART_VERSION is set in the TL;DR; to pin another version, export it as one listed above
-helm install sim oci://ghcr.io/simstudioai/charts/sim \
- --version "$CHART_VERSION" \
- --namespace sim --create-namespace \
- --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
- --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
- --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
- --set app.env.CRON_SECRET="$CRON_SECRET" \
- --set postgresql.auth.password="$POSTGRES_PASSWORD"
```
Always pass `--version`. Without it Helm resolves to the newest published
@@ -132,96 +104,11 @@ deployments on different days. Every example in this README uses the
### Air-gapped installs
-To mirror the chart into an internal registry — the usual requirement for an
-air-gapped or internal-only cluster:
-
-```bash
-helm pull oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION"
-helm push "sim-${CHART_VERSION}.tgz" oci://registry.internal.example.com/charts
-```
-
-Every container image that version can render is listed in its `images.yaml`,
-packaged inside the chart. It is also attached to the chart's GitHub release
-([`helm-chart-`](https://github.com/simstudioai/sim/releases?q=helm-chart&expanded=true))
-for review without Helm; charts published before that asset existed carry it
-only in the package. Use the copy from the version you install: the publish job
-regenerates it with that chart's `appVersion`, so the first-party tags in the
-checked-in [`images.yaml`](./images.yaml) may name an older release than any
-published chart.
-
-Each entry pairs the reference to pull from (`source`) with the path the chart
-pulls once redirected (`mirror`). With [crane](https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md)
-and [yq](https://github.com/mikefarah/yq):
-
-```bash
-REGISTRY=registry.internal.example.com
-tar -xzOf "sim-${CHART_VERSION}.tgz" sim/images.yaml > images.yaml
-yq -r '.images[] | .source + " " + .mirror' images.yaml |
- while read -r source mirror; do
- crane copy "$source" "${REGISTRY}/${mirror}"
- done
-```
-
-`crane copy` keeps every architecture and the original digests. Then install
-with `global.imageRegistry=$REGISTRY` and `global.useRegistryForAllImages=true`,
-and pin each image's `digest` to what your mirror resolved. Mirror from the
-published chart's `images.yaml`, which also lists the sandbox images its
-appVersion runs. Skip the `simstudioai/copilot*` images (enterprise) and the
-`simstudioai/sandbox-*` and `pause` images (Kubernetes sandbox provider) if you
-do not use them. The Mothership's entries carry the placeholder tag
-`main-REPLACE`: substitute the `main-` tag from its release notes. The
-header of `images.yaml` covers this and the one image whose mirror path differs.
-
-### From the Helm repository
-
-The chart is also published to a classic Helm repository, for clusters and
-tooling that consume `helm repo add` rather than OCI.
-
-```bash
-helm repo add sim https://charts.sim.ai
-helm repo update
-
-helm install sim sim/sim \
- --version "$CHART_VERSION" \
- --namespace sim --create-namespace \
- --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
- --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
- --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
- --set app.env.CRON_SECRET="$CRON_SECRET" \
- --set postgresql.auth.password="$POSTGRES_PASSWORD"
-```
-
-Both paths serve the same chart. Prefer OCI where you can: the signature and
-provenance described in [Verifying the chart](#verifying-the-chart) are attached
-to the OCI artifact, and `helm repo add` has no equivalent.
-
-### From a checkout
-
-```bash
-helm install sim ./helm/sim \
- --namespace sim --create-namespace \
- --set app.env.BETTER_AUTH_SECRET="$BETTER_AUTH_SECRET" \
- --set app.env.ENCRYPTION_KEY="$ENCRYPTION_KEY" \
- --set app.env.INTERNAL_API_SECRET="$INTERNAL_API_SECRET" \
- --set app.env.CRON_SECRET="$CRON_SECRET" \
- --set postgresql.auth.password="$POSTGRES_PASSWORD"
-```
-
-The remaining examples in this README use the OCI reference. If you are working
-from a checkout, substitute `./helm/sim` and drop `--version` — the commands are
-otherwise identical.
+Every image a chart version can render is listed in its packaged `images.yaml` (also attached to its [`helm-chart-`](https://github.com/simstudioai/sim/releases?q=helm-chart&expanded=true) GitHub release). See [Air-gapped installs](https://docs.sim.ai/platform/self-hosting/kubernetes#air-gapped-installs) for the mirror commands.
-### With a values file
+### From the Helm repository or a checkout
-```bash
-helm install sim oci://ghcr.io/simstudioai/charts/sim \
- --version "$CHART_VERSION" \
- --namespace sim --create-namespace \
- --values my-values.yaml
-```
-
-Run `helm template oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION" --values my-values.yaml | less` first to
-see what will be applied.
+`helm repo add sim https://charts.sim.ai` and install `sim/sim` with the same `--version` and values; chart signatures are attached to the OCI artifact only. From a checkout, install `./helm/sim` without `--version`. Run `helm template` with your values first to review what will be applied.
### Validate the install
@@ -259,25 +146,7 @@ the app image has no self-check endpoint. Disable it with
## Verifying the chart
-Every published version is signed with [Sigstore](https://www.sigstore.dev/)
-keyless signing and carries a SLSA build-provenance attestation, both stored in
-the registry next to the chart so they survive a mirror.
-
-```bash
-# The signature: proves this chart was signed by a GitHub Actions run in this repo
-cosign verify "ghcr.io/simstudioai/charts/sim:$CHART_VERSION" \
- --certificate-identity-regexp '^https://github.com/simstudioai/sim/' \
- --certificate-oidc-issuer https://token.actions.githubusercontent.com
-
-# The provenance: proves which workflow, commit, and runner produced it
-gh attestation verify "oci://ghcr.io/simstudioai/charts/sim:$CHART_VERSION" --repo simstudioai/sim
-```
-
-There is no GPG `.prov` file — signing is Sigstore-only, so there is no
-long-lived private key to hold or rotate. `helm install --verify` expects the
-GPG provenance format and will not work; use `cosign verify` above.
-
-> **Requires cosign v3.0 or newer.** Signatures use the Sigstore protobuf bundle format, which cosign v3 writes by default and cosign v2 cannot read. cosign v3.1+ auto-detects both formats.
+Published charts carry Sigstore keyless signatures and SLSA build-provenance attestations; verify them with cosign 3.0 or later as described in [Verify the chart](https://docs.sim.ai/platform/self-hosting/security#verify-the-chart).
## Upgrading
@@ -375,121 +244,9 @@ or extract it from a pulled chart with `helm pull --untar`.
---
-## Production checklist
-
-Before installing in production, confirm each of the following:
-
-* **High availability** — scale `app.replicaCount > 1`, which needs object storage (S3, Azure Blob, or GCS; see `STORAGE_PROVIDER`) or the `app.storage.allowLocalWithReplicas` opt-out. The chart auto-creates a `PodDisruptionBudget` with `maxUnavailable: "25%"`. Set `podDisruptionBudget.minAvailable` instead for a stricter policy.
-* **Pinned images** — override `image.tag` (or `image.digest`) with an explicit version. Do not rely on the chart's default tag in production.
-* **Secrets management** — provide secrets via External Secrets Operator (ESO) or pre-created Kubernetes Secrets. Never commit secrets to `values.yaml`.
-* **TLS / Ingress** — set the `cert-manager.io/cluster-issuer` annotation on the ingress and tune `proxy-body-size` / `proxy-read-timeout` for your workload. See commented examples in `values.yaml`.
-* **Network policy egress** — review `networkPolicy.egressExceptCidrs`. Defaults block cloud metadata endpoints (`169.254.169.254/32`, `169.254.170.2/32`); add your cluster's API server CIDR for stronger isolation. Custom egress rules go in `networkPolicy.egress` (a list).
-
- **Every datastore you run outside the chart needs its own egress rule.** The default policy allows HTTPS (443) plus the bundled Postgres and Redis by pod selector — nothing else on a non-443 port. So a managed Postgres, a managed Redis, or any `REDIS_URL` you supply through a Secret is reachable only if you add a rule for it. This bites hardest when the URL comes from a Secret, because the chart cannot see the host and cannot generate the rule for you:
-
- ```yaml
- networkPolicy:
- enabled: true
- egress:
- - to:
- - ipBlock:
- cidr: 10.0.0.0/16 # your VPC / managed-service subnet
- ports:
- - protocol: TCP
- port: 6379 # managed Redis
- - protocol: TCP
- port: 5432 # managed Postgres
- ```
+## Production checklist and secrets
- If you would rather not maintain CIDR lists, `networkPolicy.allowExternalEgress: true` drops the port restriction entirely while still blocking the cloud metadata endpoints. It defaults to `false` — this chart is deliberately stricter than the common chart default of unrestricted egress.
-* **Network policy ingress** — `networkPolicy.ingressFrom` defaults to `[{}]` (an empty peer selector), which allows ingress traffic from **any pod in the cluster**, not just your ingress controller. This is a deliberate simple default, not a locked-down one. On a shared or multi-tenant cluster, scope it down, e.g. to the ingress-nginx namespace:
- ```yaml
- networkPolicy:
- ingressFrom:
- - namespaceSelector:
- matchLabels:
- kubernetes.io/metadata.name: ingress-nginx
- ```
-* **Namespace hardening** — label the install namespace with Pod Security Standards `restricted` enforcement (`pod-security.kubernetes.io/enforce=restricted`). All workloads set `runAsNonRoot`, drop all Linux capabilities, disable privilege escalation, and set `seccompProfile: RuntimeDefault` — the four controls the Restricted profile requires. `readOnlyRootFilesystem` is defaulted on only for the bundled Redis (Postgres/Ollama genuinely need a writable root; the stateless services — `realtime`, `pii`, `copilot` — could tolerate it but aren't pre-wired with a `/tmp` `emptyDir`). If your policy requires it, set `.securityContext.readOnlyRootFilesystem: true` and mount writable `emptyDir` volumes yourself via `extraVolumes`/`extraVolumeMounts`: `/tmp` for every component, plus `/app/apps/sim/.next/cache` and `/app/apps/sim/.next/server/route-cache` for `app`.
-* **Env validation** — keys under `app.env`, `realtime.env`, and `copilot.server.env` are passed through to the application and validated at startup. The JSON Schema intentionally does not enforce `additionalProperties: false` (would break custom user envs), so typos like `OPENA_API_KEY` (instead of `OPENAI_API_KEY`) surface as missing-key errors at runtime, not at `helm install` time. Review your env block carefully.
-* **Set public URLs** — `app.env.NEXT_PUBLIC_APP_URL` must match your public origin (e.g. `https://sim.example.com`); `BETTER_AUTH_URL` follows it (in `app.secrets.existingSecret` mode set both in the Secret). Leaving it as `localhost` breaks sign-in.
-
----
-
-## Secrets
-
-The chart supports three ways to provide secrets, in increasing order of production-readiness:
-
-### 1. Inline `--set` (dev / dry-run only)
-
-```bash
-helm install sim oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION" --set app.env.BETTER_AUTH_SECRET=...
-```
-
-Discouraged for production — values land in `helm get values` output.
-
-### 2. Pre-existing Kubernetes Secret
-
-Create the Secret first, then reference it:
-
-```bash
-kubectl create secret generic sim-app-secrets --namespace sim \
- --from-literal=BETTER_AUTH_SECRET=$(openssl rand -hex 32) \
- --from-literal=ENCRYPTION_KEY=$(openssl rand -hex 32) \
- --from-literal=INTERNAL_API_SECRET=$(openssl rand -hex 32) \
- --from-literal=CRON_SECRET=$(openssl rand -hex 32)
-
-kubectl create secret generic sim-postgres-secret --namespace sim \
- --from-literal=POSTGRES_PASSWORD=$(openssl rand -base64 24 | tr -d '/+=')
-```
-
-```yaml
-app:
- secrets:
- existingSecret:
- enabled: true
- name: sim-app-secrets
-
-postgresql:
- auth:
- existingSecret:
- enabled: true
- name: sim-postgres-secret # must contain the password under the key POSTGRES_PASSWORD
-```
-
-See `examples/values-existing-secret.yaml`.
-
-### 3. External Secrets Operator (recommended)
-
-Sync from Azure Key Vault, AWS Secrets Manager, HashiCorp Vault, or GCP Secret Manager. Install ESO once, create a `ClusterSecretStore`, then:
-
-```yaml
-externalSecrets:
- enabled: true
- refreshInterval: 1h
- secretStoreRef:
- name: my-secret-store
- kind: ClusterSecretStore
- remoteRefs:
- app:
- BETTER_AUTH_SECRET: sim/app/better-auth-secret
- ENCRYPTION_KEY: sim/app/encryption-key
- INTERNAL_API_SECRET: sim/app/internal-api-secret
- postgresql:
- password: sim/postgresql/password
- # Only needed when copilot.enabled=true and copilot.server.secret.create=true.
- # Every non-empty copilot.server.env key must have a matching entry here —
- # template rendering fails with a clear message naming the missing key otherwise.
- copilot:
- INTERNAL_API_SECRET: sim/copilot/internal-api-secret
- LICENSE_KEY: sim/copilot/license-key
- COPILOT_INBOUND_API_KEY: sim/copilot/inbound-api-key
- SIM_ENDPOINT: sim/copilot/sim-endpoint
- REDIS_URL: sim/copilot/redis-url
- OPENAI_API_KEY: sim/copilot/openai-api-key
-```
-
-See `examples/values-external-secrets.yaml`.
+Before production, work through the [pre-launch checklist](https://docs.sim.ai/platform/self-hosting/security#pre-launch-checklist) and choose a [secret strategy](https://docs.sim.ai/platform/self-hosting/kubernetes#secret-stores): an existing Kubernetes Secret or the External Secrets Operator. See `examples/values-existing-secret.yaml` and `examples/values-external-secrets.yaml`.
---
@@ -572,102 +329,23 @@ When `autoscaling.enabled=true`, the chart omits `spec.replicas` from the Deploy
---
-## PII redaction
-
-Sim can redact personally identifiable information using a [Presidio](https://microsoft.github.io/presidio/) service (analyzer + anonymizer combined into one image listening on port 5001). Enable it with:
-
-```yaml
-pii:
- enabled: true
-```
-
-When enabled, the chart deploys it as a standalone `-pii` Deployment + Service and **auto-wires** `PII_URL` on the app to the in-cluster service. The service bundles five large spaCy models (en/es/it/pl/fi, ~2.2GB), so the first start takes ~3 minutes while models load — the `startupProbe` allows for this. Size the `pii.resources` for at least ~4Gi memory.
-
-This powers the **Guardrails PII block**, on-demand masking, and PII policies configured under **Settings → Enterprise → Data Retention**. Automatic redaction also requires the app to reach its own masking endpoint:
-
-```yaml
-app:
- env:
- # The log-redaction path calls the app's own /api/guardrails/mask-batch,
- # which must be reachable from inside the cluster. Set this to the in-cluster
- # app Service URL (NOT the public ingress, which usually isn't hairpin-reachable).
- INTERNAL_API_BASE_URL: "http://-app..svc.cluster.local:3000"
-```
+## PII redaction and troubleshooting
-Without a cluster-reachable `INTERNAL_API_BASE_URL` (it falls back to `NEXT_PUBLIC_APP_URL`), the redaction path fails closed — it scrubs affected fields to `[REDACTION_FAILED]` rather than leaking, but redaction won't actually run.
-
-> The PII image is published at `ghcr.io/simstudioai/pii` (multi-arch). If you mirror images into a private registry, retag it alongside the app/realtime/migrations images.
+`pii.enabled: true` deploys the Presidio service and wires `PII_URL`; automatic redaction also needs an in-cluster `INTERNAL_API_BASE_URL`. See [PII redaction](https://docs.sim.ai/platform/self-hosting/security#pii-redaction) and [Troubleshooting](https://docs.sim.ai/platform/self-hosting/troubleshooting).
---
-## Troubleshooting
-
-### `Error: execution error at (sim/templates/...): app.env.BETTER_AUTH_SECRET is required for production deployment`
-
-You ran `helm install` without setting required secrets. Generate them and pass with `--set`:
+## Upgrading to 1.22.1
-```bash
-helm install sim oci://ghcr.io/simstudioai/charts/sim --version "$CHART_VERSION" \
- --set app.env.BETTER_AUTH_SECRET=$(openssl rand -hex 32) \
- --set app.env.ENCRYPTION_KEY=$(openssl rand -hex 32) \
- --set app.env.INTERNAL_API_SECRET=$(openssl rand -hex 32) \
- --set postgresql.auth.password=$(openssl rand -base64 24 | tr -d '/+=')
-```
-
-### App pods stuck in `CrashLoopBackOff`
-
-```bash
-kubectl logs --namespace sim deploy/sim-app --tail 200
-```
-
-Common causes:
-
-* `NEXT_PUBLIC_APP_URL` still set to `http://localhost:3000` in a clustered deploy → set it to your public origin.
-* `DATABASE_URL` not reachable → check the Postgres pod is running and `postgresql.auth.password` matches.
-* Missing migration → check `kubectl logs deploy/sim-app -c migrations` (migrations run as an init container on the app pod).
-
-### Image pull errors (`ErrImagePull` / `ImagePullBackOff`)
-
-* You pushed Sim to a private registry but haven't configured pull secrets. Set `global.imagePullSecrets` and `global.imageRegistry`.
-* You overrode `image.tag` to a tag that doesn't exist in the registry. `helm get values sim` and verify.
-
-### Postgres pod `Pending`
-
-```bash
-kubectl describe pvc --namespace sim
-```
+Covers 1.22.0–1.22.1; 1.21.0 is the previous published chart.
-Almost always one of:
-
-* No default `StorageClass` → set `global.storageClass`.
-* No PV provisioner → install one (e.g. EBS CSI on EKS, `local-path-provisioner` for dev).
-* StorageClass exists but doesn't support `ReadWriteOnce` → pick another class.
-
-### Ingress not routing
-
-```bash
-kubectl get ingress --namespace sim
-kubectl describe ingress --namespace sim
-```
-
-* Ingress controller not installed → install `ingress-nginx` or similar.
-* `ingress.className` doesn't match your controller → set it to your installed class.
-* DNS not pointed at the ingress's external IP / LoadBalancer.
-
-### Get logs from each component
-
-```bash
-kubectl --namespace sim logs -f deployment/sim-app
-kubectl --namespace sim logs -f deployment/sim-realtime
-kubectl --namespace sim logs -f statefulset/sim-postgresql
-kubectl --namespace sim logs deploy/sim-app -c migrations
-```
-
----
+* **`helm test` runs the authenticated self-check, and `tests.image` is now `curlimages/curl:8.5.0`.** Drop a `busybox` override of `tests.image`; with Kubernetes sandboxes run `helm test` with `--timeout 10m`. See [Test the install](#test-the-install).
+* **Air-gapped mirrors: `images.yaml` adds `pause` and the `copilot-sandbox-*` images, and `busybox` is gone.** Mirror from the published chart's copy, which also lists the sandbox images its appVersion runs.
+* **Each scheduled job has a `description` in `values.yaml`.** No action.
-## Upgrading to 1.22.0
+## Upgrading to 1.21.0
-Covers 1.19.0–1.22.0; 1.18.0 is the previous published chart. This release refuses some values earlier charts accepted; run `helm template` with your values before upgrading.
+Covers 1.19.0–1.21.0; 1.18.0 is the previous published chart. This release refuses some values earlier charts accepted; run `helm template` with your values before upgrading.
* **Argo CD or `helm template | kubectl apply`: recreate the bundled Postgres StatefulSets once.** Their volume claim labels no longer carry the chart version (Kubernetes forbids changing them, which broke every upgrade). `helm upgrade` and Flux reuse the existing labels and need nothing; tools that render without `lookup` must orphan-delete first, which keeps the pods and PVCs:
@@ -681,8 +359,6 @@ Covers 1.19.0–1.22.0; 1.18.0 is the previous published chart. This release ref
* **External Secrets: synced keys win over `envDefaults`.** A key mapped in `externalSecrets.remoteRefs.app` is no longer masked by the chart default. No action.
* **existingSecret mode applies no `envDefaults`.** Put overrides in `app.env`, which is inlined in that mode.
* **New render checks.** An enabled `existingSecret` with an empty `name` (`app.secrets`, `postgresql.auth`, `externalDatabase`) fails, as does enabling both `postgresql` and `externalDatabase`, and `TRIGGER_DEV_ENABLED=true` with `sandbox.kubernetes.enabled` (unset it; Trigger.dev workers cannot reach sandbox pods).
-* **`helm test` runs the authenticated self-check, and `tests.image` is now `curlimages/curl:8.5.0`.** Drop a `busybox` override of `tests.image`; with Kubernetes sandboxes run `helm test` with `--timeout 10m`. See [Test the install](#test-the-install).
-* **Air-gapped mirrors: `images.yaml` adds `pause` and the `copilot-sandbox-*` images, and `busybox` is gone.** Mirror from the published chart's copy, which also lists the sandbox images its appVersion runs.
* **Kubernetes sandboxes only:**
* **The quota is derived.** Empty `sandbox.kubernetes.quota.cpu`/`memory`/`ephemeralStorage` (the new default) become `quota.pods` x (resources + RuntimeClass overhead); an explicit value below that floor fails. With a RuntimeClass the chart does not create, add its `overhead.podFixed` when you set quotas.
* **`prePull` no longer needs `images.function.tag` on a published chart.** It defaults to the image the chart's appVersion runs; unset `images.function.tag` if you set it only for `prePull`.
diff --git a/helm/sim/values.yaml b/helm/sim/values.yaml
index 63cd1d2cb3c..053ff7de23d 100644
--- a/helm/sim/values.yaml
+++ b/helm/sim/values.yaml
@@ -1460,6 +1460,7 @@ cronjobs:
scheduleExecution:
enabled: true
name: schedule-execution
+ description: "Runs scheduled workflows"
schedule: "*/1 * * * *"
path: "/api/schedules/execute"
concurrencyPolicy: Forbid
@@ -1469,6 +1470,7 @@ cronjobs:
gmailWebhookPoll:
enabled: true
name: gmail-webhook-poll
+ description: "Polls Gmail for the Gmail trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/gmail"
concurrencyPolicy: Forbid
@@ -1478,6 +1480,7 @@ cronjobs:
outlookWebhookPoll:
enabled: true
name: outlook-webhook-poll
+ description: "Polls Outlook for the Outlook trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/outlook"
concurrencyPolicy: Forbid
@@ -1487,6 +1490,7 @@ cronjobs:
rssWebhookPoll:
enabled: true
name: rss-webhook-poll
+ description: "Polls feeds for the RSS trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/rss"
concurrencyPolicy: Forbid
@@ -1496,6 +1500,7 @@ cronjobs:
imapWebhookPoll:
enabled: true
name: imap-webhook-poll
+ description: "Polls mailboxes for the IMAP trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/imap"
concurrencyPolicy: Forbid
@@ -1505,6 +1510,7 @@ cronjobs:
googleSheetsWebhookPoll:
enabled: true
name: google-sheets-webhook-poll
+ description: "Polls Google Sheets for the Sheets trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/google-sheets"
concurrencyPolicy: Forbid
@@ -1514,6 +1520,7 @@ cronjobs:
googleDriveWebhookPoll:
enabled: true
name: google-drive-webhook-poll
+ description: "Polls Google Drive for the Drive trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/google-drive"
concurrencyPolicy: Forbid
@@ -1523,6 +1530,7 @@ cronjobs:
googleCalendarWebhookPoll:
enabled: true
name: google-calendar-webhook-poll
+ description: "Polls Google Calendar for the Calendar trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/google-calendar"
concurrencyPolicy: Forbid
@@ -1532,6 +1540,7 @@ cronjobs:
hubspotWebhookPoll:
enabled: true
name: hubspot-webhook-poll
+ description: "Polls HubSpot for the HubSpot trigger"
schedule: "*/1 * * * *"
path: "/api/webhooks/poll/hubspot"
concurrencyPolicy: Forbid
@@ -1541,6 +1550,7 @@ cronjobs:
renewSubscriptions:
enabled: true
name: renew-subscriptions
+ description: "Renews Microsoft Teams chat subscriptions, which Microsoft Graph expires after about three days"
schedule: "0 */12 * * *"
path: "/api/cron/renew-subscriptions"
concurrencyPolicy: Forbid
@@ -1550,6 +1560,7 @@ cronjobs:
billingCycleClose:
enabled: true
name: billing-cycle-close
+ description: "Billing only: collects final overage and resets per-period usage trackers"
schedule: "0 */6 * * *"
path: "/api/cron/billing-cycle-close"
concurrencyPolicy: Forbid
@@ -1559,6 +1570,7 @@ cronjobs:
reconcileBillingSeats:
enabled: true
name: reconcile-billing-seats
+ description: "Billing only: reconciles subscription seats; safe to disable without billing"
schedule: "0 * * * *"
path: "/api/cron/reconcile-billing-seats"
concurrencyPolicy: Forbid
@@ -1571,6 +1583,7 @@ cronjobs:
reconcileInboxEntitlement:
enabled: true
name: reconcile-inbox-entitlement
+ description: "Releases Sim Mailer inboxes for workspaces whose plan lapsed"
schedule: "0 3 * * *"
path: "/api/cron/reconcile-inbox-entitlement"
concurrencyPolicy: Forbid
@@ -1580,6 +1593,7 @@ cronjobs:
workspaceEventsPoll:
enabled: true
name: workspace-events-poll
+ description: "Fires workspace event triggers"
schedule: "*/15 * * * *"
path: "/api/workspace-events/poll"
concurrencyPolicy: Forbid
@@ -1589,6 +1603,7 @@ cronjobs:
timePauseResumePoll:
enabled: true
name: time-pause-resume-poll
+ description: "Resumes workflows paused on a timer"
schedule: "*/1 * * * *"
path: "/api/resume/poll"
concurrencyPolicy: Forbid
@@ -1598,6 +1613,7 @@ cronjobs:
connectorSync:
enabled: true
name: connector-sync
+ description: "Syncs knowledge base connectors"
schedule: "*/5 * * * *"
path: "/api/knowledge/connectors/sync"
concurrencyPolicy: Forbid
@@ -1607,6 +1623,7 @@ cronjobs:
connectorMemberSync:
enabled: true
name: connector-member-sync
+ description: "Syncs per-member content and access for indexed connectors"
schedule: "*/5 * * * *"
path: "/api/knowledge/connectors/member-sync"
concurrencyPolicy: Forbid
@@ -1616,6 +1633,7 @@ cronjobs:
connectorDirectorySync:
enabled: true
name: connector-directory-sync
+ description: "Refreshes stored groups for indexed administrator-mode connectors"
schedule: "*/5 * * * *"
path: "/api/knowledge/connectors/directory-sync"
concurrencyPolicy: Forbid
@@ -1625,6 +1643,7 @@ cronjobs:
runDataDrains:
enabled: true
name: run-data-drains
+ description: "Runs the enterprise data drains that are due"
# Must tick at least every 15 minutes for the "Every 15 minutes" drain cadence;
# a slower schedule makes those drains run at the slower rate.
schedule: "*/15 * * * *"
@@ -1636,6 +1655,7 @@ cronjobs:
peopleDirectorySync:
enabled: true
name: people-directory-sync
+ description: "Refreshes connected People directories and delivers pending SCIM changes"
schedule: "*/5 * * * *"
path: "/api/cron/people-directory-sync"
requestTimeoutSeconds: 300
@@ -1650,6 +1670,7 @@ cronjobs:
scimReconcile:
enabled: true
name: scim-reconcile
+ description: "Re-applies SCIM directory group mappings"
schedule: "17 * * * *"
path: "/api/cron/scim-reconcile"
concurrencyPolicy: Forbid
@@ -1660,6 +1681,7 @@ cronjobs:
cleanupTableRowTtl:
enabled: true
name: cleanup-table-row-ttl
+ description: "Deletes table rows whose TTL column has expired"
schedule: "*/15 * * * *"
path: "/api/cron/cleanup-table-row-ttl"
concurrencyPolicy: Forbid
@@ -1671,6 +1693,7 @@ cronjobs:
cleanupOAuthTokens:
enabled: true
name: cleanup-oauth-tokens
+ description: "Deletes OAuth access and refresh tokens after their retention tail"
schedule: "0 * * * *"
path: "/api/cron/cleanup-oauth-tokens"
concurrencyPolicy: Forbid
@@ -1682,6 +1705,7 @@ cronjobs:
cleanupCredentialGroupLinks:
enabled: true
name: cleanup-credential-group-links
+ description: "Deletes Credential Group connection-request logs and expired connect links"
schedule: "20 * * * *"
path: "/api/cron/cleanup-credential-group-links"
concurrencyPolicy: Forbid
@@ -1693,6 +1717,7 @@ cronjobs:
cleanupActivityHistory:
enabled: true
name: cleanup-activity-history
+ description: "Deletes organization activity history past its 400-day retention"
schedule: "45 4 * * *"
path: "/api/cron/cleanup-activity-history"
concurrencyPolicy: Forbid
@@ -1703,6 +1728,7 @@ cronjobs:
cleanupSourceStaging:
enabled: true
name: cleanup-source-staging
+ description: "Deletes files staged for a workspace source apply a day after last use"
schedule: "30 * * * *"
path: "/api/cron/cleanup-source-staging"
concurrencyPolicy: Forbid
@@ -1715,6 +1741,7 @@ cronjobs:
cleanupSandboxImages:
enabled: true
name: cleanup-sandbox-images
+ description: "Deletes unused prebuilt sandbox images past their retention window"
schedule: "30 4 * * *"
path: "/api/cron/cleanup-sandbox-images"
concurrencyPolicy: Forbid
@@ -1729,6 +1756,7 @@ cronjobs:
cleanupSessionSandboxes:
enabled: true
name: cleanup-session-sandboxes
+ description: "Stops idle chat workbenches and removes finished Kubernetes sandbox pods"
schedule: "*/5 * * * *"
path: "/api/cron/cleanup-session-sandboxes"
concurrencyPolicy: Forbid
@@ -1741,6 +1769,7 @@ cronjobs:
outboxProcess:
enabled: true
name: outbox-process
+ description: "Retries transactional-outbox side effects for billing, membership, and deployments"
schedule: "*/1 * * * *"
path: "/api/webhooks/outbox/process"
requestTimeoutSeconds: 810
@@ -1752,6 +1781,7 @@ cronjobs:
workspaceFileSearchDispatch:
enabled: true
name: workspace-file-search-dispatch
+ description: "Dispatches indexing work for workspace file search"
schedule: "*/1 * * * *"
path: "/api/cron/workspace-file-search-dispatch"
concurrencyPolicy: Forbid
@@ -1763,6 +1793,7 @@ cronjobs:
knowledgeProjection:
enabled: true
name: knowledge-projection
+ description: "Brings knowledge base search up to date with document, permission, and chunk changes"
schedule: "*/1 * * * *"
path: "/api/cron/knowledge-projection"
concurrencyPolicy: Forbid
@@ -1774,6 +1805,7 @@ cronjobs:
activityRollup:
enabled: true
name: activity-rollup
+ description: "Maintains the hourly workflow activity rollup; idle unless ACTIVITY_ROLLUP_MAINTENANCE is on"
schedule: "*/2 * * * *"
path: "/api/cron/activity-rollup"
concurrencyPolicy: Forbid
@@ -1784,6 +1816,7 @@ cronjobs:
foldTableRowChanges:
enabled: true
name: fold-table-row-changes
+ description: "Folds the table row-change log into each table's row count and version"
schedule: "*/1 * * * *"
path: "/api/cron/fold-table-row-changes"
concurrencyPolicy: Forbid
@@ -1796,6 +1829,7 @@ cronjobs:
cleanupStaleExecutions:
enabled: true
name: cleanup-stale-executions
+ description: "Fails runs whose worker died without finishing, and prunes old run bookkeeping"
schedule: "*/30 * * * *"
path: "/api/cron/cleanup-stale-executions"
concurrencyPolicy: Forbid
@@ -1807,6 +1841,7 @@ cronjobs:
idempotencyCleanup:
enabled: true
name: idempotency-cleanup
+ description: "Deletes deduplication records older than seven days"
schedule: "0 5 * * *"
path: "/api/webhooks/cleanup/idempotency"
requestTimeoutSeconds: 300
diff --git a/package.json b/package.json
index 57970f85642..4af92ceb8ba 100644
--- a/package.json
+++ b/package.json
@@ -117,6 +117,8 @@
"check:model-docs": "bun run scripts/generate-model-docs.ts --check",
"generate:deployment-config": "bun run scripts/generate-deployment-config.ts",
"check:deployment-config": "bun run scripts/generate-deployment-config.ts --check",
+ "generate:self-hosting-docs": "bun run scripts/sync-self-hosting-docs.ts",
+ "check:self-hosting-docs": "bun run scripts/sync-self-hosting-docs.ts --check",
"images:generate": "bun run scripts/generate-image-manifest.ts",
"images:check": "bun run scripts/generate-image-manifest.ts --check",
"check:integration-catalog": "bun run scripts/check-integration-catalog.ts",
diff --git a/scripts/sync-self-hosting-docs.test.ts b/scripts/sync-self-hosting-docs.test.ts
new file mode 100644
index 00000000000..a86e2d24bab
--- /dev/null
+++ b/scripts/sync-self-hosting-docs.test.ts
@@ -0,0 +1,199 @@
+import { describe, expect, it } from 'vitest'
+import {
+ backtickedEnvNames,
+ buildOAuthClientRows,
+ findProviderListDrift,
+ type OAuthServiceInfo,
+ parseCronJobs,
+ pickIntegrationPages,
+ renderCronTable,
+ replaceBetweenMarkers,
+ shellEnvNames,
+ yamlEnvNames,
+} from './sync-self-hosting-docs'
+
+const VALUES = `app:
+ env: {}
+cronjobs:
+ enabled: true
+ jobs:
+ scheduleExecution:
+ enabled: true
+ name: schedule-execution
+ description: "Runs scheduled workflows"
+ schedule: "*/1 * * * *"
+ path: "/api/schedules/execute"
+ # A comment between jobs
+ outboxProcess:
+ name: outbox-process
+ description: "Retries outbox side effects"
+ schedule: "*/1 * * * *"
+ path: "/api/webhooks/outbox/process"
+ requestTimeoutSeconds: 810
+ image:
+ repository: curlimages/curl
+ name: not-a-job
+telemetry:
+ enabled: false
+`
+
+describe('parseCronJobs', () => {
+ it('reads every job and stops at the sibling keys after cronjobs.jobs', () => {
+ expect(parseCronJobs(VALUES).map((job) => [job.name, job.path, job.description])).toEqual([
+ ['schedule-execution', '/api/schedules/execute', 'Runs scheduled workflows'],
+ ['outbox-process', '/api/webhooks/outbox/process', 'Retries outbox side effects'],
+ ])
+ })
+
+ it('rejects a job without a description instead of shortening the table', () => {
+ const withoutDescription = VALUES.replace(
+ ' description: "Retries outbox side effects"\n',
+ ''
+ )
+ expect(() => parseCronJobs(withoutDescription)).toThrow('outboxProcess has no description')
+ })
+})
+
+describe('cron values', () => {
+ it('reads single-quoted values without their quotes and escapes pipes in the table', () => {
+ const quoted = VALUES.replace(
+ ' description: "Retries outbox side effects"',
+ " description: 'Retries the outbox | it''s idempotent'"
+ )
+ const job = parseCronJobs(quoted)[1]
+ expect(job.description).toBe("Retries the outbox | it's idempotent")
+ expect(renderCronTable([job])).toContain("Retries the outbox \\| it's idempotent |")
+ })
+})
+
+describe('replaceBetweenMarkers', () => {
+ const begin =
+ '{/* jobs:begin — generated by `bun run generate:self-hosting-docs`; do not edit between markers */}'
+ const end = '{/* jobs:end */}'
+
+ it('refuses a document whose markers are missing or reversed', () => {
+ expect(() => replaceBetweenMarkers(`intro\n${begin}\n`, 'jobs', 'x')).toThrow('markers')
+ expect(() => replaceBetweenMarkers(`${end}\n${begin}\n`, 'jobs', 'x')).toThrow('markers')
+ })
+})
+
+describe('pickIntegrationPages', () => {
+ const page = (slug: string, provider: string) => ({
+ slug,
+ doc: `## OAuth scopes [#oauth-scopes]\n\`/api/auth/oauth2/callback/${provider}\``,
+ })
+
+ it('prefers the page named after the provider over one that sorts first', () => {
+ const pages = [page('zoho_desk', 'zoho-desk'), page('manageengine_sdp', 'zoho-desk')]
+ expect(pickIntegrationPages(pages).get('zoho-desk')).toBe(
+ '/integrations/zoho_desk#oauth-scopes'
+ )
+ expect(pickIntegrationPages([...pages].reverse()).get('zoho-desk')).toBe(
+ '/integrations/zoho_desk#oauth-scopes'
+ )
+ })
+})
+
+describe('findProviderListDrift', () => {
+ const doc = '| `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET` | `google-email`, `google-drive` |'
+
+ it('reports a registered provider missing from the hand-written list', () => {
+ expect(
+ findProviderListDrift(doc, 'GOOGLE_CLIENT_ID', ['google-email', 'google-drive'])
+ ).toBeNull()
+ expect(
+ findProviderListDrift(doc, 'GOOGLE_CLIENT_ID', [
+ 'google-email',
+ 'google-drive',
+ 'google-meet',
+ ])
+ ).toContain('missing google-meet')
+ })
+})
+
+describe('backtickedEnvNames', () => {
+ it('reads names and NAME=value spans from prose, never from fenced code', () => {
+ const mdx = [
+ 'Set `REDIS_URL` and `LOG_LEVEL=INFO`, not `redis_url`, `GET`, or `DATABASE_URL_`.',
+ '```bash',
+ 'SHELL_ONLY_VAR=1',
+ '`FENCED_NAME`',
+ '```',
+ 'Then `CRON_SECRET`.',
+ ].join('\n')
+ expect(backtickedEnvNames(mdx)).toEqual([
+ { name: 'REDIS_URL', line: 1 },
+ { name: 'LOG_LEVEL', line: 1 },
+ { name: 'CRON_SECRET', line: 6 },
+ ])
+ })
+})
+
+describe('buildOAuthClientRows', () => {
+ const service = (serviceId: string, extra: Partial = {}): OAuthServiceInfo => ({
+ serviceId,
+ providerId: serviceId,
+ name: serviceId,
+ authType: 'oauth',
+ ...extra,
+ })
+ const build = (
+ capabilities: Record,
+ services: OAuthServiceInfo[],
+ aliases: Record = {}
+ ) =>
+ buildOAuthClientRows({
+ capabilities,
+ services,
+ resolveCapability: (id) => aliases[id] ?? (id in capabilities ? id : null),
+ docsHrefForProvider: () => null,
+ callbackPath: (id) => `/cb/${id}`,
+ })
+
+ it('puts services that share a client in one row with every redirect they use', () => {
+ const rows = build(
+ { 'zoho-desk': ['ZOHO_CLIENT_ID'], salesforce: ['SALESFORCE_CLIENT_ID'] },
+ [
+ service('zoho-desk'),
+ service('manageengine-sdp'),
+ service('salesforce', { additionalProviderIds: ['salesforce-sandbox'] }),
+ ],
+ { 'manageengine-sdp': 'zoho-desk' }
+ )
+ expect(rows.map((row) => [row.capabilityId, row.callbackPaths])).toEqual([
+ ['zoho-desk', ['/cb/zoho-desk', '/cb/manageengine-sdp']],
+ ['salesforce', ['/cb/salesforce', '/cb/salesforce-sandbox']],
+ ])
+ })
+
+ it('fails on a client that configures no registered service, so it cannot drop out of the docs', () => {
+ expect(() => build({ 'new-client': ['NEW_CLIENT_ID'] }, [])).toThrow('new-client')
+ })
+})
+
+describe('env declaration sources', () => {
+ it('declares chart keys and references but not names that only appear in comments', () => {
+ const values = [
+ 'app:',
+ ' env:',
+ ' REDIS_URL: "" # name: OTHER_COMMENT_NAME',
+ ' # COMMENT_ONLY_NAME: "75000"',
+ 'extraEnvVars:',
+ ' - name: EXTRA_SECRET',
+ ].join('\n')
+ expect([...yamlEnvNames(values)].sort()).toEqual(['EXTRA_SECRET', 'REDIS_URL'])
+ })
+
+ it('declares Compose assignments and references but not names in comments', () => {
+ const compose = [
+ ' # Set COMMENT_ONLY_NAME=1 in .env to change it',
+ " - 'DATABASE_URL=postgresql://\u0024{POSTGRES_USER:-postgres}@db'",
+ ' - LOG_LEVEL=\u0024{LOG_LEVEL:-} # not \u0024{OTHER_COMMENT_NAME}',
+ ].join('\n')
+ expect([...shellEnvNames(compose)].sort()).toEqual([
+ 'DATABASE_URL',
+ 'LOG_LEVEL',
+ 'POSTGRES_USER',
+ ])
+ })
+})
diff --git a/scripts/sync-self-hosting-docs.ts b/scripts/sync-self-hosting-docs.ts
new file mode 100644
index 00000000000..bd5660d02ba
--- /dev/null
+++ b/scripts/sync-self-hosting-docs.ts
@@ -0,0 +1,616 @@
+/**
+ * Generates the reference tables in the self-hosting guide from the code that defines them, and
+ * lints the guide for configuration names and release pins that have drifted from the code:
+ *
+ * - `integrations-oauth.mdx`: the "Other providers" table, from `OAUTH_CLIENT_CAPABILITIES` and the
+ * OAuth service registry, so every client a deployment can configure is listed with its env
+ * fields and redirect URIs.
+ * - `background-jobs.mdx`: the shipped job table, from `cronjobs.jobs` in `helm/sim/values.yaml`
+ * (which `docker/crontab` mirrors; `check:cron-parity` enforces that).
+ *
+ * In `--check` mode it also fails when a backticked UPPER_SNAKE name in a self-hosting page is not
+ * declared by the app, realtime, chart, or Compose configuration, and when a page pins a Sim
+ * release (`vX.Y.Z`) that is not an intentional historical reference.
+ *
+ * Usage:
+ * bun run scripts/sync-self-hosting-docs.ts # write
+ * bun run scripts/sync-self-hosting-docs.ts --check # fail on drift, unknown names, or pins
+ */
+import { execFileSync } from 'node:child_process'
+import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { compareStrings } from '@sim/utils/string'
+
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
+const SELF_HOSTING_DIR = path.join(ROOT, 'apps/docs/content/docs/platform/self-hosting')
+const INTEGRATIONS_DOCS_DIR = path.join(ROOT, 'apps/docs/content/docs/integrations')
+
+const OAUTH_DOC = path.join(SELF_HOSTING_DIR, 'integrations-oauth.mdx')
+const JOBS_DOC = path.join(SELF_HOSTING_DIR, 'background-jobs.mdx')
+
+const OAUTH_MARKER = 'self-hosting-oauth-clients'
+const JOBS_MARKER = 'self-hosting-cron-jobs'
+
+const DEFAULT_CALLBACK_PREFIX = '/api/auth/oauth2/callback/'
+
+/** Clients documented in their own section of integrations-oauth.mdx, not the generated table. */
+const DEDICATED_SECTIONS = new Set([
+ 'google',
+ 'microsoft',
+ 'confluence',
+ 'jira',
+ 'github-repositories',
+])
+
+/**
+ * Clients that redirect somewhere other than the default callback. Each path must be served by a
+ * route in the app, which the generator checks, so a moved route fails the build.
+ */
+const CALLBACK_OVERRIDES: Record = {
+ trello: { path: '/api/auth/trello/callback', route: 'apps/sim/app/api/auth/trello/callback' },
+ 'hubspot-mcp': { path: '/api/mcp/oauth/callback', route: 'apps/sim/app/api/mcp/oauth/callback' },
+ 'zoom-mcp': { path: '/api/mcp/oauth/callback', route: 'apps/sim/app/api/mcp/oauth/callback' },
+}
+
+/** Deployment-owned clients for managed MCP connectors, which the OAuth service registry omits. */
+const MCP_CLIENT_LABELS: Record = {
+ 'hubspot-mcp': { name: 'HubSpot Search', href: '/search/hubspot' },
+ 'zoom-mcp': { name: 'Zoom Search', href: '/search/zoom' },
+}
+
+/**
+ * Backticked names the declaration sources cannot see but the guide names on purpose: other
+ * software's settings (Compose, Node, the AWS SDK, electron-builder, the EKS CNI, the Mothership), an
+ * error code, a Linux capability, provider scope names, and names Sim reads through a constant.
+ */
+const ENV_TOKEN_ALLOWLIST = new Set([
+ 'COMPOSE_FILE',
+ 'COMPOSE_PROFILES',
+ 'HTTP_PROXY',
+ 'HTTPS_PROXY',
+ 'NO_PROXY',
+ 'NODE_EXTRA_CA_CERTS',
+ 'NODE_TLS_REJECT_UNAUTHORIZED',
+ 'NODE_USE_ENV_PROXY',
+ 'GOOGLE_APPLICATION_CREDENTIALS',
+ 'AWS_USE_FIPS_ENDPOINT',
+ 'CSC_LINK',
+ 'CSC_KEY_PASSWORD',
+ 'APPLE_API_KEY',
+ 'APPLE_API_KEY_ID',
+ 'APPLE_API_ISSUER',
+ 'APPLE_TEAM_ID',
+ 'NETWORK_POLICY_ENFORCING_MODE',
+ 'UNABLE_TO_GET_ISSUER_CERT',
+ 'READ_BOOKING',
+ 'READ_PROFILE',
+ // A Linux capability the sandbox docs name, and a setting of the separately shipped Mothership.
+ 'DAC_OVERRIDE',
+ 'COPILOT_SHUTDOWN_HANDOFF_MS',
+ // Read through a named constant rather than `process.env.NAME`.
+ 'OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT',
+ 'SIM_DESKTOP_ORIGIN',
+ 'SANDBOX_K8S_E2E_DENIED_TARGETS',
+])
+
+/** Variables the upgrade notes name because a release stopped reading them. */
+const RETIRED_ENV_NAMES = new Set([
+ 'NEXT_PUBLIC_BILLING_ENABLED',
+ 'NEXT_PUBLIC_E2B_ENABLED',
+ 'NEXT_PUBLIC_SANDBOXES_ENABLED',
+ 'NEXT_PUBLIC_SLACK_EXTENDED_SCOPES',
+ 'NEXT_PUBLIC_DISABLE_INVITATIONS',
+ 'NEXT_PUBLIC_DISABLE_PUBLIC_API',
+])
+
+/**
+ * Release tags a page names on purpose, as history ("the first release that…"). Anything else
+ * reads as "the current release" and goes stale on the next one; use `` or the
+ * chart's `appVersion` instead.
+ */
+const RELEASE_PIN_ALLOWLIST: Record = {
+ 'sandboxes.mdx': ['v0.9.73'],
+ 'security.mdx': ['v0.9.33'],
+ 'upgrades.mdx': ['v0.9.33', 'v0.9.65', 'v0.9.74'],
+}
+
+export interface OAuthServiceInfo {
+ serviceId: string
+ providerId: string
+ additionalProviderIds?: readonly string[]
+ name: string
+ authType: string
+ clientConfiguration?: unknown
+}
+
+export interface OAuthClientRow {
+ capabilityId: string
+ services: { name: string; href: string | null }[]
+ envFields: readonly string[]
+ callbackPaths: string[]
+}
+
+export interface CronJob {
+ key: string
+ name: string
+ schedule: string
+ path: string
+ description: string
+}
+
+/** Rewrites the content between a marker pair, failing when the pair is missing or reversed. */
+export function replaceBetweenMarkers(doc: string, marker: string, content: string): string {
+ const begin = `{/* ${marker}:begin — generated by \`bun run generate:self-hosting-docs\`; do not edit between markers */}`
+ const end = `{/* ${marker}:end */}`
+ const beginIndex = doc.indexOf(begin)
+ const endIndex = doc.indexOf(end)
+ if (beginIndex === -1 || endIndex === -1 || endIndex < beginIndex) {
+ throw new Error(`markers for ${marker} not found`)
+ }
+ return `${doc.slice(0, beginIndex + begin.length)}\n${content}\n${doc.slice(endIndex)}`
+}
+
+/**
+ * Groups OAuth services by the deployment client that configures them. Every client in
+ * `capabilities` produces a row unless it has a dedicated section; a client with no registered
+ * service must be a known MCP client, so a new capability never silently drops out of the docs.
+ */
+export function buildOAuthClientRows(input: {
+ capabilities: Readonly>
+ services: readonly OAuthServiceInfo[]
+ resolveCapability: (serviceId: string) => string | null
+ docsHrefForProvider: (providerId: string) => string | null
+ callbackPath: (providerId: string) => string
+}): OAuthClientRow[] {
+ const servicesByCapability = new Map()
+ for (const service of input.services) {
+ if (service.authType !== 'oauth') continue
+ const capabilityId =
+ input.resolveCapability(service.serviceId) ?? input.resolveCapability(service.providerId)
+ if (!capabilityId) continue
+ servicesByCapability.set(capabilityId, [
+ ...(servicesByCapability.get(capabilityId) ?? []),
+ service,
+ ])
+ }
+
+ const rows: OAuthClientRow[] = []
+ for (const [capabilityId, envFields] of Object.entries(input.capabilities)) {
+ if (DEDICATED_SECTIONS.has(capabilityId)) continue
+ const services = servicesByCapability.get(capabilityId) ?? []
+ if (services.length === 0) {
+ const mcp = MCP_CLIENT_LABELS[capabilityId]
+ if (!mcp) {
+ throw new Error(
+ `OAuth client "${capabilityId}" configures no registered service; add it to MCP_CLIENT_LABELS or DEDICATED_SECTIONS`
+ )
+ }
+ rows.push({
+ capabilityId,
+ services: [{ name: mcp.name, href: mcp.href }],
+ envFields,
+ callbackPaths: [input.callbackPath(capabilityId)],
+ })
+ continue
+ }
+ const providerIds = [
+ ...new Set(services.flatMap((s) => [s.providerId, ...(s.additionalProviderIds ?? [])])),
+ ]
+ rows.push({
+ capabilityId,
+ services: services
+ .map((s) => ({ name: s.name, href: input.docsHrefForProvider(s.providerId) }))
+ .sort((a, b) => compareStrings(a.name.toLowerCase(), b.name.toLowerCase())),
+ envFields,
+ callbackPaths: [...new Set(providerIds.map(input.callbackPath))],
+ })
+ }
+ return rows.sort((a, b) =>
+ compareStrings(a.services[0].name.toLowerCase(), b.services[0].name.toLowerCase())
+ )
+}
+
+export function renderOAuthClientTable(rows: readonly OAuthClientRow[]): string {
+ const lines = ['', '| Service | Environment variables | Redirect URI |', '| --- | --- | --- |']
+ for (const row of rows) {
+ const services = row.services
+ .map((s) => (s.href ? `[${escapeTableCell(s.name)}](${s.href})` : escapeTableCell(s.name)))
+ .join(', ')
+ const env = row.envFields.map((field) => `\`${field}\``).join(', ')
+ const callbacks = row.callbackPaths.map((p) => `\`${p}\``).join('
')
+ lines.push(`| ${services} | ${env} | ${callbacks} |`)
+ }
+ lines.push('')
+ return lines.join('\n')
+}
+
+/**
+ * Reads `cronjobs.jobs` from the chart's values.yaml. Dependency-free like check-cron-parity: the
+ * block has a fixed shape, and a job missing any field, or an empty result, is an error rather
+ * than a silently shorter table.
+ */
+export function parseCronJobs(valuesYaml: string): CronJob[] {
+ const lines = valuesYaml.split('\n')
+ const start = lines.findIndex((line) => line.startsWith('cronjobs:'))
+ if (start === -1) throw new Error('values.yaml has no top-level `cronjobs:` block')
+
+ const jobs: CronJob[] = []
+ let inJobs = false
+ let current: Partial | null = null
+ const finish = () => {
+ if (!current) return
+ for (const field of ['name', 'schedule', 'path', 'description'] as const) {
+ if (!current[field]) throw new Error(`cronjobs.jobs.${current.key} has no ${field}`)
+ }
+ jobs.push(current as CronJob)
+ current = null
+ }
+
+ for (const line of lines.slice(start + 1)) {
+ if (/^[a-zA-Z]/.test(line)) break
+ if (/^ {2}jobs:\s*$/.test(line)) {
+ inJobs = true
+ continue
+ }
+ if (/^ {2}[a-zA-Z]/.test(line)) {
+ finish()
+ inJobs = false
+ continue
+ }
+ if (!inJobs) continue
+ const key = line.match(/^ {4}([a-zA-Z0-9]+):\s*$/)
+ if (key) {
+ finish()
+ current = { key: key[1] }
+ continue
+ }
+ const field = line.match(/^ {6}(name|schedule|path|description):\s*(.*?)\s*$/)
+ if (field && current) current[field[1] as 'name'] = unquoteYamlScalar(field[2])
+ }
+ finish()
+ if (jobs.length === 0) throw new Error('parsed no jobs from cronjobs.jobs')
+ return jobs
+}
+
+/** A plain, double-quoted, or single-quoted YAML scalar as its string value. */
+export function unquoteYamlScalar(raw: string): string {
+ if (raw.length >= 2 && raw.startsWith('"') && raw.endsWith('"')) {
+ return raw.slice(1, -1).replace(/\\"/g, '"')
+ }
+ if (raw.length >= 2 && raw.startsWith("'") && raw.endsWith("'")) {
+ return raw.slice(1, -1).replace(/''/g, "'")
+ }
+ return raw
+}
+
+/** Text safe inside a Markdown table cell. */
+export function escapeTableCell(text: string): string {
+ return text.replace(/\|/g, '\\|')
+}
+
+export function renderCronTable(jobs: readonly CronJob[]): string {
+ const lines = ['', '| Job | Endpoint | Schedule | Does |', '| --- | --- | --- | --- |']
+ for (const job of jobs) {
+ lines.push(
+ `| \`${job.name}\` | \`${job.path}\` | \`${job.schedule}\` | ${escapeTableCell(job.description)} |`
+ )
+ }
+ lines.push('')
+ return lines.join('\n')
+}
+
+/** Names declared by a zod env schema written one key per line (` KEY: z.…`). */
+export function zodEnvNames(source: string): Set {
+ return new Set([...source.matchAll(/^\s+([A-Z][A-Z0-9_]+)\s*:\s*z\./gm)].map((m) => m[1]))
+}
+
+const ENV_NAME = '[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+'
+
+/** A YAML or shell line with its comment removed: a full-line `#` comment, or ` # …` after code. */
+function withoutComment(line: string): string {
+ if (/^\s*#/.test(line)) return ''
+ return line.replace(/\s+#.*$/, '')
+}
+
+/**
+ * Env names a chart file declares: mapping keys (` NAME: value`, `- NAME: value`) and
+ * `name: NAME` / `"key" "NAME"` references, ignoring comments.
+ */
+export function yamlEnvNames(source: string): Set {
+ const names = new Set()
+ const key = new RegExp(`^\\s*(?:-\\s+)?(${ENV_NAME})\\s*:`)
+ const reference = new RegExp(`(?:\\bname:\\s*|"key"\\s+)["']?(${ENV_NAME})\\b`, 'g')
+ for (const raw of source.split('\n')) {
+ const line = withoutComment(raw)
+ const match = key.exec(line)
+ if (match) names.add(match[1])
+ for (const ref of line.matchAll(reference)) names.add(ref[1])
+ }
+ return names
+}
+
+/** Env names a Compose file or crontab sets or reads (`NAME=`, `${NAME`, `$NAME`), ignoring comments. */
+export function shellEnvNames(source: string): Set {
+ const names = new Set()
+ const patterns = [
+ new RegExp(`(?:^|[\\s'"-])(${ENV_NAME})=`, 'g'),
+ new RegExp(`\\$\\{?(${ENV_NAME})`, 'g'),
+ ]
+ for (const raw of source.split('\n')) {
+ const line = withoutComment(raw)
+ for (const pattern of patterns) for (const m of line.matchAll(pattern)) names.add(m[1])
+ }
+ return names
+}
+
+/** Env names a TypeScript module spells as string literals (`'NAME'`). */
+export function quotedEnvNames(source: string): Set {
+ return new Set(
+ [...source.matchAll(new RegExp(`['"\`](${ENV_NAME})['"\`]`, 'g'))].map((m) => m[1])
+ )
+}
+
+/**
+ * Backticked env names in MDX prose: `NAME` or `NAME=value`. Fenced code is skipped, since it holds
+ * shell variables and other software's settings that need no declaration.
+ */
+export function backtickedEnvNames(mdx: string): { name: string; line: number }[] {
+ const found: { name: string; line: number }[] = []
+ let inFence = false
+ mdx.split('\n').forEach((text, index) => {
+ if (/^\s*```/.test(text)) {
+ inFence = !inFence
+ return
+ }
+ if (inFence) return
+ for (const match of text.matchAll(/`([^`\n]+)`/g)) {
+ const name = match[1].match(/^([A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+)(?:=.*)?$/)
+ if (name) found.push({ name: name[1], line: index + 1 })
+ }
+ })
+ return found
+}
+
+export function releasePins(mdx: string): { version: string; line: number }[] {
+ const found: { version: string; line: number }[] = []
+ mdx.split('\n').forEach((text, index) => {
+ for (const match of text.matchAll(/\bv\d+\.\d+\.\d+\b/g)) {
+ found.push({ version: match[0], line: index + 1 })
+ }
+ })
+ return found
+}
+
+function read(relativePath: string): string {
+ return readFileSync(path.join(ROOT, relativePath), 'utf8')
+}
+
+function declaredEnvNames(): Set {
+ const names = new Set([
+ ...zodEnvNames(read('apps/sim/lib/core/config/env.ts')),
+ ...zodEnvNames(read('apps/realtime/src/env.ts')),
+ ...yamlEnvNames(read('helm/sim/values.yaml')),
+ ...shellEnvNames(read('docker/crontab')),
+ ])
+ for (const file of readdirSync(ROOT).filter((f) => /^docker-compose.*\.ya?ml$/.test(f))) {
+ for (const name of shellEnvNames(read(file))) names.add(name)
+ }
+ const templatesDir = path.join(ROOT, 'helm/sim/templates')
+ for (const file of readdirSync(templatesDir, { recursive: true, encoding: 'utf8' })) {
+ if (!/\.(ya?ml|tpl|txt)$/.test(file)) continue
+ for (const name of yamlEnvNames(read(`helm/sim/templates/${file}`))) names.add(name)
+ }
+ for (const file of sourceFilesReadingEnv()) {
+ for (const name of envReads(read(file))) names.add(name)
+ }
+ for (const name of quotedEnvNames(read('packages/deployment-config/src/registration.ts'))) {
+ names.add(name)
+ }
+ const poolProfiles = read('packages/db/pool-profiles.ts')
+ for (const match of poolProfiles.matchAll(/^\s+([a-z]+):\s*\{/gm)) {
+ names.add(`DATABASE_URL_${match[1].toUpperCase()}`)
+ }
+ return names
+}
+
+/** Names a source file reads straight from the environment: `process.env.NAME` or `process.env['NAME']`. */
+export function envReads(source: string): Set {
+ return new Set(
+ [...source.matchAll(/process\.env(?:\.([A-Z][A-Z0-9_]+)|\[['"]([A-Z][A-Z0-9_]+)['"]\])/g)].map(
+ (m) => m[1] ?? m[2]
+ )
+ )
+}
+
+/** Tracked, non-test sources of the apps and packages, where env reads outside the schemas live. */
+function sourceFilesReadingEnv(): string[] {
+ const output = execFileSync('git', ['ls-files', '-z', '--', 'apps', 'packages'], {
+ cwd: ROOT,
+ encoding: 'utf8',
+ maxBuffer: 64 * 1024 * 1024,
+ })
+ return output
+ .split('\0')
+ .filter(
+ (file) =>
+ /\.(ts|tsx|mts|js|mjs)$/.test(file) &&
+ !/\.test\.|\/__tests__\/|\/node_modules\//.test(file) &&
+ !file.startsWith('apps/docs/')
+ )
+}
+
+function callbackPath(providerId: string): string {
+ const override = CALLBACK_OVERRIDES[providerId]
+ if (!override) return `${DEFAULT_CALLBACK_PREFIX}${providerId}`
+ if (!existsSync(path.join(ROOT, override.route, 'route.ts'))) {
+ throw new Error(`${providerId}: no route serves ${override.path} (${override.route})`)
+ }
+ return override.path
+}
+
+/**
+ * Maps each provider to the integration page whose generated OAuth section registers its
+ * redirect, so the table links to that page's scope list rather than repeating it.
+ */
+function integrationDocsIndex(): Map {
+ const pages = readdirSync(INTEGRATIONS_DOCS_DIR)
+ .filter((f) => f.endsWith('.mdx'))
+ .sort(compareStrings)
+ .map((file) => ({
+ slug: file.replace(/\.mdx$/, ''),
+ doc: readFileSync(path.join(INTEGRATIONS_DOCS_DIR, file), 'utf8'),
+ }))
+ return pickIntegrationPages(pages)
+}
+
+/**
+ * For each provider, the page whose OAuth section registers its redirect. When several pages
+ * do, the one named after the provider wins, then the first by name, so the result never
+ * depends on directory order.
+ */
+export function pickIntegrationPages(
+ pages: readonly { slug: string; doc: string }[]
+): Map {
+ const candidates = new Map()
+ for (const { slug, doc } of [...pages].sort((a, b) => compareStrings(a.slug, b.slug))) {
+ if (!doc.includes('[#oauth-scopes]')) continue
+ for (const match of doc.matchAll(
+ /\/api\/auth\/oauth2\/callback\/([a-z0-9-]+)/g
+ )) {
+ const slugs = candidates.get(match[1]) ?? []
+ if (!slugs.includes(slug)) slugs.push(slug)
+ candidates.set(match[1], slugs)
+ }
+ }
+ const index = new Map()
+ for (const [providerId, slugs] of candidates) {
+ const named = slugs.find((slug) => slug.replace(/_/g, '-') === providerId)
+ index.set(providerId, `/integrations/${named ?? slugs[0]}#oauth-scopes`)
+ }
+ return index
+}
+
+/**
+ * Provider IDs a hand-written section lists in the row for a client's env fields, compared with
+ * the registry, so a new Google or Microsoft service cannot be missing from its section.
+ */
+export function findProviderListDrift(
+ doc: string,
+ firstEnvField: string,
+ expected: readonly string[]
+): string | null {
+ const row = doc.split('\n').find((line) => line.startsWith(`| \`${firstEnvField}\``))
+ if (!row) return `no provider row for ${firstEnvField}`
+ const cells = row.split('|')
+ const listed = [...(cells[2] ?? '').matchAll(/`([a-z0-9-]+)`/g)].map((m) => m[1])
+ const missing = expected.filter((id) => !listed.includes(id))
+ const extra = listed.filter((id) => !expected.includes(id))
+ if (missing.length === 0 && extra.length === 0) return null
+ return `${firstEnvField} row: missing ${missing.join(', ') || 'none'}; not registered ${extra.join(', ') || 'none'}`
+}
+
+async function generate(): Promise<{ files: Map; errors: string[] }> {
+ const [utils, capabilities] = await Promise.all([
+ import(path.join(ROOT, 'apps/sim/lib/oauth/utils.ts')),
+ import(path.join(ROOT, 'packages/deployment-config/src/env-capabilities.ts')),
+ ])
+ const docsIndex = integrationDocsIndex()
+ const rows = buildOAuthClientRows({
+ capabilities: capabilities.OAUTH_CLIENT_CAPABILITIES,
+ services: utils.getAllOAuthServices(),
+ resolveCapability: capabilities.resolveOAuthClientCapabilityId,
+ docsHrefForProvider: (providerId) => docsIndex.get(providerId) ?? null,
+ callbackPath,
+ })
+ const jobs = parseCronJobs(read('helm/sim/values.yaml'))
+
+ const errors: string[] = []
+ const services: OAuthServiceInfo[] = utils.getAllOAuthServices()
+ for (const [capabilityId, firstEnvField] of [
+ ['google', 'GOOGLE_CLIENT_ID'],
+ ['microsoft', 'MICROSOFT_CLIENT_ID'],
+ ] as const) {
+ const expected = services
+ .filter(
+ (service) =>
+ service.authType === 'oauth' &&
+ capabilities.resolveOAuthClientCapabilityId(service.serviceId) === capabilityId
+ )
+ .map((service) => service.providerId)
+ const drift = findProviderListDrift(readFileSync(OAUTH_DOC, 'utf8'), firstEnvField, expected)
+ if (drift) errors.push(`integrations-oauth.mdx: ${drift}`)
+ }
+
+ const out = new Map()
+ out.set(
+ OAUTH_DOC,
+ replaceBetweenMarkers(
+ readFileSync(OAUTH_DOC, 'utf8'),
+ OAUTH_MARKER,
+ renderOAuthClientTable(rows)
+ )
+ )
+ out.set(
+ JOBS_DOC,
+ replaceBetweenMarkers(readFileSync(JOBS_DOC, 'utf8'), JOBS_MARKER, renderCronTable(jobs))
+ )
+ return { files: out, errors }
+}
+
+function lint(): string[] {
+ const declared = declaredEnvNames()
+ const errors: string[] = []
+ for (const file of readdirSync(SELF_HOSTING_DIR).filter((f) => f.endsWith('.mdx'))) {
+ const mdx = readFileSync(path.join(SELF_HOSTING_DIR, file), 'utf8')
+ for (const { name, line } of backtickedEnvNames(mdx)) {
+ if (declared.has(name) || ENV_TOKEN_ALLOWLIST.has(name) || RETIRED_ENV_NAMES.has(name))
+ continue
+ errors.push(
+ `${file}:${line}: \`${name}\` is not declared by the app, realtime, chart, or Compose files`
+ )
+ }
+ const allowedPins = RELEASE_PIN_ALLOWLIST[file] ?? []
+ for (const { version, line } of releasePins(mdx)) {
+ if (allowedPins.includes(version)) continue
+ errors.push(
+ `${file}:${line}: release pin ${version}; use or the chart's appVersion`
+ )
+ }
+ }
+ return errors
+}
+
+async function main(): Promise {
+ const checkMode = process.argv.includes('--check')
+ const { files: generated, errors: driftErrors } = await generate()
+
+ if (checkMode) {
+ const errors = [...driftErrors, ...lint()]
+ for (const [file, next] of generated) {
+ if (readFileSync(file, 'utf8') !== next) {
+ errors.push(
+ `${path.relative(ROOT, file)} is out of date; run \`bun run generate:self-hosting-docs\``
+ )
+ }
+ }
+ if (errors.length > 0) {
+ console.error(`self-hosting-docs:\n- ${errors.join('\n- ')}`)
+ process.exit(1)
+ }
+ console.log('self-hosting-docs: up to date.')
+ return
+ }
+
+ if (driftErrors.length > 0) {
+ console.error(`self-hosting-docs:\n- ${driftErrors.join('\n- ')}`)
+ process.exit(1)
+ }
+ for (const [file, next] of generated) {
+ if (readFileSync(file, 'utf8') === next) continue
+ writeFileSync(file, next)
+ console.log(`self-hosting-docs: updated ${path.relative(ROOT, file)}`)
+ }
+}
+
+if (import.meta.main) await main()