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
20 changes: 11 additions & 9 deletions apps/docs/content/docs/platform/self-hosting/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The wizard writes `docker-compose.prod.yml` and a generated `.env` to `./sim`, a

## Manual install [#production-setup]

Fetch the Compose file from the [release](https://github.com/simstudioai/sim/releases) you want to run:
Fetch the Compose file from the [release](https://github.com/simstudioai/sim/releases) you want to run. Use a `vX.Y.Z` release tag (e.g. the release marked Latest), not a `helm-chart-*` tag:

```bash
mkdir sim && cd sim
Expand Down Expand Up @@ -78,11 +78,11 @@ curl -fsS http://localhost:3000/api/health

Then run [Verify your install](/platform/self-hosting/verify).

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).
Without object storage, uploads go to the `sim_uploads` volume on this host (Docker names it `<project>_sim_uploads`, after the Compose project name). Back it up with the commands in [Upgrades](/platform/self-hosting/upgrades#upgrade-procedure), or configure [object storage](/platform/self-hosting/object-storage).

## Serve your domain over TLS

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.
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 and Nginx configurations.

When the proxy runs on the same host, publish the app and realtime on loopback only. Keep the ports, which `sim-setup` checks:

Expand Down Expand Up @@ -142,17 +142,17 @@ To run Ollama, LM Studio, or vLLM with this stack, see [Local models](/platform/

## The `sim-setup` CLI

Run `npx sim-setup <command>`. 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.
Run `npx sim-setup <command>`. Run the wizard, `doctor`, and `config` from the configuration directory. Lifecycle commands find running Compose stacks, source checkouts, and the `sim-dev` Helm release that `--mode k8s` creates (not other 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; `--mode compose\|dev\|k8s` picks the target (dev and k8s need a source checkout: run `bun run sim-setup` from the repo root); `--url <origin>` sets a Compose install's public URL. |
| `status` | Reports detected installations and their health. |
| `logs` | Follows Compose logs or the Kubernetes app Deployment. |
| `logs` | Follows Compose logs or the `sim-dev` release's 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. |
| `update` | Refreshes the Compose file, pulls the images for `SIM_VERSION` (or rebuilds a source stack), and recreates the services. Works for `sim-setup` and manual installs; a manually downloaded Compose file is backed up beside itself before it is replaced. `--yes` skips the prompts for that and for uploads still inside an old app container. Refuses dev and Kubernetes installs. |
| `down` | Removes managed containers, or uninstalls the `sim-dev` Helm release, after confirming. Data volumes remain. |
| `reset` | Archives env files and removes managed Compose data after confirming. On Kubernetes it uninstalls the `sim-dev` release; PostgreSQL PVCs remain. |
| `config` | Reports configured capabilities and integrations. |
| `doctor` | Checks env files and reachable services. `--fix` writes supported repairs; `--json` prints structured findings. |
| `add <feature>` | Configures `email`, `storage`, `sandbox`, `jobs`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>` in a writable `.env`. Refuses Helm releases. |
Expand All @@ -166,4 +166,6 @@ Run `npx sim-setup <command>`. Run the wizard, `doctor`, and `config` from the c

## Back up and upgrade [#commands]

Back up the database, the `sim_uploads` volume, and `.env`. [Upgrades](/platform/self-hosting/upgrades) has the backup, update, and rollback commands.
Back up the database, the `<project>_sim_uploads` volume, and `.env`. [Upgrades](/platform/self-hosting/upgrades) has the backup, update, and rollback commands.

To upgrade, set `SIM_VERSION` in `.env` and run `npx sim-setup update`, for a `sim-setup` or a manual install; it backs up a manually downloaded Compose file first, and `--yes` runs it without prompting. Without `sim-setup`, download `docker-compose.prod.yml` from the new `vX.Y.Z` tag as in [Manual install](#production-setup), set `SIM_VERSION` to that tag, and run `docker compose pull && docker compose up -d` (with `-f docker-compose.prod.yml` unless `COMPOSE_FILE` is set).
23 changes: 20 additions & 3 deletions apps/docs/content/docs/platform/self-hosting/kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ The Helm chart deploys the app, realtime, migrations (as an init container on th
- An ingress controller and a TLS certificate for public access.
- `metrics-server` for autoscaling, and the External Secrets Operator if you use it.

EKS Auto Mode has no default StorageClass, so the bundled PostgreSQL's volume stays Pending. Create one with Auto Mode's EBS provisioner (the name `gp3` is the one `values-aws.yaml` selects), or set `postgresql.persistence.storageClass` to a class you have:

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gp3
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: ebs.csi.eks.amazonaws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
type: gp3
encrypted: "true"
```
## 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:
Expand Down Expand Up @@ -95,6 +111,7 @@ postgresql:
size: 50Gi
```

- With External Secrets, move `NEXT_PUBLIC_APP_URL` from `app.env` to `app.envDefaults` and `realtime.envDefaults`: the chart refuses an `app.env` key that `externalSecrets.remoteRefs.app` does not map. See the [External Secrets example](#secret-store-examples).
- `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).
Expand Down Expand Up @@ -122,7 +139,7 @@ helm install sim oci://ghcr.io/simstudioai/charts/sim \
--set postgresql.auth.password="$POSTGRES_PASSWORD"
```

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.
With an existing Secret or External Secrets, drop the `--set` lines; with External Secrets, `NEXT_PUBLIC_APP_URL` must be in `app.envDefaults` and `realtime.envDefaults`, not `app.env` (step 5). Render first with `helm template` and the same arguments to review what will be applied.

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):

Expand All @@ -140,7 +157,7 @@ kubectl get cronjobs -n simstudio
curl -fsS https://sim.yourdomain.com/api/health
```

Run `helm test sim -n simstudio --logs`, then [Verify your install](/platform/self-hosting/verify).
Run `helm test sim -n simstudio --logs --timeout 10m`, then [Verify your install](/platform/self-hosting/verify).

## Secret store examples [#secret-store-examples]

Expand All @@ -159,7 +176,7 @@ postgresql:
name: sim-postgresql-secret
```

**External Secrets Operator.** Create the store and remote keys first. Non-secret values go in `envDefaults`:
**External Secrets Operator.** Create the store and remote keys first. Non-secret values go in `envDefaults`, including `NEXT_PUBLIC_APP_URL` from step 5: the chart refuses any `app.env` key not mapped in `remoteRefs.app`:

```yaml
app:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ Each tab names the chart's example values file. Fetch it at your chart's `helm-c
| 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 |
| EBS CSI driver and a `gp3` StorageClass | The example selects `gp3`; confirm it exists with the installed provisioner. EKS Auto Mode has no default StorageClass; create one as in [Kubernetes prerequisites](/platform/self-hosting/kubernetes#prerequisites) |
| 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 |

**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).
**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). On Auto Mode they also need the `amazon-vpc-cni` ConfigMap that turns on NetworkPolicy enforcement ([Amazon EKS Auto Mode](/platform/self-hosting/sandboxes#amazon-eks-auto-mode)).

#### AWS GovCloud (US)

Expand Down
Loading
Loading