Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/docs/content/docs/platform/enterprise/self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Set the server flag, then restart the application:
ENTERPRISE_ENABLED=true
```

The server flag controls access and everything the browser shows, including SSO on the login page and the Function block's **Sandbox** selector: the browser reads the server's resolved settings, so there is no `NEXT_PUBLIC_` variable to set. Browser variables left over from older releases do nothing; on a Compose install or source checkout, `bunx sim-setup doctor` reports them. See [Verify your install](/platform/self-hosting/verify).
The server flag controls access and everything the browser shows, including SSO on the login page and the Function block's **Sandbox** selector: the browser reads the server's resolved settings, so there is no `NEXT_PUBLIC_` variable to set. Browser variables left over from older releases do nothing; on a Compose install or source checkout, `npx sim-setup doctor` reports them. See [Verify your install](/platform/self-hosting/verify).

Individual flags override the master switch. For example, to enable the suite with data drains disabled:

Expand Down Expand Up @@ -268,7 +268,7 @@ JavaScript without `import`, `require`, a selected sandbox, or a sandbox file-pa
| Symptom | Check |
| --- | --- |
| A settings section is missing | Check its server flag and restart the app after changing environment variables. These values load at boot; a rebuild is not needed. |
| The login page has no SSO option, or Function has no Sandbox selector | Check `SSO_ENABLED` (or `ENTERPRISE_ENABLED`) and Sandbox readiness, then restart the app. Run `bunx sim-setup doctor` to check Sandbox readiness. |
| The login page has no SSO option, or Function has no Sandbox selector | Check `SSO_ENABLED` (or `ENTERPRISE_ENABLED`) and Sandbox readiness, then restart the app. Run `npx sim-setup doctor` to check Sandbox readiness. |
| **Settings → Sandboxes** shows an upgrade notice | Check Sandbox entitlement, provider credentials, and the immutable Function base. |
| An enabled feature has no effect in a workspace | Confirm that the workspace belongs to an organization. Use the backfill or workspace move procedure if needed. |
| Retention deletes nothing | Check `DATA_RETENTION_ENABLED`, explicit windows, scheduler requests, and `CRON_SECRET`. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The chart can also render the optional `copilot` service, its separate PostgreSQ
| **Secrets** | `ENCRYPTION_KEY`, `API_ENCRYPTION_KEY`, `BETTER_AUTH_SECRET`, `INTERNAL_API_SECRET`, `CRON_SECRET` | Secret manager and separate recovery copies |

<Callout type="error">
Neither the production Compose file nor the Helm chart mounts a volume for local uploads. Without configured cloud storage or your own volume, recreating the app container loses those files. Local files are also invisible to other replicas. Configure [object storage](/platform/self-hosting/object-storage) before storing durable files or scaling.
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.
</Callout>

<Callout type="error">
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/platform/self-hosting/desktop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Install the official Sim desktop app and connect it to your deployment. You do n
From your installation directory:

```bash
bunx sim-setup desktop
npx sim-setup desktop
```

The command reads Compose/Helm configuration, resolves the installer, and prints the download link and server URL. It offers to open the installer in your browser. Use `--no-open` to skip that prompt, or supply the public origin directly:

```bash
bunx sim-setup desktop --url https://sim.example.com --no-open
npx sim-setup desktop --url https://sim.example.com --no-open
```

`--url` skips discovery. Without the CLI, open `https://<your-sim-origin>/api/desktop/update/download` in a browser.
Expand Down
38 changes: 25 additions & 13 deletions apps/docs/content/docs/platform/self-hosting/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ Use the production Compose stack for a single-node installation. It starts the a

- Docker Engine or Docker Desktop, running.
- Docker Compose 2.24.0 or later. The file uses optional `env_file` entries introduced in that version.
- Bun for `bunx`, and Node.js 20 or later for the published `sim-setup` executable.
- 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.

## Quick start

```bash
bunx sim-setup
npx sim-setup
```

