Skip to Content
Self-hostingOverview

Self-hosting

The hosted build of Screenplay is a multi-user Next.js app. People sign in with GitHub, share canvases, and each chat runs in its own cloud sandbox VM. This section covers deploying it.

Only need it for yourself? The desktop app needs no services at all. It swaps every backend below for a local one.

How it fits together

realtimeBrowserNext.js appVercelYjs hostlive canvas state + presencePostgresusers, canvases, chats, presetsSandbox providerone VM per chatdev servergitterminalscoding CLIsModel provider(s)the agentBlob storecanvas thumbnailsGitHub OAuthsign-in + repo access

Every backend sits behind a small interface in apps/app/lib/, so each one is swappable. The defaults are what the reference deployment uses:

ServiceUsed forDefaultAlternatives
HostingRunning the Next.js appVercelAnything that runs Next.js
GitHub OAuth appSign-in, plus repo scope to clone and push for usersGitHub—
PostgresUsers, sessions, canvases, members, comments, agent history, encrypted settingsNeon (serverless HTTP driver)Any Postgres; swap the driver
Yjs hostRealtime sync of each canvas document, agent streams, and presenceLiveblocksHocuspocus, y-websocket, … (how)
Sandbox providerOne Linux VM per chatVercel SandboxE2B, Modal, … (how)
Model providerThe agent. At least one is required.AnthropicOpenAI, Google, Vercel AI Gateway, any OpenAI-compatible API (how)
Blob storeCanvas thumbnailsVercel BlobS3, R2, GCS, … (how)

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.

Last updated on