Skip to content
Local Development

Local Development & CLI

Learn how to develop locally and use the Supabase CLI

To develop your applications using the locally running Supabase stack, you'll need to install the Supabase CLI and a container runtime.

Quickstart#

  1. Install the Supabase CLI:

    npm install supabase --save-dev
  2. In your repo, initialize the local Supabase project:

    npx supabase init
  3. Start the local Supabase stack:

    npx supabase start
  4. View your local Supabase instance at http://localhost:54323.

Local development#

Local development with Supabase allows you to work on your projects in a self-contained environment on your local machine. Working locally has several advantages:

  1. Faster development: You can make changes and see results instantly without waiting for remote deployments.
  2. Offline work: You can continue development even without an internet connection.
  3. Cost-effective: Local development is free and doesn't consume your project's quota.
  4. Enhanced privacy: Sensitive data remains on your local machine during development.
  5. Safe testing: You can experiment with different configurations and features without affecting your production environment.

Once set up, you can initialize a new Supabase project, start the local stack, and begin developing your application using local Supabase services. This includes access to a local Postgres database, Auth, Storage, and other Supabase features.

With the default ports, supabase start runs one local project per machine. To run a local project for each app or git worktree at the same time, use the experimental supabase stack commands described in Running multiple local projects.

CLI#

The Supabase CLI is a tool that enables developers to run Supabase services locally and manage hosted projects directly from the terminal. It provides a suite of commands for various tasks, including:

With the CLI, you can streamline your development workflow, automate repetitive tasks, and maintain consistency across different environments. It's an essential tool for both local development and CI/CD pipelines.

See the CLI Getting Started guide for more information.