Installation
Step-by-step guide to create your new project
Installation
Get your Stackbase project up and running in minutes.
Prerequisites
Before you begin, make sure you have the following installed on your system:
Node.js 24+
Download from nodejs.org
pnpm (Recommended)
Fast, disk space efficient package manager
Verify Your Installation
Check that Node.js is installed correctly:
node --version
# Should output: v20.x.x or higherWhile pnpm is recommended for its speed and efficiency, you can also use npm or bun. The CLI will detect your preferred package manager during setup.
Create Your Project
Option 1: Interactive Setup (Recommended)
Run the following command and follow the prompts:
pnpm dlx stackbase@latest initYou'll be asked:
- Project name - Enter your project name (e.g.,
my-saas-app) - Template - Choose between
base(full-stack),web(frontend-only), orapi(backend services) - Package manager - Choose between
pnpm,npm, orbun - Docker - Opt to include Dockerfile and Docker Compose configurations
- Kubernetes - Opt to include production Kubernetes manifests and Ingress rules (Docker required)
- Observability - Choose to include Prometheus and Grafana metrics monitoring stack
- Prisma Studio - Choose to include Prisma Studio for database management
The CLI will scaffold your selected template, configure environment files, and install all dependencies. This usually takes under a minute.
Option 2: Direct Installation
You can also specify non-interactive flags directly for rapid setups and CI/CD:
# Full-stack default project
pnpm dlx stackbase@latest init my-project -y
# Explicit feature flags with Bun
pnpm dlx stackbase@latest init my-app -t base -p bun --docker --obs --studioWhat Gets Created?
After scaffolding the base template, you'll have this complete structure:
my-project/
├── apps/
│ ├── web/ # Next.js frontend
│ ├── api/ # Express backend
│ ├── email/ # React Email preview server
│ └── studio/ # Prisma Studio database UI
├── packages/
│ ├── auth/ # Better Auth configuration
│ ├── contracts/ # Shared Zod validation contracts
│ ├── db/ # Prisma ORM & database migrations
│ ├── email/ # React Email components & templates
│ ├── logger/ # Pino structured logging
│ ├── rate-limit/ # API rate limiting
│ ├── storage/ # S3-compatible cloud object storage
│ ├── ui/ # shadcn/ui React components
│ └── utils/ # Shared utilities & helpers
├── package.json
├── turbo.json
└── pnpm-workspace.yamlPost-Installation Steps
1. Navigate to Your Project
cd my-project2. Open in Your Editor
code . # VS Code
# or
cursor . # Cursor3. Review the Files
Take a moment to explore:
README.md- Project overview and commandsturbo.json- Turborepo pipeline configurationpackage.json- Available scripts and dependencies
Environment Configuration
Before running the project, you need to configure environment variables. We'll cover this in detail in the next section.
Next: First Steps
Configure environment variables and run your project
Environment Variables Reference
Complete guide to all environment variables
Alternative Installation Methods
Clone the Repository
If you want to contribute or explore the source code:
# Clone the repository
git clone https://github.com/stackbase-labs/stackbase.git
# Navigate to the directory
cd stackbase
# Install dependencies
pnpm install
# Copy environment files
cp apps/web/.env.example apps/web/.env.local
cp apps/api/.env.example apps/api/.env.local
cp packages/db/.env.example packages/db/.env.localUse as Template
You can also use it as a GitHub template:
- Visit github.com/stackbase-labs/stackbase
- Click "Use this template"
- Create your repository
- Clone and install dependencies
Quick tip: Run pnpm dev from the root to start all applications
simultaneously. We'll cover this in detail in the next section.