What is the Supabase CLI?
The Supabase CLI allows you to:- Run Supabase locally: Develop your project entirely on your local machine using Docker containers
- Manage database migrations: Track and version your database schema changes with migration files
- Generate TypeScript types: Automatically create type definitions from your database schema
- Deploy to production: Push your local changes to the Supabase Platform
- Set up CI/CD workflows: Integrate Supabase into your automated testing and deployment pipelines
The CLI uses Docker containers to manage the local development stack, so you’ll need Docker Desktop or a compatible container runtime installed.
Key Features
Local Development Stack
With just two commands, you can set up and start a complete local Supabase environment:- PostgreSQL database: Full Postgres instance with extensions
- Studio: Web-based database management interface
- API Gateway: Kong-based gateway for REST, Realtime, Storage, and Auth
- PostgREST: Automatic REST API from your database schema
- GoTrue: Authentication and user management
- Realtime: WebSocket-based subscriptions
- Storage: Object storage for files
- Mailpit: Email testing interface for auth emails
Database Migration Management
The CLI provides a complete migration workflow:Learn More
Explore database migration workflows and best practices
Type Generation
Automatically generate TypeScript types from your database schema:Testing and Linting
The CLI includes tools for testing and linting your database:Quick Start
Get started with the Supabase CLI in minutes:Installation Guide
View detailed installation instructions for all platforms
Available Services
When you runsupabase start, you’ll see output with URLs and credentials for all services:
Studio
Access at
http://localhost:54323 for visual database managementAPI Gateway
Access at
http://localhost:54321 for REST, Realtime, Storage, and AuthDatabase
Connect via
postgresql://postgres:postgres@localhost:54322/postgresMailpit
Access at
http://localhost:54324 to test authentication emailsCommon Commands
Here are the most commonly used CLI commands:| Command | Description |
|---|---|
supabase init | Initialize a new project |
supabase start | Start local Supabase services |
supabase stop | Stop local services |
supabase status | Show status of local services |
supabase migration new <name> | Create a new migration file |
supabase migration up | Apply pending migrations |
supabase db diff | Generate migration from schema changes |
supabase db reset | Reset database and reapply migrations |
supabase db push | Push migrations to remote database |
supabase login | Authenticate with Supabase Platform |
supabase link | Link to a remote project |
Next Steps
Installation
Install the CLI on your platform
Local Development
Set up your local development environment
Migrations
Learn how to manage database migrations
Deployment
Deploy your project to production
Resources
CLI Reference
Complete CLI command reference
GitHub Repository
View the source code and contribute
GitHub Action
Integrate with GitHub Actions
Community Support
Get help from the community
