Skip to main content

Self-Hosted vs Cloud Supabase for SaaS

·StarterPick Team
supabaseself-hostedinfrastructuresaas-boilerplatepostgres2026

TL;DR

Start with Supabase Cloud. Switch to self-hosted only when you have a specific reason. The most common reasons: your Supabase cloud bill exceeds $200/month (self-hosting becomes cost-competitive), you need full data sovereignty (GDPR, HIPAA, enterprise contracts), or you need features unavailable on cloud (custom Postgres extensions). Most SaaS products should stay on cloud. Here's the complete cost and complexity comparison.

Key Takeaways

  • Supabase Cloud Pro: $25/month/project — handles everything, zero maintenance
  • Self-hosted: free software, but $30-80/month VPS + significant DevOps work
  • Break-even: self-hosting becomes cost-competitive around $150-200/month cloud spend
  • Data sovereignty: self-hosted wins for GDPR, HIPAA, SOC2 requirements
  • Performance: self-hosted can be faster (VPS closer to your users)
  • Maintenance cost: 2-4 hours/month minimum for updates, backups, monitoring

Supabase Cloud: What You Get

Supabase Cloud Free ($0):
  → 2 projects
  → 500MB database
  → 5GB bandwidth/month
  → 1GB file storage
  → Project PAUSED after 1 week inactivity
  → Community support only

Supabase Cloud Pro ($25/month/project):
  → No project pausing
  → 8GB database (then $0.125/GB)
  → 250GB bandwidth (then $0.09/GB)
  → 100GB storage (then $0.021/GB)
  → Daily backups (7-day retention)
  → Email support
  → 99.9% uptime SLA

Supabase Team ($599/month):
  → Unlimited projects (Pro tier each)
  → Point-in-time recovery
  → SOC2 compliant
  → Priority support
  → SSO for Supabase Dashboard

The Pro plan is a deal. $25/month for hosted Postgres + Auth + Storage + Edge Functions + Realtime is extremely competitive with building the equivalent infrastructure yourself.


Self-Hosted Supabase: What's Involved

Supabase is fully open source. You can run the entire stack:

# Clone and start self-hosted Supabase:
git clone https://github.com/supabase/supabase
cd supabase/docker
cp .env.example .env

# Configure .env:
POSTGRES_PASSWORD=your-super-secret-password
JWT_SECRET=your-super-secret-jwt-token-at-least-32-characters
ANON_KEY=<generate with JWT tool>
SERVICE_ROLE_KEY=<generate with JWT tool>
DASHBOARD_USERNAME=admin
DASHBOARD_PASSWORD=your-dashboard-password
SMTP_HOST=smtp.resend.com
SMTP_PORT=465
SMTP_USER=resend
SMTP_PASS=your-resend-api-key
SMTP_SENDER_NAME="Your App"
SMTP_ADMIN_EMAIL=admin@yourdomain.com

docker compose up -d

What runs in Docker Compose:

  • PostgreSQL (the database)
  • Supabase Studio (dashboard UI)
  • Kong (API gateway)
  • GoTrue (auth service)
  • PostgREST (REST API from Postgres)
  • Realtime (WebSocket server)
  • Storage API (S3-compatible file storage)
  • Edge Functions (Deno runtime)
  • Supavisor (connection pooler)

The Real Cost of Self-Hosting

Infrastructure Costs

Minimal setup (1 VPS):
  DigitalOcean Droplet 4vCPU/8GB RAM: $48/month
  Object storage (Backblaze B2): $6/month for 1TB
  Backup storage: $3/month
  Domain/SSL: ~$1/month
  Total: ~$58/month

Better setup (database + app separated):
  Database VPS (Hetzner CX31): €13/month (~$14)
  App VPS: €9/month (~$10)
  Object storage: $6/month
  Total: ~$30/month (EU)

Production setup (HA, backups, monitoring):
  Primary DB (4 core, 16GB RAM): $80/month
  Replica DB: $40/month
  Backups: $10/month
  Monitoring (Grafana cloud): $0 free tier
  Total: ~$130/month

Time Costs (Hidden)

This is what most self-hosting comparisons miss:

Initial setup:        4-8 hours
Monthly maintenance:  2-4 hours (updates, monitoring, occasional issues)
Incident response:    2-8 hours/incident
Schema migrations:    Same as cloud (no difference)
Backup verification:  1 hour/month

First year total:     48-96 hours of DevOps work
At $100/hour rate:   $4,800-9,600 in engineer time

Self-hosting "saves" $25-200/month
But costs $400-800/year in hidden DevOps time

Cost Comparison by Scale

Monthly users / dataSupabase CloudSelf-hosted (infrastructure)Self-hosted (total w/ time)
< 1,000 users / 1GB$25/month$30-60/month$160-280/month
10,000 users / 10GB$27/month$30-60/month$160-280/month
50,000 users / 50GB$31/month$60-130/month$180-340/month
200,000 users / 200GB$50-80/month$80-200/month$200-400/month
1M users / 1TB$150-250/month$200-400/month$350-600/month

Takeaway: self-hosting becomes cost-competitive around 200K+ users or when your data exceeds 200GB. For most early-stage SaaS, Supabase Cloud is cheaper when you count engineer time.


When Self-Hosting IS the Right Call

Reason 1: Data Sovereignty

