Skip to content
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 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 as a project dev dependency. This adds it to a single project rather than installing a global command:

1
npm install supabase --save-dev
2
# or: pnpm add -D supabase / yarn add -D supabase / bun add -D supabase

Pin the version in package.json so your whole team uses the same CLI version. Then run every command through your package runner:

1
npx supabase --help
2
# or: pnpm supabase / yarn supabase / bunx supabase

Beta channel#

Pre-release CLI builds ship from the development branch (X.Y.Z-beta.N versions). Use the npm beta dist-tag, or install supabase-beta via Homebrew / Scoop (separate packages from stable).

Install as a dev dependency:

1
npm install supabase@beta --save-dev

Or run without installing:

1
npx supabase@beta --help

Updating the Supabase CLI#

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

1
brew upgrade supabase

Beta channel:

1
brew upgrade supabase-beta

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 a local Supabase project#

The most common thing you'll do with the CLI is run the full Supabase stack (Postgres, Auth, Storage, and the rest) on your own machine. That stack runs in Docker containers, so you need a container runtime installed first. Follow the official guide to install and configure Docker Desktop on your machine.

Alternately, you can use a different container tool that offers Docker compatible APIs.

With a container runtime running, go to the folder where you want to create your project and initialize it:

1
supabase init

This creates a new supabase folder. It's safe to commit this folder to version control.

Now, from the same folder, start the Supabase stack:

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 stack, and a few additional images useful for local development (like a local SMTP server and a database diff tool).

Access your project's services#

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

1
Started supabase local development setup.
2
3
╭──────────────────────────────────────╮
4
│ 🔧 Development Tools │
5
├─────────┬────────────────────────────┤
6
│ Studio │ http://127.0.0.1:54323 │
7
│ Mailpit │ http://127.0.0.1:54324 │
8
│ MCP │ http://127.0.0.1:54321/mcp │
9
╰─────────┴────────────────────────────╯
10
11
╭──────────────────────────────────────────────────────╮
12
│ 🌐 APIs │
13
├────────────────┬─────────────────────────────────────┤
14
│ Project URL │ http://127.0.0.1:54321 │
15
│ REST │ http://127.0.0.1:54321/rest/v1 │
16
│ GraphQL │ http://127.0.0.1:54321/graphql/v1 │
17
│ Edge Functions │ http://127.0.0.1:54321/functions/v1 │
18
╰────────────────┴─────────────────────────────────────╯
19
20
╭───────────────────────────────────────────────────────────────╮
21
│ ⛁ Database │
22
├─────┬─────────────────────────────────────────────────────────┤
23
│ URL │ postgresql://postgres:postgres@127.0.0.1:54322/postgres │
24
╰─────┴─────────────────────────────────────────────────────────╯
25
26
╭──────────────────────────────────────────────────────────────╮
27
│ 🔑 Authentication Keys │
28
├─────────────┬────────────────────────────────────────────────┤
29
│ Publishable │ sb_publishable_... │
30
│ Secret │ sb_secret_... │
31
╰─────────────┴────────────────────────────────────────────────╯
1
# Default URL:
2
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

Telemetry#

The Supabase CLI collects telemetry data about general usage. Participating in this program is optional, and you can opt out at any time.

How to opt out#

You can disable telemetry by running:

1
supabase telemetry disable

You can check the current status and re-enable with:

1
supabase telemetry status
2
supabase telemetry enable

You can also opt out using the SUPABASE_TELEMETRY_DISABLED=1 environment variable. The broader DO_NOT_TRACK=1 convention is also respected.

Learn more#