---
title: "Deploy Sim Studio | (Just Updated) AI Agent Workflow Builder, Postgres + Redis, Data Survives Redeploys"
description: "Sim Studio: open-source AI agent workflow builder, pgvector Postgres, Redis"
category: "AI/ML"
url: https://railway.com/deploy/sim-studio-or-just-updated-ai-agent-work
---

# Deploy Sim Studio | (Just Updated) AI Agent Workflow Builder, Postgres + Redis, Data Survives Redeploys

Sim Studio: open-source AI agent workflow builder, pgvector Postgres, Redis

**[Deploy Sim Studio | (Just Updated) AI Agent Workflow Builder, Postgres + Redis, Data Survives Redeploys on Railway](https://railway.com/template/sim-studio-or-just-updated-ai-agent-work)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/sim-studio-or-just-updated-ai-agent-work/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** AI/ML

## Template content

### realtime

- **Image:** ghcr.io/simstudioai/realtime:1.4.4-alpine@sha256:0b820cd8119ae4eff1d832d18fbdcf78848d216e7cc0965d3cf9ad56779616d7
- **Health check:** /health
- **Public domain:** Yes

### simstudio

- **Image:** ghcr.io/simstudioai/simstudio:1.4.4-slim@sha256:959ce48839c4f08b136947eaddb9c5862c98594e4b841f4b2929e5dc9c544d2d
- **Health check:** /api/health
- **Public domain:** Yes

### postgres

- **Image:** pgvector/pgvector:pg17@sha256:7d0a41464797aeb9862dfdc0bbf1526b82cfd324cdd8036df19e3545f4a9ccb8

### migrations

- **Image:** ghcr.io/simstudioai/migrations:1.4.4-alpine@sha256:23c5bbc62b908edf2943a93d2acca34e8047f379acf2e0d05fd31dbec19759bc
- **Start command:** `/bin/sh -c 'cd /app/packages/db && exec bun run db:migrate'`

### redis

- **Image:** redis:7-alpine@sha256:e7723ff73d963f5cc6d9c4643ea3d989527a402a319239054e9472a7fb9219a2
- **Start command:** `/bin/sh -c 'chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --dir /data'`

## Documentation

# Deploy and Host Sim Studio on Railway

**Built for an LLM agent to deploy and use.** There is no setup form and nothing to fill in: every secret is generated at deploy time, and the contract below lists the addresses, variable names and one script that signs up, creates an API key and calls the API.

Sim Studio (Sim) is an open-source platform for building and running AI agent workflows. You wire models, tools, knowledge bases and logic blocks together on a visual canvas, then deploy a workflow as an API endpoint, a chat, a schedule or a webhook. It is an open-source alternative to n8n and Zapier for AI agents.

## About Hosting Sim Studio

This template runs five services, all pinned by digest to Sim 1.4.4. `simstudio` is the Next.js app with the workflow editor, the API and the web UI, with a volume at its uploads directory. `realtime` is the Socket.IO server that keeps the editor in sync between browsers. `migrations` is a one-shot job that applies the database schema on every deploy and then exits. `postgres` is PostgreSQL 17 with the pgvector extension on a volume, which Sim uses for workflows, users and knowledge-base embeddings. `redis` is Redis 7 on a volume, used for caching and realtime fan-out.

On the first deploy `simstudio` and `realtime` start before the schema exists and restart until `migrations` has finished, so the first boot takes a few minutes. Sign-in uses email and password. The first account you create gets its own workspace.

Registration is open, as in upstream Sim: anyone who can reach the public URL can create an account. After you have created yours, lock the instance by setting `DISABLE_REGISTRATION=true` on the `simstudio` service, or restrict sign-ups with `ALLOWED_LOGIN_EMAILS` (comma separated addresses) or `ALLOWED_LOGIN_DOMAINS`. Railway redeploys the service when you save the variable.

### Agent contract

- Public URL: `NEXT_PUBLIC_APP_URL` (`https://` plus the `simstudio` service's `RAILWAY_PUBLIC_DOMAIN`). The realtime server has its own public address in `NEXT_PUBLIC_SOCKET_URL`.
- Private URL: `http://simstudio.railway.internal:8080` (app) and `http://realtime.railway.internal:8080` (realtime).
- Credentials: `ADMIN_API_KEY` (admin API, generated per deploy). User accounts are created through the sign-up route below; there is no default password. Also generated and not for clients: `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`.
- Auth: the admin API (`/api/v1/admin/*`) takes the header `x-admin-key` set to `ADMIN_API_KEY`. The public API (`/api/v1/*`) takes the header `X-API-Key` set to a key created by a signed-in user at `POST /api/users/me/api-keys`. Sign-up and sign-in are `POST /api/auth/sign-up/email` and `POST /api/auth/sign-in/email` with an `Origin` header equal to the public URL.
- Health: `GET /api/health` returns 200 on the app and `GET /health` returns 200 on the realtime server.

```bash
# run with NEXT_PUBLIC_APP_URL and ADMIN_API_KEY set; needs curl and jq
U="$NEXT_PUBLIC_APP_URL"
PW="$(openssl rand -hex 16)"
curl -s -o /dev/null -w "health: %{http_code}\n" "$U/api/health"
curl -s -o /dev/null -w "anonymous admin: %{http_code}\n" -G -d limit=1 -d offset=0 "$U/api/v1/admin/users"
curl -s -o /dev/null -w "admin: %{http_code}\n" -H "x-admin-key: $ADMIN_API_KEY" -G -d limit=1 -d offset=0 "$U/api/v1/admin/users"
curl -s -o /dev/null -w "sign-up: %{http_code}\n" -c /tmp/sim.jar -H "Origin: $U" -H "Content-Type: application/json" \
  -d "{\"name\":\"Agent\",\"email\":\"agent-$(date +%s)@example.com\",\"password\":\"$PW\"}" "$U/api/auth/sign-up/email"
KEY="$(curl -s -b /tmp/sim.jar -H "Origin: $U" -H "Content-Type: application/json" -d '{"name":"agent"}' "$U/api/users/me/api-keys" | jq -r .key.key)"
WS="$(curl -s -b /tmp/sim.jar "$U/api/workspaces" | jq -r '.workspaces[0].id')"
curl -s -H "X-API-Key: $KEY" "$U/api/v1/workflows?workspaceId=$WS" | jq -r '.data[0].name'
```

A fresh deploy prints `health: 200`, `anonymous admin: 401`, `admin: 200`, `sign-up: 200` and the name of the starter workflow, `default-agent`.

## Why Deploy Sim Studio on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Sim Studio on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Agent-ready** - generated secrets, a contract block and one working script; no setup form.
- **Whole stack included** - app, realtime server, migrations job, pgvector Postgres and Redis, wired together.
- **State survives redeploys** - the database, Redis and uploaded files each sit on a volume, and the secrets stay the same.
- **Collaborative editor works out of the box** - the realtime server has its own public address and is already connected.
- **Pinned by digest** - the images are fixed to Sim 1.4.4, so a redeploy never changes the version under you.

## Common Use Cases

- **AI agent workflows behind an API** - build a workflow on the canvas, deploy it, and call it from your own code.
- **Self-hosted n8n or Zapier alternative for LLM tasks** - chains of model calls, tools and integrations on your own infrastructure.
- **Knowledge-base agents** - upload documents, embed them into pgvector and answer questions over them.
- **Team workflow editing** - several people edit the same workflow at once through the realtime server.

## Dependencies for Sim Studio Hosting

- PostgreSQL 17 with pgvector and one Railway volume, created by the template.
- Redis 7 with one Railway volume, created by the template.
- Model provider keys (OpenAI, Anthropic and others) added in the Sim settings when a workflow calls a model.

### Deployment Dependencies

- [Sim repository](https://github.com/simstudioai/sim)
- [Sim documentation](https://docs.sim.ai)
- [Official images](https://github.com/orgs/simstudioai/packages)

### Implementation Details

| Variable | Purpose |
| --- | --- |
| `ADMIN_API_KEY` | Key for the admin API, sent as `x-admin-key`, generated per deploy. |
| `BETTER_AUTH_SECRET` | Signing secret for sessions, generated per deploy. |
| `ENCRYPTION_KEY` | 64 character hex key that encrypts stored credentials, generated per deploy. |
| `INTERNAL_API_SECRET` | Shared secret between the app and the realtime server, generated per deploy. |
| `NEXT_PUBLIC_APP_URL` | HTTPS address of the app. |
| `NEXT_PUBLIC_SOCKET_URL` | HTTPS address of the realtime server, used by the browser. |
| `DATABASE_URL` | Connection string to the Postgres service, built from its generated password. |
| `REDIS_URL` | Connection string to the Redis service, built from its generated password. |

The app and the realtime server read Railway's injected `PORT`. The `simstudio` service runs as root so it can write to its volume.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/sim-studio-or-just-updated-ai-agent-work
