Self-hosting
There are three ways to run Screenplay:
The desktop app and Headless swap every backend below for a local one. The rest of this page covers deploying Hosted: a multi-user Next.js app where people sign in with GitHub, share canvases, and each chat runs in its own cloud sandbox VM.
How it fits together
Every backend sits behind a small interface in apps/app/lib/, so each one is
swappable. The defaults are what the reference deployment uses:
Setup order
Create the accounts
Sign up for each service in the table, or pick alternatives.
Create a GitHub OAuth app
One app covers production and every preview deploy. See GitHub OAuth.
Provision Postgres
Any Postgres works, and migrations run automatically on deploy. See Database.
Collect your environment variables
Every variable is documented in Environment variables.
Deploy
See Deploying to Vercel, including which variables go in which Vercel scope.
Optional: tune the configuration
Install coding CLIs in sandboxes, serve under a path prefix, or swap any backend listed under Configuration.
Trust model
The hosted build assumes a single trusted operator, or a fully trusted team. The operator’s model API keys are shared by everyone and aren’t metered per user. Coding CLIs in sandboxes never see those keys, because the sandbox’s egress firewall injects them on the way out. Terminal access is gated by canvas membership. Read Terminal access before choosing a strategy for a shared deployment.