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.
| Variable | Needed for | Notes |
|---|---|---|
DATABASE_URL | Durable records | postgres://…. Without it, development uses an embedded database in .data/, and production keeps records in memory only. |
ANTHROPIC_API_KEY | AI steps | See Provider setup. |
RING_AI_GATEWAY | AI steps on Vercel without a key | vercel. |
RING_AI_MODEL, RING_AI_EFFORT, RING_AI_FALLBACKS | Tuning | Defaults are fine. |
RING_AI_PRICE_INPUT_PER_MTOK, RING_AI_PRICE_OUTPUT_PER_MTOK | Price override | USD per million tokens. |
ELYSIUM_RPC_URL | A dedicated RPC | Defaults to the public RPC. |
RING_AI_DAILY_CAP_USD, RING_MAX_RUN_BUDGET_USD | A public deployment | A shared daily ceiling on AI spend and a per-run budget ceiling. See Provider setup. |
CRON_SECRET | The scheduled worker | Without it the worker route is closed. |
RING_OPERATOR_ADDRESSES | Hiding listings | Comma-separated wallet addresses. |
NEXT_PUBLIC_SITE_URL | Correct social preview URLs | The public origin, for example https://example.org. |
RING_DISABLE_WEB_FETCH | Locked-down hosts | 1 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_URLset. 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 withoutDATABASE_URLkeeps 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
pnpm checkandpnpm buildpass.pnpm verify:networkpasses against the RPC the deployment uses.- Settings shows the database as durable and the providers you expect as ready.
- Run each template once, in no-AI mode and (if configured) in AI mode, and read the results.
- The worker route answers
401without the secret and200with it.
Not covered
There is no payment configuration to do: paid execution is disabled in code. See Payment integration status.