This guide covers how to install and set up Betterbase in your development environment.
Before installing Betterbase, ensure you have the following:
- Docker & Docker Compose - For running infrastructure services
- Bun (v1.0+) - The JavaScript runtime powering Betterbase
- Git - For version control
BetterBase requires Bun. Install it using one of the following methods:
# macOS/Linux (via curl)
curl -fsSL https://bun.sh/install | bash
# Windows (via PowerShell)
powershell -Command "irm bun.sh/install.ps1 | iex"
# Via npm
npm install -g bun
# Via brew
brew install bunVerify the installation:
bun --versionBetterBase uses Docker for local development infrastructure (PostgreSQL, MinIO, Inngest).
Install Docker Desktop for macOS/Windows, or on Linux:
# Ubuntu/Debian
curl -fsSL https://get.docker.com | sh
# Verify Docker
docker --version
docker compose versionVerify the installation:
bun --versionThe BetterBase CLI (bb) is your primary tool for managing projects and deployments.
# Install globally via Bun
bun add -g @betterbase/cli
# Verify installation
bb --versionAlternatively, install locally in your project:
# Add as dev dependency
bun add -D @betterbase/cli
# Run via npx
npx bb --versionOr add to your package.json scripts:
{
"scripts": {
"bb": "bb"
}
}Then run with bun run bb.
For backend development, install the core package:
bun add @betterbase/coreFor frontend development, install the client SDK:
bun add @betterbase/clientClone and set up the project:
# Clone the repository
git clone https://github.com/betterbase/betterbase.git
cd betterbase
# Install dependencies
bun install
# Start infrastructure (PostgreSQL, MinIO, Inngest)
docker compose up -d
# Start development server with hot-reload
bun run devThis creates the following project structure:
betterbase/
├── packages/
│ ├── core/ # Core framework
│ ├── cli/ # CLI tools
│ ├── client/ # Client SDK
│ ├── server/ # Server implementation
│ └── shared/ # Shared utilities
├── apps/
│ └── dashboard/ # Admin dashboard
├── docker-compose.yml # Local development services
└── docs/ # Documentation
For the simplest setup, start infrastructure services with Docker:
# Start PostgreSQL, MinIO, and Inngest
docker compose up -d
# Run the server locally (with hot-reload)
bun run devYour API will be available at http://localhost:3001.
See Docker Setup Guide for detailed instructions.
Set up environment variables for production:
# Database
DATABASE_URL=postgresql://user:password@host:5432/db
# Authentication - Generate: openssl rand -base64 32
AUTH_SECRET=your-secret-key-min-32-chars
AUTH_URL=https://your-domain.com
# Storage (optional - uses MinIO by default)
STORAGE_PROVIDER=s3
STORAGE_BUCKET=your-bucket
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secretSee the Configuration Guide for all available options.
Once Docker services are running and the server is started:
# Check Docker services are healthy
docker compose ps
# Check the server is running
curl http://localhost:3001/healthYou should see:
- Docker services:
postgres,minio,inngest- all running - Server health check: returns successful response
Available endpoints:
http://localhost:3001- API roothttp://localhost:3001/graphql- GraphQL playgroundhttp://localhost:3001/api/auth/*- Auth endpointshttp://localhost:3001/storage/*- Storage endpoints
- Quick Start Guide - Get running in 5 minutes
- Your First Project - Build a complete application
- Configuration - Customize your setup
- Docker Setup Guide - Detailed Docker configuration