apps/docs/content/guides/local-development.mdx
To develop your applications using the locally running Supabase stack, you'll need to install the Supabase CLI and a container runtime.
<Admonition type="note">A container manager compatible with Docker APIs is a prerequisite:
Pick an install method and use the same tab in every step below. Homebrew gives you a global supabase command. npm, pnpm, and yarn install the CLI into your project as a dev dependency, so you run it through your package runner (npx supabase, pnpm supabase, or yarn supabase). See Install and run the CLI for details.
Install the Supabase CLI:
<Tabs scrollable size="small" type="underlined" defaultActiveId="npm" queryGroup="package-manager"><TabPanel id="npm" label="npm">
npm install supabase --save-dev
</TabPanel><TabPanel id="yarn" label="yarn">
NODE_OPTIONS=--no-experimental-fetch yarn add supabase --dev
</TabPanel><TabPanel id="pnpm" label="pnpm">
pnpm add supabase --save-dev --allow-build=supabase
The --allow-build=supabase flag is required on pnpm version 10 or higher. If you're using an older version of pnpm, omit this flag.
</TabPanel><TabPanel id="brew" label="brew">
brew install supabase/tap/supabase
</TabPanel></Tabs>
In your repo, initialize the local Supabase project:
<Tabs scrollable size="small" type="underlined" defaultActiveId="npm" queryGroup="package-manager"><TabPanel id="npm" label="npm">
npx supabase init
</TabPanel><TabPanel id="yarn" label="yarn">
yarn supabase init
</TabPanel><TabPanel id="pnpm" label="pnpm">
pnpm supabase init
</TabPanel><TabPanel id="brew" label="brew">
supabase init
Start the local Supabase stack:
<Tabs scrollable size="small" type="underlined" defaultActiveId="npm" queryGroup="package-manager"><TabPanel id="npm" label="npm">
npx supabase start
</TabPanel><TabPanel id="yarn" label="yarn">
yarn supabase start
</TabPanel><TabPanel id="pnpm" label="pnpm">
pnpm supabase start
</TabPanel><TabPanel id="brew" label="brew">
supabase start
View your local Supabase instance at http://localhost:54323.
If your local development machine is connected to an untrusted public network, you should create a separate Docker network and bind to 127.0.0.1 before starting the local development stack. This restricts network access to only your localhost machine.
docker network create -o 'com.docker.network.bridge.host_binding_ipv4=127.0.0.1' local-network
npx supabase start --network-id local-network
You should never expose your local development stack publicly.
</Admonition>Local development with Supabase allows you to work on your projects in a self-contained environment on your local machine. Working locally has several advantages:
Once set up, you can initialize a new Supabase project, start the local stack, and begin developing your application using local Supabase services. This includes access to a local Postgres database, Auth, Storage, and other Supabase features.
The Supabase CLI is a tool that enables developers to run Supabase services locally and manage hosted projects directly from the terminal. It provides a suite of commands for various tasks, including:
With the CLI, you can streamline your development workflow, automate repetitive tasks, and maintain consistency across different environments. It's an essential tool for both local development and CI/CD pipelines.
See the CLI Getting Started guide for more information.