Supabase Local Development
Complete guide to run Supabase locally with Docker and connect it to your Next.js application
Creates a supabase/ folder for migrations, seed, and config.
Pulls Docker images and boots Postgres, Auth, Realtime, Storage, and Studio.
http://127.0.0.1:54321http://127.0.0.1:54323127.0.0.1:54322Create .env.local in your project root:
Copy the actual keys from the supabase start output. Restart your dev server after adding these variables.
Create Migration
Apply Changes
Stop old containers, then supabase stop → docker ps -a
Confirm table has a policy for anon when reading
Ensure idempotent SQL; test with supabase db reset
Custom Ports
Environment Variables
You can customize database settings, enable/disable services, and configure authentication by editing the supabase/config.toml file.
Start Local Stack
Begin your development session with supabase start
Make Schema Changes
Create migrations for database changes: supabase migration new feature_name
Test Changes
Apply migrations and test your application locally
Commit & Push
Commit your migration files and push to your repository
Resource Usage
Logs & Debugging
supabase logs - View service logsdocker logs - Container logsKeep all API keys in .env.local
Implement proper row-level security