Skip to content
RING
Launch Studio

Deployment guide

Ring is a Next.js application with server routes. It needs a Node.js host (not a static export) and, for production, a PostgreSQL database.

Requirements

  • Node.js 22.12 or newer, pnpm 9.
  • Outbound internet access from the server (URL Reader, News Feed Reader, the Elysium RPC, the AI provider).
  • PostgreSQL for durable records.

Environment

Copy .env.example to .env.local (development) or set the variables on the host. Every variable is optional for a local run.

VariableNeeded forNotes
DATABASE_URLDurable recordspostgres://…. Without it, development uses an embedded database in .data/, and production keeps records in memory only.
ANTHROPIC_API_KEYAI stepsSee Provider setup.
RING_AI_GATEWAYAI steps on Vercel without a keyvercel.
RING_AI_MODEL, RING_AI_EFFORT, RING_AI_FALLBACKSTuningDefaults are fine.
RING_AI_PRICE_INPUT_PER_MTOK, RING_AI_PRICE_OUTPUT_PER_MTOKPrice overrideUSD per million tokens.
ELYSIUM_RPC_URLA dedicated RPCDefaults to the public RPC.
RING_AI_DAILY_CAP_USD, RING_MAX_RUN_BUDGET_USDA public deploymentA shared daily ceiling on AI spend and a per-run budget ceiling. See Provider setup.
CRON_SECRETThe scheduled workerWithout it the worker route is closed.
RING_OPERATOR_ADDRESSESHiding listingsComma-separated wallet addresses.
NEXT_PUBLIC_SITE_URLCorrect social preview URLsThe public origin, for example https://example.org.
RING_DISABLE_WEB_FETCHLocked-down hosts1 turns off URL and feed reading.

Database

The schema is idempotent SQL in src/lib/db/schema.ts. It is applied automatically the first time the server touches the database, and can be applied ahead of time:

pnpm db:migrate

Do not rely on local files for production data. The embedded development database writes to .data/, which a serverless host discards.

Build and run

pnpm install
pnpm build
pnpm start

pnpm dev serves on port 34100, pnpm start on 34110.

Long runs and the worker

A run advances in slices of about 40 seconds, driven by the browser that started it. So that a run still finishes when that browser goes away, schedule a request to the worker route every minute or so:

GET /api/cron/runs
Authorization: Bearer <CRON_SECRET>

On Vercel, vercel.json already schedules /api/cron/runs; set CRON_SECRET and Vercel sends it as the bearer token. The schedule is every 30 minutes on purpose: each pass queries the database, and a small hosted database that is woken every few minutes never sleeps and uses up a free compute allowance. A run whose browser went away therefore finishes within half an hour; with a paid database the schedule can be tightened. On other hosts, any scheduler that can make an authenticated request works, or run one pass from a shell:

pnpm worker:once

The two routes that execute steps declare a 120-second limit: one slice can start a step up to its 40-second deadline, and a single AI call may then take up to 70 seconds. Make sure the host allows it.

Hosting notes

  • Serverless (Vercel and similar). Works with DATABASE_URL set. Without a database every function instance would have its own private memory and a run could vanish between two requests, so on Vercel a deployment without DATABASE_URL keeps no records at all: runs, sign-in and publishing answer with a clear "no database" state, while editing, validation, import and export keep working. The marketplace's community listings are cached for five minutes and refreshed on every change, so browsing does not query the database on each page view.
  • A long-lived Node server. Works as is. The embedded database can serve a single-instance demo, but PostgreSQL is still the supported production setup.
  • Rate limits and leases live in the database, so several instances can run side by side.

Before sharing a deployment

  1. pnpm check and pnpm build pass.
  2. pnpm verify:network passes against the RPC the deployment uses.
  3. Settings shows the database as durable and the providers you expect as ready.
  4. Run each template once, in no-AI mode and (if configured) in AI mode, and read the results.
  5. The worker route answers 401 without the secret and 200 with it.

Not covered

There is no payment configuration to do: paid execution is disabled in code. See Payment integration status.