HIPAA (US healthcare):
  → Must not send patient data to third-party processors without BAA
  → Supabase Cloud: BAA available on Team plan ($599/month)
  → Self-hosted: you control all data, no BAA needed with Supabase

GDPR (EU strict interpretation):
  → Some legal teams require data to never leave your servers
  → Supabase Cloud EU region (Frankfurt): satisfies most GDPR requirements
  → BUT some enterprise customers contractually require "data stays on our VPS"
  → Self-hosted: satisfies these requirements

Defense / Government:
  → Air-gapped environments
  → Security clearance requirements
  → No cloud permitted — self-hosted is the only option

Reason 2: Enterprise Contracts

When enterprise customers ask:

  • "Where is our data stored?"
  • "Can we audit your data infrastructure?"
  • "Do you offer a dedicated instance?"

Self-hosting answers all three. You can host a dedicated Supabase instance for each enterprise customer on their preferred cloud or data center.

Reason 3: Custom Postgres Extensions

-- Some extensions not available on Supabase Cloud:
CREATE EXTENSION pg_cron;        -- Built-in Postgres cron (cloud: restricted)
CREATE EXTENSION pg_net;         -- HTTP calls from Postgres (cloud: restricted)
CREATE EXTENSION timescaledb;    -- Time-series data (not on Supabase Cloud)
CREATE EXTENSION citus;          -- Horizontal sharding (not on Supabase Cloud)
CREATE EXTENSION plv8;           -- JavaScript in Postgres (cloud: restricted)

If your data model requires TimescaleDB for time-series or Citus for horizontal sharding, self-hosting is the only option with Supabase.

Reason 4: Cost at Very Large Scale

At 1M active users with 1TB data:
  Supabase Cloud Pro: ~$150-250/month
  Self-hosted (3-server HA): ~$200-300/month infrastructure
  + 2-4 hours/month maintenance

At 10M users with 5TB data:
  Supabase Cloud: $500-1,000/month
  Self-hosted (robust infrastructure): $400-800/month
  + 4-8 hours/month maintenance

Above $500/month cloud → worth evaluating self-hosted

Setting Up Self-Hosted for Production

A production-ready self-hosted setup needs more than docker compose up:

# docker-compose.production.yml additions:
services:
  db:
    image: supabase/postgres:15.8.1.060
    volumes:
      - ./data/postgres:/var/lib/postgresql/data:Z
    restart: always
    # RAM allocation:
    deploy:
      resources:
        limits:
          memory: 8G

  # Add automatic backups:
  backup:
    image: ghcr.io/adrienpoupa/rclone-backup:latest
    environment:
      CRON: "0 3 * * *"    # 3am daily
      SOURCE: /data/postgres
      DESTINATION: b2:your-bucket/postgres-backups
    volumes:
      - ./data/postgres:/data/postgres:ro
    restart: always

Reverse proxy + SSL (Caddy):

# Caddyfile — automatic HTTPS:
supabase.yourdomain.com {
  reverse_proxy kong:8000
}

Monitoring:

# Add to docker-compose.yml:
  prometheus:
    image: prom/prometheus:latest
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    ports:
      - "9090:9090"

  grafana:
    image: grafana/grafana-oss:latest
    ports:
      - "3001:3000"
    volumes:
      - grafana-data:/var/lib/grafana

Migration Path: Cloud → Self-Hosted

If you start on cloud and need to migrate:

# Export from Supabase Cloud:
# 1. Database dump:
pg_dump "postgresql://postgres.[ref]:[password]@db.[ref].supabase.co:5432/postgres" \
  --no-acl --no-owner \
  -f supabase-backup.sql

# 2. Storage files:
supabase storage download --bucket-name your-bucket

# 3. Auth users (Supabase dashboard → Export):
# Dashboard → Authentication → Users → Export CSV

# Import to self-hosted:
psql "postgresql://postgres:your-password@localhost:5432/postgres" \
  < supabase-backup.sql

# Update environment variables in your app:
NEXT_PUBLIC_SUPABASE_URL="https://supabase.yourdomain.com"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-self-hosted-anon-key"
SUPABASE_SERVICE_ROLE_KEY="your-self-hosted-service-key"

Auth migration note: Supabase uses GoTrue internally. Your user passwords and OAuth tokens transfer cleanly in the database dump — users don't need to re-authenticate.


The Decision Framework

Start here: Are you pre-revenue or < $10K MRR?
  YES → Use Supabase Cloud Pro ($25/month)
        Don't spend engineering time on infrastructure
  NO  → Continue evaluating...

Do you have a data sovereignty requirement (HIPAA, specific contracts)?
  YES → Self-hosted (or Supabase Cloud + BAA on Team plan)
  NO  → Continue evaluating...

Is your monthly Supabase bill > $200/month?
  YES → Evaluate self-hosted cost (infrastructure + engineer time)
  NO  → Stay on cloud

Do you need a custom Postgres extension not available on Cloud?
  YES → Self-hosted
  NO  → Stay on cloud

Do you have dedicated DevOps capacity (or a willing backend engineer)?
  YES → Self-hosting is a reasonable option
  NO  → Cloud is safer

Default recommendation: Supabase Cloud Pro ($25/month)
Switch to self-hosted when: data sovereignty required, OR cloud bill > $200/month AND you have DevOps capacity

Compare SaaS boilerplates by infrastructure requirements at StarterPick.

Comments