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-orm
npm install stabilize-orm

Install the CLI

The Stabilize CLI provides powerful code generation and migration tools:

bun add -d stabilize-cli
npm install -D stabilize-cli

Verify Installation

Check that everything is installed correctly:

bunx stabilize-cli --version

You 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:

PostgreSQLMySQL / MariaDBSQLiteSQL Server
  • pg for PostgreSQL and mysql2 for MySQL — bundled dependencies, not native Bun modules
  • bun:sqlite on Bun or node:sqlite on 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.
  • mssql for SQL Server
  • ioredis if 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 mongodb

Next Steps

Now that you have Stabilize installed, you can:

  • Configure your database connection
  • Define your first model
  • Run migrations
  • Start querying your data