Local Development

Supabase CLI

Develop locally, deploy to the Supabase Platform, and set up CI/CD workflows


The Supabase CLI enables you to run the entire Supabase stack locally, on your machine or in a CI environment. With just two commands, you can set up and start a new local project:

  1. supabase init to create a new local project
  2. supabase start to launch the Supabase services

Installing the Supabase CLI

Install the CLI with Homebrew:


_10
brew install supabase/tap/supabase

Updating the Supabase CLI

When a new version is released, you can update the CLI using the same methods.


_10
brew upgrade supabase

If you have any Supabase containers running locally, stop them and delete their data volumes before proceeding with the upgrade. This ensures that Supabase managed services can apply new migrations on a clean state of the local database.

Running Supabase locally

The Supabase CLI uses Docker containers to manage the local development stack. Follow the official guide to install and configure Docker Desktop:

Inside the folder where you want to create your project, run:


_10
supabase init

This will create a new supabase folder. It's safe to commit this folder to your version control system.

Now, to start the Supabase stack, run:


_10
supabase start

This takes time on your first run because the CLI needs to download the Docker images to your local machine. The CLI includes the entire Supabase toolset, and a few additional images that are useful for local development (like a local SMTP server and a database diff tool).

Access your project's services

Once all of the Supabase services are running, you'll see output containing your local Supabase credentials. It should look like this, with urls and keys that you'll use in your local project:


_10
_10
Started supabase local development setup.
_10
_10
API URL: http://localhost:54321
_10
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
_10
Studio URL: http://localhost:54323
_10
Inbucket URL: http://localhost:54324
_10
anon key: eyJh......
_10
service_role key: eyJh......


_10
# Default URL:
_10
http://localhost:54323

The local development environment includes Supabase Studio, a graphical interface for working with your database.

Local Studio

Stopping local services

When you are finished working on your Supabase project, you can stop the stack (without resetting your local database):


_10
supabase stop

Learn more