Get started
The default Orez path runs a complete Zero development backend without Docker, a separately installed Postgres server, or native compilation.
Install and run
Add Zero to the application and Orez as a development dependency:
bun add @rocicorp/zero
bun add -D orez
bunx orez
Orez starts PGlite and its PostgreSQL compatibility layer, then starts stock zero-cache with its SQLite replica. The admin server provides logs and lifecycle controls. Startup output reports the resolved ports.
| Service | Default address |
|---|---|
| PostgreSQL | postgresql://user:password@127.0.0.1:6434/postgres |
| zero-cache | http://localhost:5849 |
| Orez admin | http://localhost:6477 |
Connect the client
Point the existing Zero client at the zero-cache URL:
import { Zero } from '@rocicorp/zero'
import { schema } from './schema'
export const zero = new Zero({
schema,
userID: 'development-user',
cacheURL: 'http://localhost:5849',
})
Your schema, queries, mutators, optimistic updates, and local Zero store remain normal Zero application code.
Add migrations and endpoints
Create orez.config.ts:
import { defineConfig } from 'orez'
export default defineConfig({
migrations: './db/migrations',
zeroMutateUrl: 'http://localhost:3000/api/zero/push',
zeroQueryUrl: 'http://localhost:3000/api/zero/pull',
onHealthy: 'bun run dev',
})
The CLI loads the file automatically. Command-line flags take precedence when a one-off run needs different values.
Pick a Node profile
The default PGlite/WASM profile is best for ordinary local development and CI. It avoids native builds and uses emulated logical replication.
Install embedded-postgres and use Embedded Postgres when you need multiple real PostgreSQL connections and stock logical replication:
bun add -D embedded-postgres
bunx orez --backend=postgres
Both profiles use the same CLI, config, hooks, admin surface, and Zero client setup.
Next
- Read the full Node setup for migrations, hooks, and disposable CI.
- See Configuration and CLI for every setting.
- Read Node architecture for the process and storage boundaries.