Deploy Sim Agent Workflows + pgvector + Realtime
Sim AI agent workflow builder with pgvector, Redis, realtime and cron
Postgres
Just deployed
Realtime
Just deployed
Just deployed
Just deployed
Migrations
Just deployed
Redis
Just deployed
Deploy and Host Sim on Railway
Sim is an open source workspace for building, deploying and monitoring AI agents and workflows on a visual canvas. This template runs the complete upstream production stack, pinned to one release, with signup closed to everyone except the addresses you allow.
About Hosting Sim
Hosting Sim means running six services that share one database schema: the app, a realtime server, a migration runner, a scheduler, Postgres with pgvector and Redis. This template wires them together with private networking and generated secrets, and orders startup so the app waits for migrations.
What's Included
- Sim: the Next.js app, API and workflow executor, with a volume for uploaded files
- Realtime: the Socket.IO server behind collaborative editing, on its own domain
- Migrations: applies the database schema, then signals the app that it is safe to start
- Cron: the scheduler for scheduled workflows, polling triggers and connector syncs
- Postgres: PostgreSQL 17 with pgvector for knowledge bases, on a volume
- Redis: live chat and table events plus shared caches
Every secret is generated for you and shared between the services that need it.
Why this template
- All three Sim images are pinned to the same release. They share one schema, and a floating tag breaks the stack on the next restart.
- The app and Realtime wait for migrations to finish, so the first deploy does not race.
- Redis and the scheduler are included. Without them live updates and scheduled workflows do not run.
- Signup is restricted from the first minute.
First steps after deploy
- Enter your email address in
ALLOWED_LOGIN_EMAILSwhen you deploy. Only listed addresses can sign up or sign in. - Wait for all six services to turn green. The first boot runs every migration and can take several minutes.
- Open the Sim domain and sign up with the address you allowed.
- Add a model provider key in the workspace settings, or set
OPENAI_API_KEYon the Sim service. - Build a workflow and run it.
Key environment variables
| Variable | Service | Notes |
|---|---|---|
ALLOWED_LOGIN_EMAILS | Sim | Required. Comma separated addresses allowed to register and log in. |
DISABLE_REGISTRATION | Sim | Optional. Set to true once your accounts exist. |
ENCRYPTION_KEY, API_ENCRYPTION_KEY | Sim | Generated. Back them up and never change them. |
NEXT_PUBLIC_APP_URL, BETTER_AUTH_URL | Sim, Realtime | Update both services when you add a custom domain. |
NEXT_PUBLIC_SOCKET_URL | Sim | Public address of Realtime. |
OPENAI_API_KEY, ANTHROPIC_API_KEY_1 | Sim | Optional provider keys for every workspace. |
Common Use Cases
- Build AI agents and multi step workflows on a visual canvas
- Run scheduled or webhook triggered automations that call LLMs and tools
- Give a team a shared, self-hosted workspace with knowledge bases on pgvector
Requirements
Use the Hobby plan or higher. Sim is a large application: upstream suggests 12 GiB of RAM in total for an evaluation install, and the app alone can use several gigabytes.
Upgrading
Back up Postgres, change the image tag on Migrations and wait for it to become healthy, then set the same tag on Sim and Realtime.
Dependencies for Sim Hosting
- PostgreSQL with pgvector (included)
- Redis (included)
- An LLM provider key such as OpenAI or Anthropic (optional at boot, needed to run agents)
- A mail provider such as Resend (optional, for invitations and password resets)
Deployment Dependencies
Why Deploy Sim on Railway?
Railway runs the whole stack in one project with private networking between services, generated secrets, volumes for the database and uploads, and one place to change image tags when you upgrade.
Template Content
Postgres
pgvector/pgvector:pg17ALLOWED_LOGIN_EMAILS
Comma separated email addresses allowed to sign up and sign in, for example you@yourcompany.com. Sim has open self registration: without this list anyone who finds the URL can create an account. Add teammates here later, or use ALLOWED_LOGIN_DOMAINS for a whole domain.
Migrations
ghcr.io/simstudioai/migrations:v0.9.53Redis
redis:7.4.6-alpine
