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:
supabase init
to create a new local projectsupabase start
to launch the Supabase services
Installing the Supabase CLI
Install the CLI with Homebrew:
_10brew install supabase/tap/supabase
Updating the Supabase CLI
When a new version is released, you can update the CLI using the same methods.
_10brew 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.
Backup and stop running containers
Remember to save any local schema and data changes before stopping because the --no-backup
flag will delete them.
_10supabase db diff my_schema_10supabase db dump --local --data-only > supabase/seed.sql_10supabase stop --no-backup
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:
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)
Inside the folder where you want to create your project, run:
_10supabase 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:
_10supabase 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_10Started 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......_10service_role key: eyJh......
_10# Default URL:_10http://localhost:54323
The 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):
_10supabase stop