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:

1
brew install supabase/tap/supabase

Updating the Supabase CLI

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

1
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:

1
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:

1
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:

1
2
3
4
5
6
7
8
Started supabase local development setup. API URL: http://localhost:54321 DB URL: postgresql://postgres:postgres@localhost:54322/postgres Studio URL: http://localhost:54323 Inbucket URL: http://localhost:54324 anon key: eyJh......service_role key: eyJh......
1
2
# Default URL: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):

1
supabase stop

Learn more