The wizard creates `./sim` with a generated `.env` and production Compose file, then starts published container images. Pass `--dir <path>` for another directory. Open [http://localhost:3000](http://localhost:3000).
The wizard creates `./sim` with a generated `.env` and production Compose file, then starts published container images. Pass `--dir <path>` 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.

For a manual installation, obtain the Compose file from a source checkout:

Expand Down Expand Up @@ -69,11 +69,20 @@ Set `CRON_SECRET` for scheduled work. Without it, the cron service prints instru

### 2. Configure durable uploads

<Callout type="warn">
The production Compose file persists PostgreSQL but does not mount `/app/apps/sim/uploads`. Recreating the app container loses uploads stored there. Configure object storage or a persistent mount before saving files you need to retain.
</Callout>
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

Follow [Object storage](/platform/self-hosting/object-storage) for AWS S3, Azure Blob, Google Cloud Storage, or local-volume configuration. Local disk is not shared across app replicas.
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
```

### 3. Start and verify services

Expand All @@ -92,8 +101,9 @@ curl -fsS http://localhost:3000/api/health
| `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` exited successfully. The migrator has no healthcheck because it is a one-shot job.
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
Expand Down Expand Up @@ -123,6 +133,8 @@ sim.yourdomain.com {

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
Expand All @@ -135,7 +147,7 @@ For production, keep this Compose stack and point `OLLAMA_URL` at an Ollama serv
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.
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.

```bash
docker compose -f docker-compose.prod.yml up -d
Expand Down Expand Up @@ -225,11 +237,11 @@ docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio

## The `sim-setup` CLI

Invoke commands as `bunx sim-setup <command>` 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. A stack started with the Ollama overlay is managed as a production install, through `docker-compose.prod.yml` alone: the CLI acts on the Sim services and leaves the Ollama container untouched.
Invoke commands as `npx sim-setup <command>` 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.

| Command | Behavior |
| --- | --- |
| `sim-setup` | Wizard. `--quick` uses defaults and asks essential questions; `--mode compose\|dev\|k8s` chooses the target. Dev and Kubernetes modes require a source checkout. |
| `sim-setup` | Wizard. `--quick` uses defaults and asks essential questions; `--mode compose\|dev\|k8s` chooses the target; `--url <origin>` 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. |
Expand Down Expand Up @@ -261,12 +273,12 @@ Restore only to the intended database:
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; file uploads and encryption keys need separate backups.
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
bunx sim-setup update
npx sim-setup update
```

Read [Upgrades](/platform/self-hosting/upgrades) before updating or restoring an existing installation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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 `bunx 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. `bunx 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.
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
Expand Down Expand Up @@ -214,7 +214,7 @@ Plain JavaScript without imports runs in isolated-vm within Node child workers i
| `COPILOT_API_KEY` | API key for the Chat service (the Mothership). Required for Chat, the Sim Chat workflow block, and Inbox operations that use that service. See [Chat service](/platform/self-hosting/chat) |
| `SIM_AGENT_API_URL` | Mothership origin the Sim server calls. Defaults to `https://www.copilot.sim.ai`, the Sim-hosted service |
| `MOTHERSHIP_SIM_TRANSPORT` | `direct` (the Mothership calls Sim) or `checkpoint` (Sim polls the Mothership for workspace tool calls over outbound HTTPS). Self-hosted Sim defaults to `checkpoint` |
| `NEXT_PUBLIC_CHAT_DISABLED` | Set to `true` to hide the Chat module: the workspace lands on your first workflow, with no chats list or editor Chat panel. Chat is shown when unset; `bunx sim-setup` sets it for you if you skip the chat key |
| `NEXT_PUBLIC_CHAT_DISABLED` | Set to `true` to hide the Chat module: the workspace lands on your first workflow, with no chats list or editor Chat panel. Chat is shown when unset; `npx sim-setup` sets it for you if you skip the chat key |
| `PII_URL` | Base URL of the Presidio service backing PII detection and redaction. The Helm chart wires it to its own `pii` Service when `pii.enabled`; on Compose point it at the PII service on your network. Local development and the Helm fallback use `http://localhost:5001`; that address works only when the service is reachable there. Point production at a running service to use redaction |
| `ADMIN_API_KEY` | Admin API key for GitOps operations and organization provisioning |

Expand All @@ -236,7 +236,7 @@ Most enterprise features read their settings from the organization that owns a w

## File storage

By default Sim writes uploads to local disk. Neither stock production Compose nor the default Helm chart mounts the upload directory, so configure cloud storage or a persistent local layout before retaining files. See [Object storage](/platform/self-hosting/object-storage) for the full setup, bucket layout, and IAM policy.
By default Sim writes uploads to local disk. See [Object storage](/platform/self-hosting/object-storage) for the setup, bucket layout, and IAM policy.

| Variable | Description |
|----------|-------------|
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/platform/self-hosting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Compose bundles PostgreSQL, Redis, and a scheduler. The Helm chart bundles Postg

## Quick start

Install Bun, Node.js 20 or newer, Docker, and Docker Compose 2.24.0 or later, then run:
Install Node.js 20 or newer, Docker, and Docker Compose 2.24.0 or later, then run:

```bash
bunx sim-setup
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).
Expand Down Expand Up @@ -50,7 +50,7 @@ These are sizing suggestions, not enforced minimums or capacity guarantees. The
- Verify [background jobs](/platform/self-hosting/background-jobs), including the scheduler's `CRON_SECRET`.

<Callout type="warn">
Recreating an app container with unmounted local uploads loses those files. Losing an encryption key makes the data encrypted with it unreadable. A database backup does not replace file storage or key backups.
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.
</Callout>

Run [Verify your install](/platform/self-hosting/verify) before opening the deployment to your team and after upgrades or restores.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Configure file storage before uploading durable files or adding app replicas. Si
| **[Google Cloud Storage](https://cloud.google.com/storage)** | Production on GCP |

<Callout type="warn">
Local disk writes to `/app/apps/sim/uploads` inside the container. Neither `docker-compose.prod.yml` nor the Helm chart mounts a volume there, so every uploaded file is lost the moment the container is recreated — and files are **not** shared across replicas. Mount your own volume at that path if you must stay on local disk; for any multi-replica or production deployment, use S3, Azure Blob, or Google Cloud Storage.
Local disk writes to `/app/apps/sim/uploads` inside the container. `docker-compose.prod.yml` mounts the `sim_uploads` volume there, so files survive container recreation, but they stay on that one host and are **not** shared across replicas. The Helm chart mounts no volume there, so recreating a pod loses them. For any multi-replica or production deployment, use S3, Azure Blob, or Google Cloud Storage.
</Callout>

## How the backend is selected
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/self-hosting/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ The Compose files do not publish `db` on a host port. `simstudio`, `realtime`, a
- **You set `POSTGRES_PASSWORD` before the first start.** Nothing else to do — updating the file closes the port.
- **You never set it.** Postgres applies `POSTGRES_PASSWORD` only when it creates the data volume, so the database still uses `postgres`. Set `POSTGRES_PASSWORD=postgres` in `.env` so the stack starts, then rotate it: run `docker compose -f docker-compose.prod.yml exec db psql -U postgres -c "ALTER ROLE CURRENT_USER PASSWORD '<new password>'"` (with your `POSTGRES_USER` in place of `postgres` if you set one), set `POSTGRES_PASSWORD` to the same value, and run `docker compose -f docker-compose.prod.yml up -d`. Setting a new value in `.env` alone does not change the database's password and locks the app out.

`bunx sim-setup start` and `bunx sim-setup update` write the right value for you and print the rotation steps.
`npx sim-setup start` and `npx sim-setup update` write the right value for you and print the rotation steps.
</Callout>

To reach the database from the host — `psql`, a desktop client, a backup job — use `docker compose -f docker-compose.prod.yml exec db psql -U postgres simstudio`, or pass a second Compose file that publishes it on loopback only and connect over an SSH tunnel:
Expand Down
Loading
Loading