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:
supabase initto create a new local projectsupabase startto launch the Supabase services
There are two ways to install the CLI, and they change the command you type:
- Project dependency with
npm,pnpm, oryarninstalls the CLI into a single project (there is no globalsupabasecommand with this method). Run it through your package runner instead, for examplenpx supabase <command>. - Global install with Homebrew, Scoop, or Linux packages. Run commands as
supabase <command>.
Either way, the CLI is project-scoped: most commands (including start) expect to run inside a directory that has been initialized with supabase init, which creates the supabase/ folder and config.toml. Run init first, then the other commands from the same directory.
The rest of this page writes examples as supabase <command>; translate them to npx supabase <command> if you installed the CLI as a project dependency.
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:
1npm install supabase --save-dev2# or: pnpm add -D supabase / yarn add -D supabase / bun add -D supabasePin the version in package.json so your whole team uses the same CLI version. Then run every command through your package runner:
1npx supabase --help2# or: pnpm supabase / yarn supabase / bunx supabaseThe Supabase CLI requires Node.js 20 or later when run via npx or npm. Older Node.js versions, such as 16, are not supported and fail to start the CLI.
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:
1npm install supabase@beta --save-devOr run without installing:
1npx supabase@beta --helpUpdating the Supabase CLI#
When a new version is released, you can update the CLI using the same channels.
1brew upgrade supabaseBeta channel:
1brew upgrade supabase-betaIf 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.
Backup and stop running containers
Remember to save any local schema and data changes before stopping because the --no-backup flag will delete them.
1supabase db diff -f my_schema2supabase db dump --local --data-only > supabase/seed.sql3supabase stop --no-backupRunning 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.
- Rancher Desktop (macOS, Windows, Linux)
- Podman (macOS, Windows, Linux)
- OrbStack (macOS)
- colima (macOS)
With a container runtime running, go to the folder where you want to create your project and initialize it:
1supabase initThis creates a new supabase folder. It's safe to commit this folder to version control.
Now, from the same folder, start the Supabase stack:
1supabase startIf you installed the CLI as a project dependency (npm, pnpm, yarn, or bun), run these as npx supabase init and npx supabase start instead. See the note above.
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:
1Started supabase local development setup.23╭──────────────────────────────────────╮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╰─────────┴────────────────────────────╯1011╭──────────────────────────────────────────────────────╮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╰────────────────┴─────────────────────────────────────╯1920╭───────────────────────────────────────────────────────────────╮21│ ⛁ Database │22├─────┬─────────────────────────────────────────────────────────┤23│ URL │ postgresql://postgres:postgres@127.0.0.1:54322/postgres │24╰─────┴─────────────────────────────────────────────────────────╯2526╭──────────────────────────────────────────────────────────────╮27│ 🔑 Authentication Keys │28├─────────────┬────────────────────────────────────────────────┤29│ Publishable │ sb_publishable_... │30│ Secret │ sb_secret_... │31╰─────────────┴────────────────────────────────────────────────╯1# Default URL:2http://localhost:54323The local development environment includes Supabase Studio, a graphical interface for working with your database.

Stopping local services#
When you are finished working on your Supabase project, you can stop the stack (without resetting your local database):
1supabase stopTelemetry#
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:
1supabase telemetry disableYou can check the current status and re-enable with:
1supabase telemetry status2supabase telemetry enableYou can also opt out using the SUPABASE_TELEMETRY_DISABLED=1 environment variable. The broader DO_NOT_TRACK=1 convention is also respected.