Connect Sovrium to PostgreSQL
Sovrium runs on an embedded SQLite database out of the box. When you need concurrent writers, replication, or a managed database, point it at PostgreSQL — no config change, just one environment variable.
Set DATABASE_URL
export DATABASE_URL="postgres://user:password@db.example.com:5432/mydb"
sovrium start app.ts
When DATABASE_URL is set, Sovrium selects the Postgres engine, connects, and applies your schema inside a transaction on boot. Unset it and Sovrium falls back to the zero-config SQLite default.
Verify
The startup summary prints the active engine:
✓ Database: PostgreSQL (db.example.com/mydb)
Next
- Database Infrastructure — how the dual-dialect engine picks SQLite vs Postgres.
- Schema Migrations — the boot-time migration that runs on connect.
- Deploy with Docker Compose and PostgreSQL — run both as one stack.
Last updated July 21, 2026
This documentation was written with Claude Fable 5 (Anthropic), so errors or outdated content are possible. Sovrium is in beta — contributions and corrections are welcome.