DEV Community

Cover image for How To run Supabase locally
Sh Raj
Sh Raj

Posted on

How To run Supabase locally

To run Supabase locally, you don’t “download Supabase” like a normal app.
You run the Supabase local development stack using Docker + Supabase CLI.

Follow this exact step-by-step setup 👇


✅ Step 1 — Install Prerequisites

You must have:

1. Install Docker

Download from: https://www.docker.com/products/docker-desktop

Then start Docker Desktop.

Check:

docker --version
Enter fullscreen mode Exit fullscreen mode

2. Install Supabase CLI

Using npm (recommended for devs):

npm install -g supabase
Enter fullscreen mode Exit fullscreen mode

Check:

supabase --version
Enter fullscreen mode Exit fullscreen mode

✅ Step 2 — Initialize Supabase Project Locally

Go to your project folder:

mkdir my-supabase-app
cd my-supabase-app
Enter fullscreen mode Exit fullscreen mode

Now initialize:

supabase init
Enter fullscreen mode Exit fullscreen mode

This creates:

supabase/
   config.toml
Enter fullscreen mode Exit fullscreen mode

✅ Step 3 — Start Local Supabase

Now run:

supabase start
Enter fullscreen mode Exit fullscreen mode

This will:

✅ Pull Docker images
✅ Start local Postgres
✅ Start Auth
✅ Start Storage
✅ Start Realtime
✅ Start Studio

First time = takes few minutes.


✅ Step 4 — Open Supabase Studio (Local Dashboard)

After start you will see something like:

Studio URL: http://localhost:54323
API URL: http://localhost:54321
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Enter fullscreen mode Exit fullscreen mode

Open:

👉 http://localhost:54323

Now you have full Supabase dashboard locally 🎉


✅ Step 5 — Stop Supabase

When done:

supabase stop
Enter fullscreen mode Exit fullscreen mode

⭐ Very Important (Common Errors)

❌ Docker not running

Fix → Start Docker Desktop

❌ Port already used

Fix → change ports in:

supabase/config.toml
Enter fullscreen mode Exit fullscreen mode

❌ CLI not found

Fix → reinstall globally:

npm i -g supabase
Enter fullscreen mode Exit fullscreen mode

🚀 Pro Dev Tip (Next.js Integration)

If you are using Next.js, local .env example:

NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_local_key
Enter fullscreen mode Exit fullscreen mode

You can get keys from:

supabase status
Enter fullscreen mode Exit fullscreen mode

Top comments (0)