Skip to content
Open
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
9 changes: 9 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ After running this command, open [http://localhost:3000/](http://localhost:3000/
git clone https://github.com/<your-username>/sim.git
cd sim

# Generate the required secrets. Docker Compose reads them from this .env file.
# BETTER_AUTH_SECRET, ENCRYPTION_KEY, and INTERNAL_API_SECRET are mandatory —
# without them the containers start but creating the first account fails.
cat > .env <<EOF
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
EOF

# Start Sim
docker compose -f docker-compose.prod.yml up -d
```
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,21 @@ Docker must be installed and running. Use `-p, --port <port>` to run Sim on a di

```bash
git clone https://github.com/simstudioai/sim.git && cd sim

# Generate the required secrets. Docker Compose reads them from this .env file.
cat > .env <<EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Existing Environment Is Truncated

Running this step in an existing checkout replaces the entire root .env, deleting settings such as POSTGRES_PASSWORD, TRUSTED_ORIGINS, REDIS_URL, and API keys. Rerunning it also rotates persistent auth and encryption secrets, which invalidates sessions and can make previously encrypted data unreadable; generate only missing entries or stop when .env already exists. The mirrored command in .github/CONTRIBUTING.md has the same behavior.

BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
EOF

docker compose -f docker-compose.prod.yml up -d
```

Open [http://localhost:3000](http://localhost:3000)

> **`BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, and `INTERNAL_API_SECRET` are mandatory.** Without them the containers start but creating the first account fails silently. Compose now refuses to start and names the missing variable if you skip this step.

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.

### Manual Setup
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ services:
# addition to NEXT_PUBLIC_APP_URL. Use when serving from multiple domains
# (apex + www, alias hostnames, reverse-proxy IPs). Empty by default.
- TRUSTED_ORIGINS=${TRUSTED_ORIGINS:-}
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:?BETTER_AUTH_SECRET is required. Generate a 32-byte hex value with openssl rand -hex 32}
- ENCRYPTION_KEY=${ENCRYPTION_KEY:?ENCRYPTION_KEY is required. Generate a 32-byte hex value with openssl rand -hex 32}
- API_ENCRYPTION_KEY=${API_ENCRYPTION_KEY:-}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET:?INTERNAL_API_SECRET is required. Generate a 32-byte hex value with openssl rand -hex 32}
- REDIS_URL=${REDIS_URL:-}
- COPILOT_API_KEY=${COPILOT_API_KEY}
- SIM_AGENT_API_URL=${SIM_AGENT_API_URL}
Expand Down Expand Up @@ -60,8 +60,8 @@ services:
- DATABASE_URL=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-simstudio}
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
- BETTER_AUTH_URL=${BETTER_AUTH_URL:-http://localhost:3000}
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET}
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:?BETTER_AUTH_SECRET is required. Generate a 32-byte hex value with openssl rand -hex 32}
- INTERNAL_API_SECRET=${INTERNAL_API_SECRET:?INTERNAL_API_SECRET is required. Generate a 32-byte hex value with openssl rand -hex 32}
- REDIS_URL=${REDIS_URL:-}
depends_on:
db:
Expand Down