The Postgres database behind Sora UI's sign-in and bookmarks — recommended hosting, environment variables, and Drizzle migrations.
Sora UI's documentation site keeps sign-in sessions and bookmarks in a Postgres database. The schema and client live in packages/db, built on Drizzle ORM and postgres.js.
You only need a database if you enable auth. Browsing the docs, blog,
catalog, and registry works with zero environment variables. Set
NEXT_PUBLIC_ENABLE_AUTH="true" to turn on sign-in and bookmarks.
Sponsored by Neon
Sora UI's production database runs on Neon — serverless Postgres with branching, autoscaling, and scale-to-zero. Neon sponsors Sora UI's infrastructure.
Neon is the provider we recommend for self-hosting Sora UI. It fits the way this app talks to Postgres:
Neon gives you two URLs for the same database. They differ only by the -pooler suffix in the hostname:
| Use | Variable | Hostname |
|---|---|---|
| Runtime (pooled) | DATABASE_URL | ep-xxx-pooler.<region>.aws.neon.tech |
| Migrations (direct) | DATABASE_URL_DIRECT | ep-xxx.<region>.aws.neon.tech |
Both use port 5432 and require sslmode=require:
Copy both URLs from the Neon console with the Connect button. Enable
Connection pooling for DATABASE_URL, then disable it for
DATABASE_URL_DIRECT.
The Neon CLI can pull the pooled and direct URLs as DATABASE_URL and
DATABASE_URL_UNPOOLED:
This project uses DATABASE_URL_DIRECT instead of Neon's
DATABASE_URL_UNPOOLED name, so copy the unpooled value into
DATABASE_URL_DIRECT in apps/www/.env.
Set these in apps/www/.env:
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_ENABLE_AUTH | Yes, for auth | Set to "true" to enable sign-in and bookmarks |
DATABASE_URL | Yes, for auth | Pooled Postgres URL used at runtime |
DATABASE_URL_DIRECT | Only for migrations | Direct Postgres URL used by drizzle-kit |
Schema lives in packages/db/src/schema. Run migrations from the package root:
drizzle-kit prefers DATABASE_URL_DIRECT and falls back to DATABASE_URL. Always give it a direct connection — running migrations through a transaction-mode pooler fails in confusing ways.
Other schema commands:
Any Postgres provider works — the schema is plain Postgres, and the client connects with prepare: false so it stays compatible with transaction-mode poolers (Neon's -pooler endpoint, Supabase's port 6543).
Point DATABASE_URL at a pooled endpoint and DATABASE_URL_DIRECT at a direct one, then apply the migrations above.
Performance & Bundle Size
Optimize bundle size, initial load times, and Core Web Vitals when building with Sora UI and Motion.
MCP
Connect the Sora UI docs MCP server to Cursor and other AI clients.
Built by Axyl. A motion-first component registry for React.
Last updated: 10/21/2026
Help keep SoraLabs moving.
Every contribution helps us build and maintain open-source tools for the community.
Sponsor on GitHub