Installation
Get started with Stabilize ORM in your Bun or Node.js project
Prerequisites
- Bun 1.0 or higher, or Node.js 22.13 or higher — one of the two
- PostgreSQL, MySQL, SQLite, SQL Server, or MongoDB database
- TypeScript project (recommended)
Install
There is one published package, not one per runtime. Install it with whichever package manager your project already uses:
bun add stabilize-ormnpm install stabilize-ormInstall the CLI
The Stabilize CLI provides powerful code generation and migration tools:
bun add -d stabilize-clinpm install -D stabilize-cliVerify Installation
Check that everything is installed correctly:
bunx stabilize-cli --versionYou should see the version number of the CLI tool.
Database Drivers
The drivers for the four SQL dialects are dependencies of stabilize-orm itself, so there is nothing extra to install for them:
pgfor PostgreSQL andmysql2for MySQL — bundled dependencies, not native Bun modulesbun:sqliteon Bun ornode:sqliteon Node.js for SQLite — the one driver that is built into the runtime. Which one is used is decided at run time, so the same code works on either.mssqlfor SQL Serverioredisif you enable Redis-backed caching
MongoDB is the exception. Its driver is an optional dependency rather than a bundled one, so it is installed alongside the ORM — and a MongoDB client without it fails with MONGO_DRIVER_MISSING on the first statement, not at import time. See MongoDB for what else the backend changes.
bun add mongodbNext Steps
Now that you have Stabilize installed, you can:
- Configure your database connection
- Define your first model
- Run migrations
- Start querying your data