|
27 | 27 | ### Self-hosted |
28 | 28 |
|
29 | 29 | ```bash |
30 | | -npx simstudio |
| 30 | +git clone https://github.com/simstudioai/sim.git && cd sim |
| 31 | +bun run setup |
31 | 32 | ``` |
32 | 33 |
|
33 | 34 | Open [http://localhost:3000](http://localhost:3000) |
34 | 35 |
|
35 | | -Docker must be installed and running. Use `-p, --port <port>` to run Sim on a different port, or `--no-pull` to skip pulling the latest Docker images. |
36 | | - |
37 | 36 | <p align="center"> |
38 | 37 | <img src="apps/sim/public/static/readme-platform.png" alt="The Sim platform — chat on the left, the visual workflow builder on the right" width="100%"/> |
39 | 38 | </p> |
@@ -75,71 +74,36 @@ Docker must be installed and running. Use `-p, --port <port>` to run Sim on a di |
75 | 74 |
|
76 | 75 | ## Self-hosting |
77 | 76 |
|
78 | | -### Docker Compose |
79 | | - |
80 | | -```bash |
81 | | -git clone https://github.com/simstudioai/sim.git && cd sim |
82 | | -docker compose -f docker-compose.prod.yml up -d |
83 | | -``` |
84 | | - |
85 | | -Open [http://localhost:3000](http://localhost:3000) |
86 | | - |
87 | | -Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https://docs.vllm.ai/). See the [Docker self-hosting docs](https://docs.sim.ai/self-hosting/docker) for setup details. |
88 | | - |
89 | | -### Manual Setup |
90 | | - |
91 | | -**Requirements:** [Bun](https://bun.sh/), [Node.js](https://nodejs.org/) v20+, PostgreSQL 12+ with [pgvector](https://github.com/pgvector/pgvector) |
92 | | - |
93 | | -1. Clone and install: |
| 77 | +**Requirements:** [Bun](https://bun.sh/) and [Docker](https://www.docker.com/). |
94 | 78 |
|
95 | | -```bash |
96 | | -git clone https://github.com/simstudioai/sim.git |
97 | | -cd sim |
98 | | -bun install |
99 | | -bun run prepare # Set up pre-commit hooks |
100 | | -``` |
101 | | - |
102 | | -2. Set up PostgreSQL with pgvector: |
103 | | - |
104 | | -```bash |
105 | | -docker run --name simstudio-db -e POSTGRES_PASSWORD=your_password -e POSTGRES_DB=simstudio -p 5432:5432 -d pgvector/pgvector:pg17 |
106 | | -``` |
| 79 | +`bun run setup` is an interactive wizard: it provisions the database, generates secrets, writes your `.env` files, connects a Chat API key, and starts Sim the way you choose: |
107 | 80 |
|
108 | | -Or install manually via the [pgvector guide](https://github.com/pgvector/pgvector#installation). |
| 81 | +- **Local dev** — run from source to contribute or hack on Sim |
| 82 | +- **Docker Compose** — a self-contained instance for testing self-hosting |
| 83 | +- **Kubernetes (Helm)** — deploy to a local cluster |
109 | 84 |
|
110 | | -3. Configure environment: |
| 85 | +When it finishes, open [http://localhost:3000](http://localhost:3000). |
111 | 86 |
|
112 | | -```bash |
113 | | -cp apps/sim/.env.example apps/sim/.env |
114 | | -# Create your secrets |
115 | | -perl -i -pe "s/your_encryption_key/$(openssl rand -hex 32)/" apps/sim/.env |
116 | | -perl -i -pe "s/your_internal_api_secret/$(openssl rand -hex 32)/" apps/sim/.env |
117 | | -perl -i -pe "s/your_api_encryption_key/$(openssl rand -hex 32)/" apps/sim/.env |
118 | | -# DB configs for migration |
119 | | -cp packages/db/.env.example packages/db/.env |
120 | | -# Edit both .env files to set DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio" |
121 | | -``` |
122 | | - |
123 | | -4. Run migrations: |
| 87 | +Manage your install with `bun run sim`: |
124 | 88 |
|
125 | 89 | ```bash |
126 | | -cd packages/db && bun run db:migrate |
| 90 | +bun run sim start | stop | restart # bring your install up / down / cycle |
| 91 | +bun run sim status # what's installed and healthy |
| 92 | +bun run sim logs # follow logs |
| 93 | +bun run sim doctor # diagnose configuration problems |
| 94 | +bun run sim down # remove containers (data kept) |
| 95 | +bun run sim reset # archive .env and wipe managed data |
127 | 96 | ``` |
128 | 97 |
|
129 | | -5. Start development servers: |
| 98 | +`sim` detects how you're running (Docker Compose, local dev, or Kubernetes) and acts accordingly. |
130 | 99 |
|
131 | | -```bash |
132 | | -bun run dev:full # Starts Next.js app and realtime socket server |
133 | | -``` |
| 100 | +Prefer a bare `sim`? Run `bun link` once — but note `sim` lands in `~/.bun/bin`, which Homebrew's bun doesn't add to your PATH, so you may need `export PATH="$HOME/.bun/bin:$PATH"` in your shell profile. |
134 | 101 |
|
135 | | -Or run separately: `bun run dev` (Next.js) and `cd apps/sim && bun run dev:sockets` (realtime). |
| 102 | +Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https://docs.vllm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details. |
136 | 103 |
|
137 | 104 | ## Chat API Keys |
138 | 105 |
|
139 | | -Chat is a Sim-managed service. To use Chat on a self-hosted instance: |
140 | | - |
141 | | -- Go to https://sim.ai → Settings → Chat keys and generate a Chat API key |
142 | | -- Set `COPILOT_API_KEY` environment variable in your self-hosted apps/sim/.env file to that value |
| 106 | +Chat is a Sim-managed service. `bun run 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). |
143 | 107 |
|
144 | 108 | ## Environment Variables |
145 | 109 |
|
|
0 commit comments