Skip to main content

How to install supabase cli

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

You can install the Supabase CLI using a variety of package managers, including npm, Homebrew, and Scoop, depending on your operating system. The CLI is a powerful tool that allows you to manage database migrations, develop locally, and deploy your project.


Prerequisites

Before you install the CLI, you must have a container runtime that is compatible with Docker APIs, such as Docker Desktop, Rancher Desktop, or Podman. The Supabase local development environment relies on Docker to run all the necessary services.

Installation Methods

npm (Node.js Package Manager)

This is the recommended method for most developers using JavaScript/TypeScript.

  1. Open your terminal or command prompt.

  2. Install the CLI as a development dependency in your project:

    npm install supabase --save-dev

    Alternatively, you can install it globally to use the supabase command directly, but using npx with a local install is often preferred to ensure version consistency.

  3. When installed locally, you must prefix each command with npx. For example, npx supabase init.

Homebrew (macOS)

Homebrew is the standard package manager for macOS and provides a simple way to install and manage the Supabase CLI.

  1. Open your terminal.

  2. Install the CLI with the following command:

    brew install supabase/tap/supabase

Scoop (Windows)

Scoop is a command-line installer for Windows.

  1. If you haven't already, install Scoop by running the following command in PowerShell:

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
  2. Add the Supabase bucket to Scoop:

    scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
  3. Install the Supabase CLI:

    scoop install supabase

Post-Installation

After installing the CLI, you can verify it's working by checking the version.

supabase --version

Once installed, you can start using commands like supabase init to create a new project and supabase start to run a local Supabase stack.


How to Run Supabase Project Locally with Supabase CLI and Docker This video provides a step-by-step guide on how to install and set up the Supabase CLI with Docker for local development.