Skip to main content

Source: ocean/docs/SETUP_DATABASE_PASSWORD.md | ✏️ Edit on GitHub

Setting Up Database Password

1. Set Database Password in Supabase

  1. Go to: https://supabase.com/dashboard/project/fldiayolmgphysdwgsuk/settings/database
  2. Click on "Reset database password"
  3. Generate a strong password or use your own
  4. IMPORTANT: Save this password securely - you'll need it for CLI and migrations

2. Add to Local Environment

Create or update .env.local:

# Supabase Database Password for CLI operations
SUPABASE_DB_PASSWORD=your_database_password_here

3. Add to Vercel Environment

  1. Go to: https://vercel.com/your-team/ocean/settings/environment-variables
  2. Add new variable:
    • Name: SUPABASE_DB_PASSWORD
    • Value: [your database password]
    • Environment: All environments (Production, Preview, Development)

4. Update .gitignore

Make sure .env.local is in .gitignore:

.env.local

5. Use with Supabase CLI

Once set up, you can use the password with CLI commands:

# Set as environment variable
export SUPABASE_DB_PASSWORD='your_password'

# Or use directly in commands
supabase db push --password $SUPABASE_DB_PASSWORD

# Or let it prompt and paste from clipboard
supabase db push

Benefits

  1. Automated Deployments: Can run migrations in CI/CD
  2. CLI Access: Full access to Supabase CLI commands
  3. Backup/Restore: Can backup and restore database
  4. Schema Management: Can manage database schema via migrations

Security Notes

  • Never commit the password to git
  • Use strong, unique password
  • Rotate periodically
  • Store securely in password manager