feat(i18n): update translations (#2238)

Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
This commit is contained in:
Waleed
2025-12-07 19:43:12 -08:00
committed by GitHub
parent 5b9f3d3d02
commit b49b8eeb9d
31 changed files with 3464 additions and 0 deletions

View File

@@ -0,0 +1,155 @@
---
title: Docker
description: Sim Studio mit Docker Compose bereitstellen
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Schnellstart
```bash
# Clone and start
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Öffnen Sie [http://localhost:3000](http://localhost:3000)
## Produktionseinrichtung
### 1. Umgebung konfigurieren
```bash
# Generate secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
```
### 2. Dienste starten
```bash
docker compose -f docker-compose.prod.yml up -d
```
### 3. SSL einrichten
<Tabs items={['Caddy (Empfohlen)', 'Nginx + Certbot']}>
<Tab value="Caddy (Empfohlen)">
Caddy verwaltet SSL-Zertifikate automatisch.
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
```
Erstellen Sie `/etc/caddy/Caddyfile`:
```
sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}
```
```bash
sudo systemctl restart caddy
```
</Tab>
<Tab value="Nginx + Certbot">
```bash
# Install
sudo apt install nginx certbot python3-certbot-nginx -y
# Create /etc/nginx/sites-available/sim
server {
listen 80;
server_name sim.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# Enable and get certificate
sudo ln -s /etc/nginx/sites-available/sim /etc/nginx/sites-enabled/
sudo certbot --nginx -d sim.yourdomain.com
```
</Tab>
</Tabs>
## Ollama
```bash
# With GPU
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
# CPU only
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
```
Zusätzliche Modelle herunterladen:
```bash
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
```
### Externes Ollama
Wenn Ollama auf Ihrem Host-Rechner läuft (nicht in Docker):
```bash
# macOS/Windows
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux - use your host IP
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
```
<Callout type="warning">
Innerhalb von Docker bezieht sich `localhost` auf den Container, nicht auf Ihren Host. Verwenden Sie `host.docker.internal` oder die IP-Adresse Ihres Hosts.
</Callout>
## Befehle
```bash
# View logs
docker compose -f docker-compose.prod.yml logs -f simstudio
# Stop
docker compose -f docker-compose.prod.yml down
# Update
docker compose -f docker-compose.prod.yml pull && docker compose -f docker-compose.prod.yml up -d
# Backup database
docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql
```

View File

@@ -0,0 +1,87 @@
---
title: Umgebungsvariablen
description: Konfigurationsreferenz für Sim Studio
---
import { Callout } from 'fumadocs-ui/components/callout'
## Erforderlich
| Variable | Beschreibung |
|----------|-------------|
| `DATABASE_URL` | PostgreSQL-Verbindungszeichenfolge |
| `BETTER_AUTH_SECRET` | Auth-Secret (32 Hex-Zeichen): `openssl rand -hex 32` |
| `BETTER_AUTH_URL` | Ihre App-URL |
| `ENCRYPTION_KEY` | Verschlüsselungsschlüssel (32 Hex-Zeichen): `openssl rand -hex 32` |
| `INTERNAL_API_SECRET` | Internes API-Secret (32 Hex-Zeichen): `openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | Öffentliche App-URL |
| `NEXT_PUBLIC_SOCKET_URL` | WebSocket-URL (Standard: `http://localhost:3002`) |
## KI-Anbieter
| Variable | Anbieter |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY_1` | Anthropic Claude |
| `GEMINI_API_KEY_1` | Google Gemini |
| `MISTRAL_API_KEY` | Mistral |
| `OLLAMA_URL` | Ollama (Standard: `http://localhost:11434`) |
<Callout type="info">
Für Lastausgleich fügen Sie mehrere Schlüssel mit den Suffixen `_1`, `_2`, `_3` hinzu (z.B. `OPENAI_API_KEY_1`, `OPENAI_API_KEY_2`). Funktioniert mit OpenAI, Anthropic und Gemini.
</Callout>
<Callout type="info">
In Docker verwenden Sie `OLLAMA_URL=http://host.docker.internal:11434` für Ollama auf dem Host-System.
</Callout>
### Azure OpenAI
| Variable | Beschreibung |
|----------|-------------|
| `AZURE_OPENAI_API_KEY` | Azure OpenAI API-Schlüssel |
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI Endpoint-URL |
| `AZURE_OPENAI_API_VERSION` | API-Version (z.B. `2024-02-15-preview`) |
### vLLM (Selbst-gehostet)
| Variable | Beschreibung |
|----------|-------------|
| `VLLM_BASE_URL` | vLLM-Server-URL (z.B. `http://localhost:8000/v1`) |
| `VLLM_API_KEY` | Optionaler Bearer-Token für vLLM |
## OAuth-Anbieter
| Variable | Beschreibung |
|----------|-------------|
| `GOOGLE_CLIENT_ID` | Google OAuth Client-ID |
| `GOOGLE_CLIENT_SECRET` | Google OAuth Client-Secret |
| `GITHUB_CLIENT_ID` | GitHub OAuth Client-ID |
| `GITHUB_CLIENT_SECRET` | GitHub OAuth Client-Secret |
## Optional
| Variable | Beschreibung |
|----------|-------------|
| `API_ENCRYPTION_KEY` | Verschlüsselt gespeicherte API-Schlüssel (32 Hex-Zeichen): `openssl rand -hex 32` |
| `COPILOT_API_KEY` | API-Schlüssel für Copilot-Funktionen |
| `ADMIN_API_KEY` | Admin-API-Schlüssel für GitOps-Operationen |
| `RESEND_API_KEY` | E-Mail-Dienst für Benachrichtigungen |
| `ALLOWED_LOGIN_DOMAINS` | Registrierungen auf Domains beschränken (durch Kommas getrennt) |
| `ALLOWED_LOGIN_EMAILS` | Registrierungen auf bestimmte E-Mails beschränken (durch Kommas getrennt) |
| `DISABLE_REGISTRATION` | Auf `true` setzen, um neue Benutzerregistrierungen zu deaktivieren |
## Beispiel .env
```bash
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...
```
Siehe `apps/sim/.env.example` für alle Optionen.

View File

@@ -0,0 +1,50 @@
---
title: Self-Hosting
description: Stellen Sie Sim Studio auf Ihrer eigenen Infrastruktur bereit
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Callout } from 'fumadocs-ui/components/callout'
Stellen Sie Sim Studio auf Ihrer eigenen Infrastruktur mit Docker oder Kubernetes bereit.
## Anforderungen
| Ressource | Minimum | Empfohlen |
|----------|---------|-------------|
| CPU | 2 Kerne | 4+ Kerne |
| RAM | 12 GB | 16+ GB |
| Speicher | 20 GB SSD | 50+ GB SSD |
| Docker | 20.10+ | Neueste Version |
## Schnellstart
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Öffnen Sie [http://localhost:3000](http://localhost:3000)
## Bereitstellungsoptionen
<Cards>
<Card title="Docker" href="/self-hosting/docker">
Bereitstellung mit Docker Compose auf jedem Server
</Card>
<Card title="Kubernetes" href="/self-hosting/kubernetes">
Bereitstellung mit Helm auf Kubernetes-Clustern
</Card>
<Card title="Cloud-Plattformen" href="/self-hosting/platforms">
Anleitungen für Railway, DigitalOcean, AWS, Azure, GCP
</Card>
</Cards>
## Architektur
| Komponente | Port | Beschreibung |
|-----------|------|-------------|
| simstudio | 3000 | Hauptanwendung |
| realtime | 3002 | WebSocket-Server |
| db | 5432 | PostgreSQL mit pgvector |
| migrations | - | Datenbank-Migrationen (werden einmal ausgeführt) |

View File

@@ -0,0 +1,133 @@
---
title: Kubernetes
description: Sim Studio mit Helm bereitstellen
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Voraussetzungen
- Kubernetes 1.19+
- Helm 3.0+
- PV-Provisioner-Unterstützung
## Installation
```bash
# Clone repo
git clone https://github.com/simstudioai/sim.git && cd sim
# Generate secrets
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
# Install
helm install sim ./helm/sim \
--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" \
--namespace simstudio --create-namespace
```
## Cloud-spezifische Werte
<Tabs items={['AWS EKS', 'Azure AKS', 'GCP GKE']}>
<Tab value="AWS EKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="Azure AKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-azure.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="GCP GKE">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-gcp.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
</Tabs>
## Schlüsselkonfiguration
```yaml
# Custom values.yaml
app:
replicaCount: 2
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
OPENAI_API_KEY: "sk-..."
postgresql:
persistence:
size: 50Gi
ingress:
enabled: true
className: nginx
tls:
enabled: true
app:
host: sim.yourdomain.com
```
Siehe `helm/sim/values.yaml` für alle Optionen.
## Externe Datenbank
```yaml
postgresql:
enabled: false
externalDatabase:
enabled: true
host: "your-db-host"
port: 5432
username: "postgres"
password: "your-password"
database: "simstudio"
sslMode: "require"
```
## Befehle
```bash
# Port forward for local access
kubectl port-forward deployment/sim-sim-app 3000:3000 -n simstudio
# View logs
kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
# Upgrade
helm upgrade sim ./helm/sim --namespace simstudio
# Uninstall
helm uninstall sim --namespace simstudio
```

View File

@@ -0,0 +1,124 @@
---
title: Cloud-Plattformen
description: Sim Studio auf Cloud-Plattformen bereitstellen
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Railway
Bereitstellung mit einem Klick und automatischer PostgreSQL-Bereitstellung.
[
![Auf Railway bereitstellen](https://railway.app/button.svg)
](https://railway.com/new/template/sim-studio)
Nach der Bereitstellung fügen Sie Umgebungsvariablen im Railway-Dashboard hinzu:
- `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET` (automatisch generiert)
- `OPENAI_API_KEY` oder andere KI-Anbieter-Schlüssel
- Benutzerdefinierte Domain in Einstellungen → Netzwerk
## VPS-Bereitstellung
Für DigitalOcean, AWS EC2, Azure VMs oder jeden Linux-Server:
<Tabs items={['DigitalOcean', 'AWS EC2', 'Azure VM']}>
<Tab value="DigitalOcean">
**Empfohlen:** 16 GB RAM Droplet, Ubuntu 24.04
```bash
# Create Droplet via console, then SSH in
ssh root@your-droplet-ip
```
</Tab>
<Tab value="AWS EC2">
**Empfohlen:** t3.xlarge (16 GB RAM), Ubuntu 24.04
```bash
ssh -i your-key.pem ubuntu@your-ec2-ip
```
</Tab>
<Tab value="Azure VM">
**Empfohlen:** Standard_D4s_v3 (16 GB RAM), Ubuntu 24.04
```bash
ssh azureuser@your-vm-ip
```
</Tab>
</Tabs>
### Docker installieren
```bash
# Install Docker (official method)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# Logout and reconnect, then verify
docker --version
```
### Sim Studio bereitstellen
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
# Create .env with secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
# Start
docker compose -f docker-compose.prod.yml up -d
```
### SSL mit Caddy
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Configure (replace domain)
echo 'sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}' | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
```
Richten Sie den DNS A-Eintrag Ihrer Domain auf die IP-Adresse Ihres Servers.
## Kubernetes (EKS, AKS, GKE)
Siehe den [Kubernetes-Leitfaden](/self-hosting/kubernetes) für Helm-Deployment auf verwaltetem Kubernetes.
## Verwaltete Datenbank (Optional)
Für den Produktivbetrieb sollten Sie einen verwalteten PostgreSQL-Dienst verwenden:
- **AWS RDS** / **Azure Database** / **Cloud SQL** - Aktivieren Sie die pgvector-Erweiterung
- **Supabase** / **Neon** - pgvector enthalten
Setzen Sie `DATABASE_URL` in Ihrer Umgebung:
```bash
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
```

View File

@@ -0,0 +1,113 @@
---
title: Fehlerbehebung
description: Häufige Probleme und Lösungen
---
## Datenbankverbindung fehlgeschlagen
```bash
# Check database is running
docker compose ps db
# Test connection
docker compose exec db psql -U postgres -c "SELECT 1"
```
Überprüfen Sie das `DATABASE_URL` Format: `postgresql://user:pass@host:5432/database`
## Ollama-Modelle werden nicht angezeigt
In Docker ist `localhost` = der Container, nicht Ihr Host-Rechner.
```bash
# For host-machine Ollama, use:
OLLAMA_URL=http://host.docker.internal:11434 # macOS/Windows
OLLAMA_URL=http://192.168.1.x:11434 # Linux (use actual IP)
```
## WebSocket/Echtzeit funktioniert nicht
1. Prüfen Sie, ob `NEXT_PUBLIC_SOCKET_URL` mit Ihrer Domain übereinstimmt
2. Überprüfen Sie, ob der Echtzeit-Dienst läuft: `docker compose ps realtime`
3. Stellen Sie sicher, dass der Reverse-Proxy WebSocket-Upgrades weiterleitet (siehe [Docker-Anleitung](/self-hosting/docker))
## 502 Bad Gateway
```bash
# Check app is running
docker compose ps simstudio
docker compose logs simstudio
# Common causes: out of memory, database not ready
```
## Migrationsfehler
```bash
# View migration logs
docker compose logs migrations
# Run manually
docker compose exec simstudio bun run db:migrate
```
## pgvector nicht gefunden
Verwenden Sie das richtige PostgreSQL-Image:
```yaml
image: pgvector/pgvector:pg17 # NOT postgres:17
```
## Zertifikatsfehler (CERT_HAS_EXPIRED)
Wenn Sie SSL-Zertifikatsfehler beim Aufrufen externer APIs sehen:
```bash
# Update CA certificates in container
docker compose exec simstudio apt-get update && apt-get install -y ca-certificates
# Or set in environment (not recommended for production)
NODE_TLS_REJECT_UNAUTHORIZED=0
```
## Leere Seite nach dem Login
1. Überprüfen Sie die Browser-Konsole auf Fehler
2. Stellen Sie sicher, dass `NEXT_PUBLIC_APP_URL` mit Ihrer tatsächlichen Domain übereinstimmt
3. Löschen Sie Browser-Cookies und lokalen Speicher
4. Prüfen Sie, ob alle Dienste laufen: `docker compose ps`
## Windows-spezifische Probleme
**Turbopack-Fehler unter Windows:**
```bash
# Use WSL2 for better compatibility
wsl --install
# Or disable Turbopack in package.json
# Change "next dev --turbopack" to "next dev"
```
**Zeilenende-Probleme:**
```bash
# Configure git to use LF
git config --global core.autocrlf input
```
## Logs anzeigen
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f simstudio
```
## Hilfe erhalten
- [GitHub Issues](https://github.com/simstudioai/sim/issues)
- [Discord](https://discord.gg/Hr4UWYEcTT)

View File

@@ -0,0 +1,155 @@
---
title: Docker
description: Despliega Sim Studio con Docker Compose
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Inicio rápido
```bash
# Clone and start
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Abre [http://localhost:3000](http://localhost:3000)
## Configuración de producción
### 1. Configurar entorno
```bash
# Generate secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
```
### 2. Iniciar servicios
```bash
docker compose -f docker-compose.prod.yml up -d
```
### 3. Configurar SSL
<Tabs items={['Caddy (Recomendado)', 'Nginx + Certbot']}>
<Tab value="Caddy (Recomendado)">
Caddy gestiona automáticamente los certificados SSL.
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
```
Crea `/etc/caddy/Caddyfile`:
```
sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}
```
```bash
sudo systemctl restart caddy
```
</Tab>
<Tab value="Nginx + Certbot">
```bash
# Install
sudo apt install nginx certbot python3-certbot-nginx -y
# Create /etc/nginx/sites-available/sim
server {
listen 80;
server_name sim.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# Enable and get certificate
sudo ln -s /etc/nginx/sites-available/sim /etc/nginx/sites-enabled/
sudo certbot --nginx -d sim.yourdomain.com
```
</Tab>
</Tabs>
## Ollama
```bash
# With GPU
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
# CPU only
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
```
Descarga modelos adicionales:
```bash
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
```
### Ollama externo
Si Ollama se ejecuta en tu máquina host (no en Docker):
```bash
# macOS/Windows
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux - use your host IP
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
```
<Callout type="warning">
Dentro de Docker, `localhost` se refiere al contenedor, no a tu host. Usa `host.docker.internal` o la IP de tu host.
</Callout>
## Comandos
```bash
# View logs
docker compose -f docker-compose.prod.yml logs -f simstudio
# Stop
docker compose -f docker-compose.prod.yml down
# Update
docker compose -f docker-compose.prod.yml pull && docker compose -f docker-compose.prod.yml up -d
# Backup database
docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql
```

View File

@@ -0,0 +1,87 @@
---
title: Variables de entorno
description: Referencia de configuración para Sim Studio
---
import { Callout } from 'fumadocs-ui/components/callout'
## Requeridas
| Variable | Descripción |
|----------|-------------|
| `DATABASE_URL` | Cadena de conexión PostgreSQL |
| `BETTER_AUTH_SECRET` | Secreto de autenticación (32 caracteres hex): `openssl rand -hex 32` |
| `BETTER_AUTH_URL` | URL de tu aplicación |
| `ENCRYPTION_KEY` | Clave de cifrado (32 caracteres hex): `openssl rand -hex 32` |
| `INTERNAL_API_SECRET` | Secreto de API interna (32 caracteres hex): `openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | URL pública de la aplicación |
| `NEXT_PUBLIC_SOCKET_URL` | URL de WebSocket (predeterminado: `http://localhost:3002`) |
## Proveedores de IA
| Variable | Proveedor |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY_1` | Anthropic Claude |
| `GEMINI_API_KEY_1` | Google Gemini |
| `MISTRAL_API_KEY` | Mistral |
| `OLLAMA_URL` | Ollama (predeterminado: `http://localhost:11434`) |
<Callout type="info">
Para balanceo de carga, añade múltiples claves con sufijos `_1`, `_2`, `_3` (p. ej., `OPENAI_API_KEY_1`, `OPENAI_API_KEY_2`). Funciona con OpenAI, Anthropic y Gemini.
</Callout>
<Callout type="info">
En Docker, usa `OLLAMA_URL=http://host.docker.internal:11434` para Ollama en la máquina host.
</Callout>
### Azure OpenAI
| Variable | Descripción |
|----------|-------------|
| `AZURE_OPENAI_API_KEY` | Clave de API de Azure OpenAI |
| `AZURE_OPENAI_ENDPOINT` | URL del endpoint de Azure OpenAI |
| `AZURE_OPENAI_API_VERSION` | Versión de API (p. ej., `2024-02-15-preview`) |
### vLLM (autoalojado)
| Variable | Descripción |
|----------|-------------|
| `VLLM_BASE_URL` | URL del servidor vLLM (p. ej., `http://localhost:8000/v1`) |
| `VLLM_API_KEY` | Token bearer opcional para vLLM |
## Proveedores OAuth
| Variable | Descripción |
|----------|-------------|
| `GOOGLE_CLIENT_ID` | ID de cliente OAuth de Google |
| `GOOGLE_CLIENT_SECRET` | Secreto de cliente OAuth de Google |
| `GITHUB_CLIENT_ID` | ID de cliente OAuth de GitHub |
| `GITHUB_CLIENT_SECRET` | Secreto de cliente OAuth de GitHub |
## Opcional
| Variable | Descripción |
|----------|-------------|
| `API_ENCRYPTION_KEY` | Encripta las claves API almacenadas (32 caracteres hexadecimales): `openssl rand -hex 32` |
| `COPILOT_API_KEY` | Clave API para funciones de copilot |
| `ADMIN_API_KEY` | Clave API de administrador para operaciones GitOps |
| `RESEND_API_KEY` | Servicio de correo electrónico para notificaciones |
| `ALLOWED_LOGIN_DOMAINS` | Restringir registros a dominios (separados por comas) |
| `ALLOWED_LOGIN_EMAILS` | Restringir registros a correos electrónicos específicos (separados por comas) |
| `DISABLE_REGISTRATION` | Establecer como `true` para deshabilitar nuevos registros de usuarios |
## Ejemplo de archivo .env
```bash
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...
```
Consulta `apps/sim/.env.example` para todas las opciones.

View File

@@ -0,0 +1,50 @@
---
title: Autoalojamiento
description: Despliega Sim Studio en tu propia infraestructura
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Callout } from 'fumadocs-ui/components/callout'
Despliega Sim Studio en tu propia infraestructura con Docker o Kubernetes.
## Requisitos
| Recurso | Mínimo | Recomendado |
|----------|---------|-------------|
| CPU | 2 núcleos | 4+ núcleos |
| RAM | 12 GB | 16+ GB |
| Almacenamiento | 20 GB SSD | 50+ GB SSD |
| Docker | 20.10+ | Última versión |
## Inicio rápido
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Abre [http://localhost:3000](http://localhost:3000)
## Opciones de despliegue
<Cards>
<Card title="Docker" href="/self-hosting/docker">
Despliega con Docker Compose en cualquier servidor
</Card>
<Card title="Kubernetes" href="/self-hosting/kubernetes">
Despliega con Helm en clústeres de Kubernetes
</Card>
<Card title="Plataformas en la nube" href="/self-hosting/platforms">
Guías para Railway, DigitalOcean, AWS, Azure, GCP
</Card>
</Cards>
## Arquitectura
| Componente | Puerto | Descripción |
|-----------|------|-------------|
| simstudio | 3000 | Aplicación principal |
| realtime | 3002 | Servidor WebSocket |
| db | 5432 | PostgreSQL con pgvector |
| migrations | - | Migraciones de base de datos (se ejecuta una vez) |

View File

@@ -0,0 +1,133 @@
---
title: Kubernetes
description: Desplegar Sim Studio con Helm
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Requisitos previos
- Kubernetes 1.19+
- Helm 3.0+
- Soporte de aprovisionador PV
## Instalación
```bash
# Clone repo
git clone https://github.com/simstudioai/sim.git && cd sim
# Generate secrets
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
# Install
helm install sim ./helm/sim \
--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" \
--namespace simstudio --create-namespace
```
## Valores específicos para la nube
<Tabs items={['AWS EKS', 'Azure AKS', 'GCP GKE']}>
<Tab value="AWS EKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="Azure AKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-azure.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="GCP GKE">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-gcp.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
</Tabs>
## Configuración clave
```yaml
# Custom values.yaml
app:
replicaCount: 2
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
OPENAI_API_KEY: "sk-..."
postgresql:
persistence:
size: 50Gi
ingress:
enabled: true
className: nginx
tls:
enabled: true
app:
host: sim.yourdomain.com
```
Consulta `helm/sim/values.yaml` para todas las opciones.
## Base de datos externa
```yaml
postgresql:
enabled: false
externalDatabase:
enabled: true
host: "your-db-host"
port: 5432
username: "postgres"
password: "your-password"
database: "simstudio"
sslMode: "require"
```
## Comandos
```bash
# Port forward for local access
kubectl port-forward deployment/sim-sim-app 3000:3000 -n simstudio
# View logs
kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
# Upgrade
helm upgrade sim ./helm/sim --namespace simstudio
# Uninstall
helm uninstall sim --namespace simstudio
```

View File

@@ -0,0 +1,124 @@
---
title: Plataformas en la nube
description: Despliega Sim Studio en plataformas en la nube
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Railway
Despliegue con un solo clic con aprovisionamiento automático de PostgreSQL.
[
![Desplegar en Railway](https://railway.app/button.svg)
](https://railway.com/new/template/sim-studio)
Después del despliegue, añade variables de entorno en el panel de Railway:
- `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET` (generadas automáticamente)
- `OPENAI_API_KEY` u otras claves de proveedores de IA
- Dominio personalizado en Configuración → Redes
## Despliegue en VPS
Para DigitalOcean, AWS EC2, Azure VMs o cualquier servidor Linux:
<Tabs items={['DigitalOcean', 'AWS EC2', 'Azure VM']}>
<Tab value="DigitalOcean">
**Recomendado:** Droplet de 16 GB RAM, Ubuntu 24.04
```bash
# Create Droplet via console, then SSH in
ssh root@your-droplet-ip
```
</Tab>
<Tab value="AWS EC2">
**Recomendado:** t3.xlarge (16 GB RAM), Ubuntu 24.04
```bash
ssh -i your-key.pem ubuntu@your-ec2-ip
```
</Tab>
<Tab value="Azure VM">
**Recomendado:** Standard_D4s_v3 (16 GB RAM), Ubuntu 24.04
```bash
ssh azureuser@your-vm-ip
```
</Tab>
</Tabs>
### Instalar Docker
```bash
# Install Docker (official method)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# Logout and reconnect, then verify
docker --version
```
### Desplegar Sim Studio
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
# Create .env with secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
# Start
docker compose -f docker-compose.prod.yml up -d
```
### SSL con Caddy
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Configure (replace domain)
echo 'sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}' | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
```
Apunta el registro DNS A de tu dominio a la IP de tu servidor.
## Kubernetes (EKS, AKS, GKE)
Consulta la [guía de Kubernetes](/self-hosting/kubernetes) para la implementación con Helm en Kubernetes gestionado.
## Base de datos gestionada (Opcional)
Para producción, utiliza un servicio de PostgreSQL gestionado:
- **AWS RDS** / **Azure Database** / **Cloud SQL** - Habilita la extensión pgvector
- **Supabase** / **Neon** - pgvector incluido
Establece `DATABASE_URL` en tu entorno:
```bash
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
```

View File

@@ -0,0 +1,113 @@
---
title: Solución de problemas
description: Problemas comunes y soluciones
---
## Falló la conexión a la base de datos
```bash
# Check database is running
docker compose ps db
# Test connection
docker compose exec db psql -U postgres -c "SELECT 1"
```
Verifica el formato de `DATABASE_URL`: `postgresql://user:pass@host:5432/database`
## Los modelos de Ollama no se muestran
Dentro de Docker, `localhost` = el contenedor, no tu máquina host.
```bash
# For host-machine Ollama, use:
OLLAMA_URL=http://host.docker.internal:11434 # macOS/Windows
OLLAMA_URL=http://192.168.1.x:11434 # Linux (use actual IP)
```
## WebSocket/Tiempo real no funciona
1. Comprueba que `NEXT_PUBLIC_SOCKET_URL` coincida con tu dominio
2. Verifica que el servicio en tiempo real esté funcionando: `docker compose ps realtime`
3. Asegúrate de que el proxy inverso pase las actualizaciones de WebSocket (consulta la [guía de Docker](/self-hosting/docker))
## Error 502 Bad Gateway
```bash
# Check app is running
docker compose ps simstudio
docker compose logs simstudio
# Common causes: out of memory, database not ready
```
## Errores de migración
```bash
# View migration logs
docker compose logs migrations
# Run manually
docker compose exec simstudio bun run db:migrate
```
## pgvector no encontrado
Usa la imagen correcta de PostgreSQL:
```yaml
image: pgvector/pgvector:pg17 # NOT postgres:17
```
## Errores de certificado (CERT_HAS_EXPIRED)
Si ves errores de certificado SSL al llamar a APIs externas:
```bash
# Update CA certificates in container
docker compose exec simstudio apt-get update && apt-get install -y ca-certificates
# Or set in environment (not recommended for production)
NODE_TLS_REJECT_UNAUTHORIZED=0
```
## Página en blanco después del inicio de sesión
1. Revisa la consola del navegador para ver errores
2. Verifica que `NEXT_PUBLIC_APP_URL` coincida con tu dominio actual
3. Borra las cookies del navegador y el almacenamiento local
4. Comprueba que todos los servicios estén funcionando: `docker compose ps`
## Problemas específicos de Windows
**Errores de Turbopack en Windows:**
```bash
# Use WSL2 for better compatibility
wsl --install
# Or disable Turbopack in package.json
# Change "next dev --turbopack" to "next dev"
```
**Problemas de fin de línea:**
```bash
# Configure git to use LF
git config --global core.autocrlf input
```
## Ver registros
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f simstudio
```
## Obtener ayuda
- [GitHub Issues](https://github.com/simstudioai/sim/issues)
- [Discord](https://discord.gg/Hr4UWYEcTT)

View File

@@ -0,0 +1,155 @@
---
title: Docker
description: Déployer Sim Studio avec Docker Compose
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Démarrage rapide
```bash
# Clone and start
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Ouvrez [http://localhost:3000](http://localhost:3000)
## Configuration de production
### 1. Configurer l'environnement
```bash
# Generate secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
```
### 2. Démarrer les services
```bash
docker compose -f docker-compose.prod.yml up -d
```
### 3. Configurer SSL
<Tabs items={['Caddy (Recommandé)', 'Nginx + Certbot']}>
<Tab value="Caddy (Recommandé)">
Caddy gère automatiquement les certificats SSL.
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
```
Créez `/etc/caddy/Caddyfile` :
```
sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}
```
```bash
sudo systemctl restart caddy
```
</Tab>
<Tab value="Nginx + Certbot">
```bash
# Install
sudo apt install nginx certbot python3-certbot-nginx -y
# Create /etc/nginx/sites-available/sim
server {
listen 80;
server_name sim.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# Enable and get certificate
sudo ln -s /etc/nginx/sites-available/sim /etc/nginx/sites-enabled/
sudo certbot --nginx -d sim.yourdomain.com
```
</Tab>
</Tabs>
## Ollama
```bash
# With GPU
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
# CPU only
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
```
Télécharger des modèles supplémentaires :
```bash
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
```
### Ollama externe
Si Ollama s'exécute sur votre machine hôte (pas dans Docker) :
```bash
# macOS/Windows
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux - use your host IP
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
```
<Callout type="warning">
À l'intérieur de Docker, `localhost` fait référence au conteneur, pas à votre hôte. Utilisez `host.docker.internal` ou l'IP de votre hôte.
</Callout>
## Commandes
```bash
# View logs
docker compose -f docker-compose.prod.yml logs -f simstudio
# Stop
docker compose -f docker-compose.prod.yml down
# Update
docker compose -f docker-compose.prod.yml pull && docker compose -f docker-compose.prod.yml up -d
# Backup database
docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql
```

View File

@@ -0,0 +1,87 @@
---
title: Variables d'environnement
description: Référence de configuration pour Sim Studio
---
import { Callout } from 'fumadocs-ui/components/callout'
## Obligatoires
| Variable | Description |
|----------|-------------|
| `DATABASE_URL` | Chaîne de connexion PostgreSQL |
| `BETTER_AUTH_SECRET` | Secret d'authentification (32 caractères hexadécimaux) : `openssl rand -hex 32` |
| `BETTER_AUTH_URL` | URL de votre application |
| `ENCRYPTION_KEY` | Clé de chiffrement (32 caractères hexadécimaux) : `openssl rand -hex 32` |
| `INTERNAL_API_SECRET` | Secret API interne (32 caractères hexadécimaux) : `openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | URL publique de l'application |
| `NEXT_PUBLIC_SOCKET_URL` | URL WebSocket (par défaut : `http://localhost:3002`) |
## Fournisseurs d'IA
| Variable | Fournisseur |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY_1` | Anthropic Claude |
| `GEMINI_API_KEY_1` | Google Gemini |
| `MISTRAL_API_KEY` | Mistral |
| `OLLAMA_URL` | Ollama (par défaut : `http://localhost:11434`) |
<Callout type="info">
Pour l'équilibrage de charge, ajoutez plusieurs clés avec les suffixes `_1`, `_2`, `_3` (par exemple, `OPENAI_API_KEY_1`, `OPENAI_API_KEY_2`). Fonctionne avec OpenAI, Anthropic et Gemini.
</Callout>
<Callout type="info">
Dans Docker, utilisez `OLLAMA_URL=http://host.docker.internal:11434` pour Ollama sur la machine hôte.
</Callout>
### Azure OpenAI
| Variable | Description |
|----------|-------------|
| `AZURE_OPENAI_API_KEY` | Clé API Azure OpenAI |
| `AZURE_OPENAI_ENDPOINT` | URL du point de terminaison Azure OpenAI |
| `AZURE_OPENAI_API_VERSION` | Version de l'API (par exemple, `2024-02-15-preview`) |
### vLLM (auto-hébergé)
| Variable | Description |
|----------|-------------|
| `VLLM_BASE_URL` | URL du serveur vLLM (par exemple, `http://localhost:8000/v1`) |
| `VLLM_API_KEY` | Jeton bearer optionnel pour vLLM |
## Fournisseurs OAuth
| Variable | Description |
|----------|-------------|
| `GOOGLE_CLIENT_ID` | ID client OAuth Google |
| `GOOGLE_CLIENT_SECRET` | Secret client OAuth Google |
| `GITHUB_CLIENT_ID` | ID client OAuth GitHub |
| `GITHUB_CLIENT_SECRET` | Secret client OAuth GitHub |
## Optionnel
| Variable | Description |
|----------|-------------|
| `API_ENCRYPTION_KEY` | Chiffre les clés API stockées (32 caractères hexadécimaux) : `openssl rand -hex 32` |
| `COPILOT_API_KEY` | Clé API pour les fonctionnalités copilot |
| `ADMIN_API_KEY` | Clé API administrateur pour les opérations GitOps |
| `RESEND_API_KEY` | Service de messagerie pour les notifications |
| `ALLOWED_LOGIN_DOMAINS` | Restreindre les inscriptions à des domaines (séparés par des virgules) |
| `ALLOWED_LOGIN_EMAILS` | Restreindre les inscriptions à des emails spécifiques (séparés par des virgules) |
| `DISABLE_REGISTRATION` | Définir à `true` pour désactiver les inscriptions de nouveaux utilisateurs |
## Exemple de fichier .env
```bash
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...
```
Voir `apps/sim/.env.example` pour toutes les options.

View File

@@ -0,0 +1,50 @@
---
title: Auto-hébergement
description: Déployez Sim Studio sur votre propre infrastructure
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Callout } from 'fumadocs-ui/components/callout'
Déployez Sim Studio sur votre propre infrastructure avec Docker ou Kubernetes.
## Prérequis
| Ressource | Minimum | Recommandé |
|----------|---------|-------------|
| CPU | 2 cœurs | 4+ cœurs |
| RAM | 12 Go | 16+ Go |
| Stockage | 20 Go SSD | 50+ Go SSD |
| Docker | 20.10+ | Dernière version |
## Démarrage rapide
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
Ouvrez [http://localhost:3000](http://localhost:3000)
## Options de déploiement
<Cards>
<Card title="Docker" href="/self-hosting/docker">
Déployez avec Docker Compose sur n'importe quel serveur
</Card>
<Card title="Kubernetes" href="/self-hosting/kubernetes">
Déployez avec Helm sur des clusters Kubernetes
</Card>
<Card title="Plateformes cloud" href="/self-hosting/platforms">
Guides pour Railway, DigitalOcean, AWS, Azure, GCP
</Card>
</Cards>
## Architecture
| Composant | Port | Description |
|-----------|------|-------------|
| simstudio | 3000 | Application principale |
| realtime | 3002 | Serveur WebSocket |
| db | 5432 | PostgreSQL avec pgvector |
| migrations | - | Migrations de base de données (exécutées une seule fois) |

View File

@@ -0,0 +1,133 @@
---
title: Kubernetes
description: Déployer Sim Studio avec Helm
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Prérequis
- Kubernetes 1.19+
- Helm 3.0+
- Support du provisionneur PV
## Installation
```bash
# Clone repo
git clone https://github.com/simstudioai/sim.git && cd sim
# Generate secrets
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
# Install
helm install sim ./helm/sim \
--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" \
--namespace simstudio --create-namespace
```
## Valeurs spécifiques au cloud
<Tabs items={['AWS EKS', 'Azure AKS', 'GCP GKE']}>
<Tab value="AWS EKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="Azure AKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-azure.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="GCP GKE">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-gcp.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
</Tabs>
## Configuration clé
```yaml
# Custom values.yaml
app:
replicaCount: 2
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
OPENAI_API_KEY: "sk-..."
postgresql:
persistence:
size: 50Gi
ingress:
enabled: true
className: nginx
tls:
enabled: true
app:
host: sim.yourdomain.com
```
Voir `helm/sim/values.yaml` pour toutes les options.
## Base de données externe
```yaml
postgresql:
enabled: false
externalDatabase:
enabled: true
host: "your-db-host"
port: 5432
username: "postgres"
password: "your-password"
database: "simstudio"
sslMode: "require"
```
## Commandes
```bash
# Port forward for local access
kubectl port-forward deployment/sim-sim-app 3000:3000 -n simstudio
# View logs
kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
# Upgrade
helm upgrade sim ./helm/sim --namespace simstudio
# Uninstall
helm uninstall sim --namespace simstudio
```

View File

@@ -0,0 +1,124 @@
---
title: Plateformes cloud
description: Déployer Sim Studio sur des plateformes cloud
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Railway
Déploiement en un clic avec provisionnement automatique de PostgreSQL.
[
![Déployer sur Railway](https://railway.app/button.svg)
](https://railway.com/new/template/sim-studio)
Après le déploiement, ajoutez des variables d'environnement dans le tableau de bord Railway :
- `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET` (générées automatiquement)
- `OPENAI_API_KEY` ou d'autres clés de fournisseur d'IA
- Domaine personnalisé dans Paramètres → Réseau
## Déploiement VPS
Pour DigitalOcean, AWS EC2, Azure VMs, ou tout serveur Linux :
<Tabs items={['DigitalOcean', 'AWS EC2', 'Azure VM']}>
<Tab value="DigitalOcean">
**Recommandé :** Droplet de 16 Go de RAM, Ubuntu 24.04
```bash
# Create Droplet via console, then SSH in
ssh root@your-droplet-ip
```
</Tab>
<Tab value="AWS EC2">
**Recommandé :** t3.xlarge (16 Go de RAM), Ubuntu 24.04
```bash
ssh -i your-key.pem ubuntu@your-ec2-ip
```
</Tab>
<Tab value="Azure VM">
**Recommandé :** Standard_D4s_v3 (16 Go de RAM), Ubuntu 24.04
```bash
ssh azureuser@your-vm-ip
```
</Tab>
</Tabs>
### Installer Docker
```bash
# Install Docker (official method)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# Logout and reconnect, then verify
docker --version
```
### Déployer Sim Studio
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
# Create .env with secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
# Start
docker compose -f docker-compose.prod.yml up -d
```
### SSL avec Caddy
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Configure (replace domain)
echo 'sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}' | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
```
Pointez l'enregistrement DNS A de votre domaine vers l'IP de votre serveur.
## Kubernetes (EKS, AKS, GKE)
Consultez le [guide Kubernetes](/self-hosting/kubernetes) pour le déploiement Helm sur Kubernetes géré.
## Base de données gérée (optionnel)
Pour la production, utilisez un service PostgreSQL géré :
- **AWS RDS** / **Azure Database** / **Cloud SQL** - Activez l'extension pgvector
- **Supabase** / **Neon** - pgvector inclus
Définissez `DATABASE_URL` dans votre environnement :
```bash
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
```

View File

@@ -0,0 +1,113 @@
---
title: Dépannage
description: Problèmes courants et solutions
---
## Échec de connexion à la base de données
```bash
# Check database is running
docker compose ps db
# Test connection
docker compose exec db psql -U postgres -c "SELECT 1"
```
Vérifiez le format de `DATABASE_URL` : `postgresql://user:pass@host:5432/database`
## Les modèles Ollama ne s'affichent pas
Dans Docker, `localhost` = le conteneur, pas votre machine hôte.
```bash
# For host-machine Ollama, use:
OLLAMA_URL=http://host.docker.internal:11434 # macOS/Windows
OLLAMA_URL=http://192.168.1.x:11434 # Linux (use actual IP)
```
## WebSocket/Temps réel ne fonctionne pas
1. Vérifiez que `NEXT_PUBLIC_SOCKET_URL` correspond à votre domaine
2. Vérifiez que le service temps réel est en cours d'exécution : `docker compose ps realtime`
3. Assurez-vous que le proxy inverse transmet les mises à niveau WebSocket (voir [Guide Docker](/self-hosting/docker))
## Erreur 502 Bad Gateway
```bash
# Check app is running
docker compose ps simstudio
docker compose logs simstudio
# Common causes: out of memory, database not ready
```
## Erreurs de migration
```bash
# View migration logs
docker compose logs migrations
# Run manually
docker compose exec simstudio bun run db:migrate
```
## pgvector introuvable
Utilisez l'image PostgreSQL correcte :
```yaml
image: pgvector/pgvector:pg17 # NOT postgres:17
```
## Erreurs de certificat (CERT_HAS_EXPIRED)
Si vous voyez des erreurs de certificat SSL lors de l'appel d'API externes :
```bash
# Update CA certificates in container
docker compose exec simstudio apt-get update && apt-get install -y ca-certificates
# Or set in environment (not recommended for production)
NODE_TLS_REJECT_UNAUTHORIZED=0
```
## Page blanche après connexion
1. Vérifiez la console du navigateur pour les erreurs
2. Vérifiez que `NEXT_PUBLIC_APP_URL` correspond à votre domaine réel
3. Effacez les cookies et le stockage local du navigateur
4. Vérifiez que tous les services sont en cours d'exécution : `docker compose ps`
## Problèmes spécifiques à Windows
**Erreurs Turbopack sur Windows :**
```bash
# Use WSL2 for better compatibility
wsl --install
# Or disable Turbopack in package.json
# Change "next dev --turbopack" to "next dev"
```
**Problèmes de fin de ligne :**
```bash
# Configure git to use LF
git config --global core.autocrlf input
```
## Consulter les journaux
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f simstudio
```
## Obtenir de l'aide
- [Problèmes GitHub](https://github.com/simstudioai/sim/issues)
- [Discord](https://discord.gg/Hr4UWYEcTT)

View File

@@ -0,0 +1,155 @@
---
title: Docker
description: Docker Composeを使用してSim Studioをデプロイする
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## クイックスタート
```bash
# Clone and start
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
[http://localhost:3000](http://localhost:3000)を開く
## 本番環境のセットアップ
### 1. 環境の設定
```bash
# Generate secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
```
### 2. サービスの起動
```bash
docker compose -f docker-compose.prod.yml up -d
```
### 3. SSLの設定
<Tabs items={['Caddy (推奨)', 'Nginx + Certbot']}>
<Tab value="Caddy (推奨)">
Caddyは自動的にSSL証明書を処理します。
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
```
`/etc/caddy/Caddyfile`を作成します:
```
sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}
```
```bash
sudo systemctl restart caddy
```
</Tab>
<Tab value="Nginx + Certbot">
```bash
# Install
sudo apt install nginx certbot python3-certbot-nginx -y
# Create /etc/nginx/sites-available/sim
server {
listen 80;
server_name sim.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# Enable and get certificate
sudo ln -s /etc/nginx/sites-available/sim /etc/nginx/sites-enabled/
sudo certbot --nginx -d sim.yourdomain.com
```
</Tab>
</Tabs>
## Ollama
```bash
# With GPU
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
# CPU only
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
```
追加モデルを取得:
```bash
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
```
### 外部Ollama
Ollamaがホストマシン上で実行されている場合Dockerではない
```bash
# macOS/Windows
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux - use your host IP
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
```
<Callout type="warning">
Docker内では、`localhost`はホストではなくコンテナを指します。`host.docker.internal`またはホストのIPを使用してください。
</Callout>
## コマンド
```bash
# View logs
docker compose -f docker-compose.prod.yml logs -f simstudio
# Stop
docker compose -f docker-compose.prod.yml down
# Update
docker compose -f docker-compose.prod.yml pull && docker compose -f docker-compose.prod.yml up -d
# Backup database
docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql
```

View File

@@ -0,0 +1,87 @@
---
title: 環境変数
description: Sim Studioの設定リファレンス
---
import { Callout } from 'fumadocs-ui/components/callout'
## 必須項目
| 変数 | 説明 |
|----------|-------------|
| `DATABASE_URL` | PostgreSQL接続文字列 |
| `BETTER_AUTH_SECRET` | 認証シークレット32桁の16進数: `openssl rand -hex 32` |
| `BETTER_AUTH_URL` | アプリのURL |
| `ENCRYPTION_KEY` | 暗号化キー32桁の16進数: `openssl rand -hex 32` |
| `INTERNAL_API_SECRET` | 内部APIシークレット32桁の16進数: `openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | 公開アプリURL |
| `NEXT_PUBLIC_SOCKET_URL` | WebSocket URLデフォルト: `http://localhost:3002` |
## AIプロバイダー
| 変数 | プロバイダー |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY_1` | Anthropic Claude |
| `GEMINI_API_KEY_1` | Google Gemini |
| `MISTRAL_API_KEY` | Mistral |
| `OLLAMA_URL` | Ollamaデフォルト: `http://localhost:11434` |
<Callout type="info">
負荷分散のために、`_1`、`_2`、`_3`のサフィックスを持つ複数のキーを追加できます(例:`OPENAI_API_KEY_1`、`OPENAI_API_KEY_2`。OpenAI、Anthropic、Geminiで動作します。
</Callout>
<Callout type="info">
Dockerでは、ホストマシンのOllamaに接続するために`OLLAMA_URL=http://host.docker.internal:11434`を使用してください。
</Callout>
### Azure OpenAI
| 変数 | 説明 |
|----------|-------------|
| `AZURE_OPENAI_API_KEY` | Azure OpenAI APIキー |
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAIエンドポイントURL |
| `AZURE_OPENAI_API_VERSION` | APIバージョン`2024-02-15-preview` |
### vLLMセルフホスト
| 変数 | 説明 |
|----------|-------------|
| `VLLM_BASE_URL` | vLLMサーバーURL`http://localhost:8000/v1` |
| `VLLM_API_KEY` | vLLM用のオプションベアラートークン |
## OAuth プロバイダー
| 変数 | 説明 |
|----------|-------------|
| `GOOGLE_CLIENT_ID` | Google OAuthクライアントID |
| `GOOGLE_CLIENT_SECRET` | Google OAuthクライアントシークレット |
| `GITHUB_CLIENT_ID` | GitHub OAuthクライアントID |
| `GITHUB_CLIENT_SECRET` | GitHub OAuthクライアントシークレット |
## オプション
| 変数 | 説明 |
|----------|-------------|
| `API_ENCRYPTION_KEY` | 保存されたAPIキーを暗号化します32桁の16進数: `openssl rand -hex 32` |
| `COPILOT_API_KEY` | コパイロット機能用のAPIキー |
| `ADMIN_API_KEY` | GitOps操作用の管理者APIキー |
| `RESEND_API_KEY` | 通知用のメールサービス |
| `ALLOWED_LOGIN_DOMAINS` | サインアップをドメインに制限(カンマ区切り) |
| `ALLOWED_LOGIN_EMAILS` | サインアップを特定のメールに制限(カンマ区切り) |
| `DISABLE_REGISTRATION` | 新規ユーザーのサインアップを無効にするには `true` に設定 |
## .envの例
```bash
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...
```
すべてのオプションについては `apps/sim/.env.example` を参照してください。

View File

@@ -0,0 +1,50 @@
---
title: セルフホスティング
description: 自社のインフラストラクチャにSim Studioをデプロイ
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Callout } from 'fumadocs-ui/components/callout'
DockerまたはKubernetesを使用して、自社のインフラストラクチャにSim Studioをデプロイします。
## 要件
| リソース | 最小 | 推奨 |
|----------|---------|-------------|
| CPU | 2コア | 4+コア |
| RAM | 12 GB | 16+ GB |
| ストレージ | 20 GB SSD | 50+ GB SSD |
| Docker | 20.10+ | 最新版 |
## クイックスタート
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
[http://localhost:3000](http://localhost:3000)を開く
## デプロイオプション
<Cards>
<Card title="Docker" href="/self-hosting/docker">
任意のサーバーでDocker Composeを使用してデプロイ
</Card>
<Card title="Kubernetes" href="/self-hosting/kubernetes">
KubernetesクラスターでHelmを使用してデプロイ
</Card>
<Card title="クラウドプラットフォーム" href="/self-hosting/platforms">
Railway、DigitalOcean、AWS、Azure、GCPのガイド
</Card>
</Cards>
## アーキテクチャ
| コンポーネント | ポート | 説明 |
|-----------|------|-------------|
| simstudio | 3000 | メインアプリケーション |
| realtime | 3002 | WebSocketサーバー |
| db | 5432 | pgvector搭載のPostgreSQL |
| migrations | - | データベースマイグレーション(一度だけ実行) |

View File

@@ -0,0 +1,133 @@
---
title: Kubernetes
description: Helmを使用してSim Studioをデプロイする
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## 前提条件
- Kubernetes 1.19+
- Helm 3.0+
- PVプロビジョナーのサポート
## インストール
```bash
# Clone repo
git clone https://github.com/simstudioai/sim.git && cd sim
# Generate secrets
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
# Install
helm install sim ./helm/sim \
--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" \
--namespace simstudio --create-namespace
```
## クラウド固有の値
<Tabs items={['AWS EKS', 'Azure AKS', 'GCP GKE']}>
<Tab value="AWS EKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="Azure AKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-azure.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="GCP GKE">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-gcp.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
</Tabs>
## 主要な設定
```yaml
# Custom values.yaml
app:
replicaCount: 2
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
OPENAI_API_KEY: "sk-..."
postgresql:
persistence:
size: 50Gi
ingress:
enabled: true
className: nginx
tls:
enabled: true
app:
host: sim.yourdomain.com
```
すべてのオプションについては `helm/sim/values.yaml` を参照してください。
## 外部データベース
```yaml
postgresql:
enabled: false
externalDatabase:
enabled: true
host: "your-db-host"
port: 5432
username: "postgres"
password: "your-password"
database: "simstudio"
sslMode: "require"
```
## コマンド
```bash
# Port forward for local access
kubectl port-forward deployment/sim-sim-app 3000:3000 -n simstudio
# View logs
kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
# Upgrade
helm upgrade sim ./helm/sim --namespace simstudio
# Uninstall
helm uninstall sim --namespace simstudio
```

View File

@@ -0,0 +1,124 @@
---
title: クラウドプラットフォーム
description: クラウドプラットフォームにSim Studioをデプロイする
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Railway
ワンクリックデプロイメントで自動的にPostgreSQLをプロビジョニングします。
[
![Railwayにデプロイ](https://railway.app/button.svg)
](https://railway.com/new/template/sim-studio)
デプロイ後、Railwayダッシュボードで環境変数を追加してください
- `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET` (自動生成)
- `OPENAI_API_KEY` または他のAIプロバイダーキー
- 設定 → ネットワーキングでカスタムドメイン
## VPSデプロイメント
DigitalOcean、AWS EC2、Azure VMsまたは任意のLinuxサーバー向け
<Tabs items={['DigitalOcean', 'AWS EC2', 'Azure VM']}>
<Tab value="DigitalOcean">
**推奨:** 16 GB RAMドロップレット、Ubuntu 24.04
```bash
# Create Droplet via console, then SSH in
ssh root@your-droplet-ip
```
</Tab>
<Tab value="AWS EC2">
**推奨:** t3.xlarge (16 GB RAM)、Ubuntu 24.04
```bash
ssh -i your-key.pem ubuntu@your-ec2-ip
```
</Tab>
<Tab value="Azure VM">
**推奨:** Standard_D4s_v3 (16 GB RAM)、Ubuntu 24.04
```bash
ssh azureuser@your-vm-ip
```
</Tab>
</Tabs>
### Dockerのインストール
```bash
# Install Docker (official method)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# Logout and reconnect, then verify
docker --version
```
### Sim Studioのデプロイ
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
# Create .env with secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
# Start
docker compose -f docker-compose.prod.yml up -d
```
### CaddyによるSSL
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Configure (replace domain)
echo 'sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}' | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
```
ドメインのDNS AレコードをサーバーのIPアドレスに向けてください。
## Kubernetes (EKS, AKS, GKE)
[Kubernetesガイド](/self-hosting/kubernetes)でマネージドKubernetesへのHelmデプロイメントについて確認してください。
## マネージドデータベース(オプション)
本番環境では、マネージドPostgreSQLサービスを使用してください
- **AWS RDS** / **Azure Database** / **Cloud SQL** - pgvector拡張機能を有効化
- **Supabase** / **Neon** - pgvector搭載済み
環境に`DATABASE_URL`を設定してください:
```bash
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
```

View File

@@ -0,0 +1,113 @@
---
title: トラブルシューティング
description: 一般的な問題と解決策
---
## データベース接続に失敗
```bash
# Check database is running
docker compose ps db
# Test connection
docker compose exec db psql -U postgres -c "SELECT 1"
```
`DATABASE_URL` 形式を確認してください: `postgresql://user:pass@host:5432/database`
## Ollamaモデルが表示されない
Docker内では、`localhost` = ホストマシンではなく、コンテナを指します。
```bash
# For host-machine Ollama, use:
OLLAMA_URL=http://host.docker.internal:11434 # macOS/Windows
OLLAMA_URL=http://192.168.1.x:11434 # Linux (use actual IP)
```
## WebSocket/リアルタイム機能が動作しない
1. `NEXT_PUBLIC_SOCKET_URL` がドメインと一致しているか確認する
2. リアルタイムサービスが実行されているか確認する: `docker compose ps realtime`
3. リバースプロキシがWebSocketアップグレードを通過させていることを確認する[Dockerガイド](/self-hosting/docker)を参照)
## 502 Bad Gateway
```bash
# Check app is running
docker compose ps simstudio
docker compose logs simstudio
# Common causes: out of memory, database not ready
```
## マイグレーションエラー
```bash
# View migration logs
docker compose logs migrations
# Run manually
docker compose exec simstudio bun run db:migrate
```
## pgvectorが見つからない
正しいPostgreSQLイメージを使用してください
```yaml
image: pgvector/pgvector:pg17 # NOT postgres:17
```
## 証明書エラーCERT_HAS_EXPIRED
外部APIを呼び出す際にSSL証明書エラーが表示される場合
```bash
# Update CA certificates in container
docker compose exec simstudio apt-get update && apt-get install -y ca-certificates
# Or set in environment (not recommended for production)
NODE_TLS_REJECT_UNAUTHORIZED=0
```
## ログイン後の空白ページ
1. ブラウザコンソールでエラーを確認する
2. `NEXT_PUBLIC_APP_URL` が実際のドメインと一致しているか確認する
3. ブラウザのCookieとローカルストレージをクリアする
4. すべてのサービスが実行されているか確認する: `docker compose ps`
## Windows特有の問題
**WindowsでのTurbopackエラー**
```bash
# Use WSL2 for better compatibility
wsl --install
# Or disable Turbopack in package.json
# Change "next dev --turbopack" to "next dev"
```
**改行の問題:**
```bash
# Configure git to use LF
git config --global core.autocrlf input
```
## ログを表示
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f simstudio
```
## ヘルプを得る
- [GitHub Issues](https://github.com/simstudioai/sim/issues)
- [Discord](https://discord.gg/Hr4UWYEcTT)

View File

@@ -0,0 +1,155 @@
---
title: Docker
description: 使用 Docker Compose 部署 Sim Studio
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## 快速开始
```bash
# Clone and start
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
打开 [http://localhost:3000](http://localhost:3000)
## 生产环境设置
### 1. 配置环境
```bash
# Generate secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
```
### 2. 启动服务
```bash
docker compose -f docker-compose.prod.yml up -d
```
### 3. 设置 SSL
<Tabs items={['Caddy (推荐)', 'Nginx + Certbot']}>
<Tab value="Caddy (推荐)">
Caddy 会自动处理 SSL 证书。
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
```
创建 `/etc/caddy/Caddyfile`
```
sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}
```
```bash
sudo systemctl restart caddy
```
</Tab>
<Tab value="Nginx + Certbot">
```bash
# Install
sudo apt install nginx certbot python3-certbot-nginx -y
# Create /etc/nginx/sites-available/sim
server {
listen 80;
server_name sim.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# Enable and get certificate
sudo ln -s /etc/nginx/sites-available/sim /etc/nginx/sites-enabled/
sudo certbot --nginx -d sim.yourdomain.com
```
</Tab>
</Tabs>
## Ollama
```bash
# With GPU
docker compose -f docker-compose.ollama.yml --profile gpu --profile setup up -d
# CPU only
docker compose -f docker-compose.ollama.yml --profile cpu --profile setup up -d
```
拉取其他模型:
```bash
docker compose -f docker-compose.ollama.yml exec ollama ollama pull llama3.2
```
### 外部 Ollama
如果 Ollama 在您的主机上运行(而不是在 Docker 中):
```bash
# macOS/Windows
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
# Linux - use your host IP
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
```
<Callout type="warning">
在 Docker 内,`localhost` 指的是容器,而不是您的主机。请使用 `host.docker.internal` 或您的主机 IP。
</Callout>
## 命令
```bash
# View logs
docker compose -f docker-compose.prod.yml logs -f simstudio
# Stop
docker compose -f docker-compose.prod.yml down
# Update
docker compose -f docker-compose.prod.yml pull && docker compose -f docker-compose.prod.yml up -d
# Backup database
docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql
```

View File

@@ -0,0 +1,87 @@
---
title: 环境变量
description: Sim Studio 的配置参考
---
import { Callout } from 'fumadocs-ui/components/callout'
## 必需
| 变量 | 描述 |
|----------|-------------|
| `DATABASE_URL` | PostgreSQL 连接字符串 |
| `BETTER_AUTH_SECRET` | 认证密钥32 个十六进制字符):`openssl rand -hex 32` |
| `BETTER_AUTH_URL` | 您的应用程序 URL |
| `ENCRYPTION_KEY` | 加密密钥32 个十六进制字符):`openssl rand -hex 32` |
| `INTERNAL_API_SECRET` | 内部 API 密钥32 个十六进制字符):`openssl rand -hex 32` |
| `NEXT_PUBLIC_APP_URL` | 公共应用程序 URL |
| `NEXT_PUBLIC_SOCKET_URL` | WebSocket URL默认值`http://localhost:3002` |
## AI 提供商
| 变量 | 提供商 |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI |
| `ANTHROPIC_API_KEY_1` | Anthropic Claude |
| `GEMINI_API_KEY_1` | Google Gemini |
| `MISTRAL_API_KEY` | Mistral |
| `OLLAMA_URL` | Ollama默认值`http://localhost:11434` |
<Callout type="info">
为了负载均衡,请添加带有 `_1`、`_2`、`_3` 后缀的多个密钥(例如,`OPENAI_API_KEY_1`、`OPENAI_API_KEY_2`)。适用于 OpenAI、Anthropic 和 Gemini。
</Callout>
<Callout type="info">
在 Docker 中,使用 `OLLAMA_URL=http://host.docker.internal:11434` 作为主机机器的 Ollama。
</Callout>
### Azure OpenAI
| 变量 | 描述 |
|----------|-------------|
| `AZURE_OPENAI_API_KEY` | Azure OpenAI API 密钥 |
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI 端点 URL |
| `AZURE_OPENAI_API_VERSION` | API 版本(例如,`2024-02-15-preview` |
### vLLM自托管
| 变量 | 描述 |
|----------|-------------|
| `VLLM_BASE_URL` | vLLM 服务器 URL例如`http://localhost:8000/v1` |
| `VLLM_API_KEY` | vLLM 的可选 Bearer Token |
## OAuth 提供商
| 变量 | 描述 |
|----------|-------------|
| `GOOGLE_CLIENT_ID` | Google OAuth 客户端 ID |
| `GOOGLE_CLIENT_SECRET` | Google OAuth 客户端密钥 |
| `GITHUB_CLIENT_ID` | GitHub OAuth 客户端 ID |
| `GITHUB_CLIENT_SECRET` | GitHub OAuth 客户端密钥 |
## 可选
| 变量 | 描述 |
|----------|-------------|
| `API_ENCRYPTION_KEY` | 加密存储的 API 密钥32 个十六进制字符):`openssl rand -hex 32` |
| `COPILOT_API_KEY` | 用于 copilot 功能的 API 密钥 |
| `ADMIN_API_KEY` | 用于 GitOps 操作的管理员 API 密钥 |
| `RESEND_API_KEY` | 用于通知的电子邮件服务 |
| `ALLOWED_LOGIN_DOMAINS` | 限制注册到特定域(逗号分隔) |
| `ALLOWED_LOGIN_EMAILS` | 限制注册到特定电子邮件(逗号分隔) |
| `DISABLE_REGISTRATION` | 设置为 `true` 以禁用新用户注册 |
## 示例 .env
```bash
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...
```
查看 `apps/sim/.env.example` 以获取所有选项。

View File

@@ -0,0 +1,50 @@
---
title: 自托管
description: 在您自己的基础设施上部署 Sim Studio
---
import { Card, Cards } from 'fumadocs-ui/components/card'
import { Callout } from 'fumadocs-ui/components/callout'
使用 Docker 或 Kubernetes 在您自己的基础设施上部署 Sim Studio。
## 要求
| 资源 | 最低要求 | 推荐配置 |
|----------|---------|-------------|
| CPU | 2 核 | 4 核及以上 |
| 内存 | 12 GB | 16 GB 及以上 |
| 存储 | 20 GB SSD | 50 GB 及以上 SSD |
| Docker | 20.10+ | 最新版本 |
## 快速开始
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
docker compose -f docker-compose.prod.yml up -d
```
打开 [http://localhost:3000](http://localhost:3000)
## 部署选项
<Cards>
<Card title="Docker" href="/self-hosting/docker">
使用 Docker Compose 在任何服务器上部署
</Card>
<Card title="Kubernetes" href="/self-hosting/kubernetes">
使用 Helm 在 Kubernetes 集群上部署
</Card>
<Card title="Cloud Platforms" href="/self-hosting/platforms">
Railway、DigitalOcean、AWS、Azure、GCP 指南
</Card>
</Cards>
## 架构
| 组件 | 端口 | 描述 |
|-----------|------|-------------|
| simstudio | 3000 | 主应用程序 |
| realtime | 3002 | WebSocket 服务器 |
| db | 5432 | 带有 pgvector 的 PostgreSQL |
| migrations | - | 数据库迁移(运行一次) |

View File

@@ -0,0 +1,133 @@
---
title: Kubernetes
description: 使用 Helm 部署 Sim Studio
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## 前置条件
- Kubernetes 1.19+
- Helm 3.0+
- 支持 PV 提供程序
## 安装
```bash
# Clone repo
git clone https://github.com/simstudioai/sim.git && cd sim
# Generate secrets
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
# Install
helm install sim ./helm/sim \
--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" \
--namespace simstudio --create-namespace
```
## 云特定值
<Tabs items={['AWS EKS', 'Azure AKS', 'GCP GKE']}>
<Tab value="AWS EKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="Azure AKS">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-azure.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
<Tab value="GCP GKE">
```bash
helm install sim ./helm/sim \
--values ./helm/sim/examples/values-gcp.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.NEXT_PUBLIC_APP_URL="https://sim.yourdomain.com" \
--namespace simstudio --create-namespace
```
</Tab>
</Tabs>
## 关键配置
```yaml
# Custom values.yaml
app:
replicaCount: 2
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
OPENAI_API_KEY: "sk-..."
postgresql:
persistence:
size: 50Gi
ingress:
enabled: true
className: nginx
tls:
enabled: true
app:
host: sim.yourdomain.com
```
查看 `helm/sim/values.yaml` 了解所有选项。
## 外部数据库
```yaml
postgresql:
enabled: false
externalDatabase:
enabled: true
host: "your-db-host"
port: 5432
username: "postgres"
password: "your-password"
database: "simstudio"
sslMode: "require"
```
## 命令
```bash
# Port forward for local access
kubectl port-forward deployment/sim-sim-app 3000:3000 -n simstudio
# View logs
kubectl logs -l app.kubernetes.io/component=app -n simstudio --tail=100
# Upgrade
helm upgrade sim ./helm/sim --namespace simstudio
# Uninstall
helm uninstall sim --namespace simstudio
```

View File

@@ -0,0 +1,124 @@
---
title: 云平台
description: 在云平台上部署 Sim Studio
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { Callout } from 'fumadocs-ui/components/callout'
## Railway
一键部署并自动配置 PostgreSQL。
[
![在 Railway 上部署](https://railway.app/button.svg)
](https://railway.com/new/template/sim-studio)
部署后,在 Railway 仪表板中添加环境变量:
- `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`(自动生成)
- `OPENAI_API_KEY` 或其他 AI 提供商密钥
- 自定义域名:设置 → 网络
## VPS 部署
适用于 DigitalOcean、AWS EC2、Azure VMs 或任何 Linux 服务器:
<Tabs items={['DigitalOcean', 'AWS EC2', 'Azure VM']}>
<Tab value="DigitalOcean">
**推荐配置:** 16 GB RAM DropletUbuntu 24.04
```bash
# Create Droplet via console, then SSH in
ssh root@your-droplet-ip
```
</Tab>
<Tab value="AWS EC2">
**推荐配置:** t3.xlarge16 GB RAMUbuntu 24.04
```bash
ssh -i your-key.pem ubuntu@your-ec2-ip
```
</Tab>
<Tab value="Azure VM">
**推荐配置:** Standard_D4s_v316 GB RAMUbuntu 24.04
```bash
ssh azureuser@your-vm-ip
```
</Tab>
</Tabs>
### 安装 Docker
```bash
# Install Docker (official method)
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
# Logout and reconnect, then verify
docker --version
```
### 部署 Sim Studio
```bash
git clone https://github.com/simstudioai/sim.git && cd sim
# Create .env with secrets
cat > .env << EOF
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
INTERNAL_API_SECRET=$(openssl rand -hex 32)
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com
NEXT_PUBLIC_SOCKET_URL=https://sim.yourdomain.com
EOF
# Start
docker compose -f docker-compose.prod.yml up -d
```
### 使用 Caddy 配置 SSL
```bash
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Configure (replace domain)
echo 'sim.yourdomain.com {
reverse_proxy localhost:3000
handle /socket.io/* {
reverse_proxy localhost:3002
}
}' | sudo tee /etc/caddy/Caddyfile
sudo systemctl restart caddy
```
将您的域名的 DNS A 记录指向您的服务器 IP。
## KubernetesEKS、AKS、GKE
有关在托管 Kubernetes 上使用 Helm 部署的详细信息,请参阅 [Kubernetes 指南](/self-hosting/kubernetes)。
## 托管数据库(可选)
在生产环境中,请使用托管的 PostgreSQL 服务:
- **AWS RDS** / **Azure Database** / **Cloud SQL** - 启用 pgvector 扩展
- **Supabase** / **Neon** - 已包含 pgvector
在您的环境中设置 `DATABASE_URL`
```bash
DATABASE_URL="postgresql://user:pass@host:5432/db?sslmode=require"
```

View File

@@ -0,0 +1,113 @@
---
title: 故障排除
description: 常见问题及解决方案
---
## 数据库连接失败
```bash
# Check database is running
docker compose ps db
# Test connection
docker compose exec db psql -U postgres -c "SELECT 1"
```
验证 `DATABASE_URL` 格式:`postgresql://user:pass@host:5432/database`
## Ollama 模型未显示
在 Docker 中,`localhost` = 容器,而不是您的主机。
```bash
# For host-machine Ollama, use:
OLLAMA_URL=http://host.docker.internal:11434 # macOS/Windows
OLLAMA_URL=http://192.168.1.x:11434 # Linux (use actual IP)
```
## WebSocket/实时功能无法正常工作
1. 检查 `NEXT_PUBLIC_SOCKET_URL` 是否与您的域名匹配
2. 验证实时服务是否正在运行:`docker compose ps realtime`
3. 确保反向代理支持 WebSocket 升级(参见 [Docker 指南](/self-hosting/docker)
## 502 错误网关
```bash
# Check app is running
docker compose ps simstudio
docker compose logs simstudio
# Common causes: out of memory, database not ready
```
## 迁移错误
```bash
# View migration logs
docker compose logs migrations
# Run manually
docker compose exec simstudio bun run db:migrate
```
## 找不到 pgvector
使用正确的 PostgreSQL 镜像:
```yaml
image: pgvector/pgvector:pg17 # NOT postgres:17
```
## 证书错误 (CERT_HAS_EXPIRED)
如果调用外部 API 时出现 SSL 证书错误:
```bash
# Update CA certificates in container
docker compose exec simstudio apt-get update && apt-get install -y ca-certificates
# Or set in environment (not recommended for production)
NODE_TLS_REJECT_UNAUTHORIZED=0
```
## 登录后出现空白页面
1. 检查浏览器控制台是否有错误
2. 验证 `NEXT_PUBLIC_APP_URL` 是否与您的实际域名匹配
3. 清除浏览器的 Cookie 和本地存储
4. 检查所有服务是否正在运行:`docker compose ps`
## Windows 特定问题
**Windows 上的 Turbopack 错误:**
```bash
# Use WSL2 for better compatibility
wsl --install
# Or disable Turbopack in package.json
# Change "next dev --turbopack" to "next dev"
```
**行尾问题:**
```bash
# Configure git to use LF
git config --global core.autocrlf input
```
## 查看日志
```bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f simstudio
```
## 获取帮助
- [GitHub Issues](https://github.com/simstudioai/sim/issues)
- [Discord](https://discord.gg/Hr4UWYEcTT)

View File

@@ -48933,3 +48933,157 @@ checksums:
content/70: 83f29573676a9d1ccb33827ff578858a
content/71: b3f310d5ef115bea5a8b75bf25d7ea9a
content/72: fe020be6c017a995d0355c99c6b034ec
1b5c57a63b2d38e097b7f96b6e054db8:
meta/title: 6ac3805eb202cc0ba10ad61dc1ada045
meta/description: 9d15289c788bd388e5227cb563a740f8
content/0: 788f3a864cc39c0564d51e1d1cd9ff22
content/1: 9be86f736d43388837d7c3255cb3c4d7
content/2: a0ee15c76fc6046002638b95447f96ff
content/3: fa1ff96b560f555e4e3d8ab8dde2f48a
content/4: 49147be50168a5a9cd29f74dd0e5070c
content/5: 23d12cd73347011326dc510f5a64ebd1
content/6: 734332de1f2a5bf11a2592b719c364dd
content/7: 95250f345f24a86e24bb4a709e2e974f
content/8: e793c95422005f54a9cec21d6970d2c8
content/9: 05d7473426b6c16f74e7d198cfbb0cb7
content/10: 1b9cf53ffdbe9f66a832adb01b9adb7d
content/11: 49686bc01877cc2cd905c07856b60968
content/12: ee8f3e459896a02058984d223f84782c
content/13: 7e67336940094a9c4af1d33718425bbb
content/14: 4079240d26f493561febcc0d2424a762
content/15: b792a368c791d2a4057053cacdce118c
content/16: 6e96fbce23fe7557a17e9ef86a1281d5
content/17: 55e329c2041769a139ad41bb1a5f330d
content/18: 50c787548872a04fd1284e031435abc1
content/19: 1e66bd6d20fe0e2dcf92f6d0f5368747
content/20: 1144109c71063d3ff843c8d4c9e5b152
content/21: 1d03eb3c81f0ec3b7d180d86bba23ca1
content/22: 9727c72124aebb118edec2d78b2b262d
content/23: 1f217cf2f2ea40bf0b288371646c4b64
content/24: 4264d1f59e6bccb77c960392dd14c9c7
content/25: 9dd663b7aaa0e1aa54acfb5c049b5a55
content/26: 0b58eed72d57c695813a8ab2d4e38a43
content/27: 1e733832735cc568035073b340ca0f4e
content/28: 0468f49bf9ba3fc25037ed47c84502ef
5b14b034c1063c2e7d408c6cadba9a1e:
meta/title: a2d9323f87fb0028f39dfa4e0a4d7d71
meta/description: 9cbe42b3ae37e29953900095a016c90c
content/0: f0b49646269c72e3fe82ab242d31a5c7
content/1: d5ac1176896f40c95ee6a9dbb0f04e60
content/2: 437859c58d04ea7fe3f7c17ff07f651c
content/3: c7315dc914f85a8e7be1553e0458fdda
content/4: 1352ef721cad0d6ba681bec14478a120
content/5: ba8058adffeed2edded227ade405b3d6
content/6: cc0443e0cd2d1957adbc5ec41f170c81
content/7: 24f8cc625d382d32b9322ec76916d45d
content/8: 942e3d5cbc20729b09a5bb19681b7601
content/9: 2992441e06f8c7759773e82e93175cd1
content/10: 44194a2283027a76dba38f110adc41ad
content/11: 6d9288feed6ba2a6d269e161c4a8bb19
content/12: 8e6335029427810edaa8f328852b7fbe
content/13: 676041ae8ea3d298396e956e2a8c976f
content/14: 1b2df0a6fe68827b69139eef5d37bde9
content/15: 3304a33dfb626c6e2267c062e8956a9d
content/16: 46babdd66f738104252f4d4aed6d7263
content/17: 79d5a9ec463aa51c206c437c84413a73
content/18: e33326c95467278a9f4f959bf29a7ea7
content/19: 25f161b9292300600117ef6f752ede94
content/20: 0dd2c95befe432a96884cbd329ba6614
content/21: d79e98f5ea058b22817a2815a5204c2f
content/22: 5530aae43311704e87cbd7356f652671
content/23: 77a8b64f9daee5eb35869a722582af9c
content/24: 26375dab1609c61de13bb061f3474c95
content/25: 618d7c3aeb14efcbf76ee9fdb0a9cb5d
content/26: c0467f69ad04c70f4c5bf7f514150f0a
content/27: 4b806fdc34160e17187a83a78e569c8a
content/28: bc385d2332fc9efb9d21755f8704010b
content/29: 373512a6210dcae033357e1028b90982
729af5a9a28e14b58b4111da6b0cf13c:
meta/title: 9a975fb182899afd051bbf56347dd3b3
meta/description: 650a17c852f56056e62fba9adede01bc
content/0: f0b49646269c72e3fe82ab242d31a5c7
content/1: 48361e78de327edccd0c2d8c6c4a5494
content/2: 9f533c3891128fe351189c94f6e495f5
content/3: 391128dee61b5d0d43eba88567aaef42
content/4: 07022204d43750c73c0753d75683b16f
content/5: 3ea053b7a26239743b6de62a32cd7a46
content/6: 23fbbe701b60dfbd781f44ca2c5dee8b
content/7: a23cd40dcc0fb6090eeb9db009ec391e
content/8: a71f699ec09f09214f0798a4ca775fca
content/9: c867eb1641a114009759c5e9f06c31c5
content/10: 6f4f745603fc23f24eae43e367735da3
content/11: 79dbacaf848d294223c6f1cd11fd91c3
content/12: 3304a33dfb626c6e2267c062e8956a9d
content/13: 051222c54b5add12c2048c57840e25e0
content/14: 7d576599d17b8ff76fc3eb51bcfb5584
content/15: 7cfde5ca8164b52afe12074a95b6a21f
content/16: 8908a88d73243c63da438ce43ed49870
content/17: 61372fd9711dfe5eec9e3799a7c90a2b
content/18: 746bc0998b79e81e1912e049a05865d3
content/19: 6a8d5f97b70a4555b499868575f11141
fd6f0d1fa41bbacc06386340625ff1aa:
meta/title: 58e9ce12b9b0e0f84f98a118dd3da37b
meta/description: 6aa21d9bb5dd3152b2cd6de8b7775e0d
content/0: 3a9daa61782f1fc39bef9469f491d27d
content/1: ac754b22b6a1ed9e6926ae4081498b4f
content/2: d62c9575cc66feec7589fba95c9f7aee
content/3: c0f38deb15a6623bff04226b4783af98
content/4: 56ea06288e338a3c329d80a0f845b4a0
content/5: 1d183e4b16ea089353690b86ee5d9123
content/6: 6480198c8935f30f57cec7f1f761a97d
content/7: 3cb16053db18d8997d72e38b8e336438
content/8: 0fa272de829c5b8672a44f6a9f87bd99
content/9: a3c2e315559c0df45b4ca39a9a02236f
content/10: 7c1e364f142a0f32c546b7129bd18afa
93422a94ee0e64a54dd84ce24b99efcb:
meta/title: 538ccbbb5bae1e2b53c526e8e06feef3
meta/description: 32cd350ff688ff53a1c29518531c003e
content/0: 232be69c8f3053a40f695f9c9dcb3f2e
content/1: 9a97f1047f7127c9caa6777d78893113
content/2: 811be6985fdcb266ed9092ad2b1812e3
content/3: a341918411b2287ced6505929d64d80f
content/4: 022680615d8fba85da1779987de58ffe
content/5: c3bad935a189da8bf2b92b505e4d7dde
content/6: b19c0618fb41641a515afeb5ffc2ebf6
content/7: 95a511d4bf1ee9ab32758ae877389e81
content/8: 8db40d50eb73a860c1378e83c777a7a9
content/9: 6fc08be0705b3bc0d210e43730c3354b
content/10: 704c33c06da3370c9726df90b4db11eb
content/11: c0561ecff29648963a26914cf51a1ccf
content/12: bc941a7212c82f7952a980b8cdff173e
content/13: 6a25e03bdd4286e44f269b04276b10de
content/14: 4fff00e8bd2dd9613576c3d47279b3aa
content/15: d25efcec9572e48cc3f4434bf9b7dd9a
content/16: 7b7ce6b9f12b4044d6e64e9ffefb3601
content/17: 995ae47689f0c1f6fa8dc8190e106b38
fbb88b12cbab45a5fa14ba520d197fb3:
meta/title: 0de4d47501a7bb79ab94f9da307dc6fc
meta/description: 6367e2f210e1bcf2007e5fa79ea0e6b9
content/0: f0b49646269c72e3fe82ab242d31a5c7
content/1: 56ea06288e338a3c329d80a0f845b4a0
content/2: cf4f06554ad7f32852a1b4b93617cb01
content/3: 6480198c8935f30f57cec7f1f761a97d
content/4: d431b26b4ceb2cf0609b411d10a05d3a
content/5: efb59989d3e662dbf0b28fa00e4c2ae6
content/6: c5e556fb0b6ed41712484f3e961c5544
content/7: 100aefe3f9f07261c7769c39b82dffb1
content/8: 4f6ba176ad2f6ccce074889450706363
content/9: 84a1da3d7d5fe492f9eec281ab8b384e
content/10: c9a712b04a3d268c0906c74338b6ba4e
content/11: 86c3411ef57bcac05a9760d903acd84a
content/12: 5520363779134f65b88a06c55fc8cdcc
content/13: 51a33ae79443b6237c2ca32ad84d1379
content/14: a2004e35fe83b1fd8848d1eb6e4bf94c
content/15: f71dcc42ca7c2a65544e1d4c6e552e76
content/16: 616b46c575631095adcaed620829dcac
content/17: 3304a33dfb626c6e2267c062e8956a9d
content/18: 8290e53f98b03dbbca8f0c5673291607
content/19: de7cfb42a8774fdf07cee29f4b4b06c4
content/20: ea29416edca1c463b0fe50ccd95dc2ac
content/21: 370ac33cf8edc549eb3d4b3dd767121b
content/22: ec531368a8d1acf9978aa6266d454142
content/23: b49fc056af3cd1853d9d31854b1d515f
content/24: 5f8c8cc500a8362fb14fd816af7f52b2
content/25: 38f65a5fcf96ad88df123dc0ae4e6556
content/26: 746bc0998b79e81e1912e049a05865d3
content/27: 755eb21269b2c83655633ce1984f3558