Supabase is what many projects reach for when they outgrow a simple app database.

It is not just auth.

It is not just Postgres.

Supabase is a Postgres-centered backend platform: database, authentication, generated APIs, realtime subscriptions, file storage, edge functions, dashboard, connection pooling, and supporting infrastructure.

That makes it much closer to an open-source Firebase alternative than to a small homelab app.

What is Supabase?

Supabase describes itself as:

The Postgres development platform. We’re building the features of Firebase using enterprise-grade open source tools.

The platform combines several open-source services:

Capability Component
Relational database Postgres
Auth Supabase Auth / GoTrue
REST API PostgREST
Realtime Supabase Realtime
File storage Supabase Storage
Image transforms imgproxy
Edge functions Supabase Edge Runtime / Deno
Dashboard Supabase Studio
Postgres management API postgres-meta
API gateway Envoy by default, Kong optional
Connection pooler Supavisor by default, PgBouncer optional
Logs and analytics Logflare + Vector optional

The repo I checked was:

Latest checked commit: eeae6027d5dc658932c6bd496a8c13e0277b7fdb
Commit date: 2026-10-09
Current self-hosted tag checked: self-hosted/v0.8.2
License: Apache-2.0
Package manager: pnpm

Why Supabase Matters

The appeal is that your database is still Postgres.

That matters for:

  • SQL;
  • migrations;
  • row-level security;
  • pg_dump and normal Postgres tooling;
  • extensions;
  • pgvector;
  • direct backend connections;
  • analytics queries;
  • portability compared with proprietary NoSQL backends.

At the same time, Supabase adds the product surface that frontend/mobile teams expect: login, API keys, generated REST endpoints, realtime listeners, storage buckets, dashboard workflows, and functions.

The tradeoff is operational weight.

Self-Hosting Supabase with Docker

The official self-hosted path lives in the repo’s docker/ directory.

I mirrored the current self-hosted Docker folder into Home-Lab:

Home-Lab Supabase folder

The main compose file is:

# Usage
#   Start:              docker compose up -d
#   Stop:               docker compose down
#   Dev mode:           docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up -d
#   Reset everything:   sh reset.sh
#
# Notes:
#   - Nested variable interpolation (${A:-${B}}) requires podman-compose >= 1.6.0
#

name: supabase

services:

  studio:
    container_name: supabase-studio
    image: supabase/studio:2026.09.07-sha-7996410
    restart: unless-stopped
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "node -e \"fetch('http://localhost:3000/api/platform/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})\""
        ]
      timeout: 10s
      interval: 5s
      retries: 3
      start_period: 20s
    environment:
      # Listen on all IPv4 interfaces
      HOSTNAME: "0.0.0.0"

      STUDIO_PG_META_URL: http://meta:8080
      POSTGRES_PORT: ${POSTGRES_PORT}
      POSTGRES_HOST: ${POSTGRES_HOST}
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}

      # See: https://supabase.com/docs/guides/self-hosting/remove-superuser-access
      POSTGRES_USER_READ_WRITE: postgres

      PG_META_CRYPTO_KEY: ${PG_META_CRYPTO_KEY}
      PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS}
      PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
      PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}

      DEFAULT_ORGANIZATION_NAME: ${STUDIO_DEFAULT_ORGANIZATION}
      DEFAULT_PROJECT_NAME: ${STUDIO_DEFAULT_PROJECT}
      OPENAI_API_KEY: ${OPENAI_API_KEY}

      SUPABASE_URL: http://api-gw:8000
      SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
      SUPABASE_ANON_KEY: ${ANON_KEY}
      SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
      AUTH_JWT_SECRET: ${JWT_SECRET}
      SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY}
      SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY}

      # See: docker-compose.logs.yml
      ENABLED_FEATURES_LOGS_ALL: "false"

      SNIPPETS_MANAGEMENT_FOLDER: /app/snippets
      EDGE_FUNCTIONS_MANAGEMENT_FOLDER: /app/edge-functions
    volumes:
      - ./volumes/snippets:/app/snippets:z
      - ./volumes/functions:/app/edge-functions:ro,z

  # Envoy is the default API gateway
  # See: https://github.com/orgs/supabase/discussions/48048
  api-gw:
    container_name: supabase-envoy
    image: envoyproxy/envoy:v1.39.1
    restart: unless-stopped
    networks:
      default:
        # Expose `envoy` and `kong` as network aliases, so internal configs
        # that reference either hostname resolve to whichever gateway is active.
        aliases:
          - envoy
          - kong
    healthcheck:
      # Using a TCP port check because this image does not include curl or wget.
      test: ["CMD-SHELL", "timeout 1 bash -c '</dev/tcp/127.0.0.1/8000'"]
      interval: 10s
      timeout: 5s
      retries: 3
    depends_on:
      studio:
        condition: service_healthy
    ports:
      - ${API_GW_HTTP_PORT:-${KONG_HTTP_PORT:-8000}}:8000/tcp
    volumes:
      - ./volumes/api/envoy/envoy.yaml:/etc/envoy/envoy.yaml:ro
      - ./volumes/api/envoy/cds.yaml:/etc/envoy/cds.yaml:ro
      - ./volumes/api/envoy/lds.template.yaml:/etc/envoy/lds.template.yaml:ro
      - ./volumes/api/envoy/docker-entrypoint.sh:/docker-entrypoint.sh:ro
    environment:
      ANON_KEY: ${ANON_KEY}
      SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
      SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY:-}
      SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY:-}
      ANON_KEY_ASYMMETRIC: ${ANON_KEY_ASYMMETRIC:-}
      SERVICE_ROLE_KEY_ASYMMETRIC: ${SERVICE_ROLE_KEY_ASYMMETRIC:-}
      SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
      DASHBOARD_USERNAME: ${DASHBOARD_USERNAME}
      DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD}
    entrypoint: ["/bin/sh", "/docker-entrypoint.sh"]

  auth:
    container_name: supabase-auth
    image: supabase/gotrue:v2.196.0
    restart: unless-stopped
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://localhost:9999/health"
        ]
      timeout: 5s
      interval: 5s
      retries: 3
    depends_on:
      db:
        # Disable this if you are using an external Postgres database
        condition: service_healthy
    environment:
      GOTRUE_API_HOST: 0.0.0.0
      GOTRUE_API_PORT: 9999
      API_EXTERNAL_URL: ${API_EXTERNAL_URL}

      GOTRUE_DB_DRIVER: postgres
      GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}

      GOTRUE_SITE_URL: ${SITE_URL}
      GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS}
      GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP}

      GOTRUE_JWT_ADMIN_ROLES: service_role
      GOTRUE_JWT_AUD: authenticated
      GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
      GOTRUE_JWT_EXP: ${JWT_EXPIRY}

      # Legacy symmetric HS256 key
      GOTRUE_JWT_SECRET: ${JWT_SECRET}

      # JSON array of signing JWKs (EC private + legacy symmetric)
      # For Podman, use: GOTRUE_JWT_KEYS: ${JWT_KEYS}
      #GOTRUE_JWT_KEYS: ${JWT_KEYS:-[]}

      GOTRUE_JWT_ISSUER: ${API_EXTERNAL_URL}

      GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP}
      GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: ${ENABLE_ANONYMOUS_USERS}
      GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM}

      # Uncomment to bypass nonce check in ID Token flow. Commonly set to true when using Google Sign In on mobile.
      # GOTRUE_EXTERNAL_SKIP_NONCE_CHECK: "true"

      # GOTRUE_MAILER_SECURE_EMAIL_CHANGE_ENABLED: "true"
      # GOTRUE_SMTP_MAX_FREQUENCY: 1s
      GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL}
      GOTRUE_SMTP_HOST: ${SMTP_HOST}
      GOTRUE_SMTP_PORT: ${SMTP_PORT}
      GOTRUE_SMTP_USER: ${SMTP_USER}
      GOTRUE_SMTP_PASS: ${SMTP_PASS}
      GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME}
      GOTRUE_MAILER_URLPATHS_INVITE: ${MAILER_URLPATHS_INVITE}
      GOTRUE_MAILER_URLPATHS_CONFIRMATION: ${MAILER_URLPATHS_CONFIRMATION}
      GOTRUE_MAILER_URLPATHS_RECOVERY: ${MAILER_URLPATHS_RECOVERY}
      GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: ${MAILER_URLPATHS_EMAIL_CHANGE}

      GOTRUE_EXTERNAL_PHONE_ENABLED: ${ENABLE_PHONE_SIGNUP}
      GOTRUE_SMS_AUTOCONFIRM: ${ENABLE_PHONE_AUTOCONFIRM}

      # Uncomment to enable OAuth / social login providers.
      # GOTRUE_EXTERNAL_GOOGLE_ENABLED: ${GOOGLE_ENABLED}
      # GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
      # GOTRUE_EXTERNAL_GOOGLE_SECRET: ${GOOGLE_SECRET}
      # GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI: ${API_EXTERNAL_URL}/callback

      # GOTRUE_EXTERNAL_GITHUB_ENABLED: ${GITHUB_ENABLED}
      # GOTRUE_EXTERNAL_GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID}
      # GOTRUE_EXTERNAL_GITHUB_SECRET: ${GITHUB_SECRET}
      # GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI: ${API_EXTERNAL_URL}/callback

      # GOTRUE_EXTERNAL_AZURE_ENABLED: ${AZURE_ENABLED}
      # GOTRUE_EXTERNAL_AZURE_CLIENT_ID: ${AZURE_CLIENT_ID}
      # GOTRUE_EXTERNAL_AZURE_SECRET: ${AZURE_SECRET}
      # GOTRUE_EXTERNAL_AZURE_REDIRECT_URI: ${API_EXTERNAL_URL}/callback

      # Uncomment to configure SMS delivery (phone auth and phone MFA).
      # GOTRUE_SMS_PROVIDER: ${SMS_PROVIDER}
      # GOTRUE_SMS_OTP_EXP: ${SMS_OTP_EXP}
      # GOTRUE_SMS_OTP_LENGTH: ${SMS_OTP_LENGTH}
      # GOTRUE_SMS_MAX_FREQUENCY: ${SMS_MAX_FREQUENCY}
      # GOTRUE_SMS_TEMPLATE: ${SMS_TEMPLATE}

      # Twilio credentials (when SMS_PROVIDER=twilio)
      # GOTRUE_SMS_TWILIO_ACCOUNT_SID: ${SMS_TWILIO_ACCOUNT_SID}
      # GOTRUE_SMS_TWILIO_AUTH_TOKEN: ${SMS_TWILIO_AUTH_TOKEN}
      # GOTRUE_SMS_TWILIO_MESSAGE_SERVICE_SID: ${SMS_TWILIO_MESSAGE_SERVICE_SID}

      # Test OTP mappings for development
      # GOTRUE_SMS_TEST_OTP: ${SMS_TEST_OTP}

      # Uncomment to configure multi-factor authentication (MFA).
      # GOTRUE_MFA_TOTP_ENROLL_ENABLED: ${MFA_TOTP_ENROLL_ENABLED}
      # GOTRUE_MFA_TOTP_VERIFY_ENABLED: ${MFA_TOTP_VERIFY_ENABLED}
      # GOTRUE_MFA_PHONE_ENROLL_ENABLED: ${MFA_PHONE_ENROLL_ENABLED}
      # GOTRUE_MFA_PHONE_VERIFY_ENABLED: ${MFA_PHONE_VERIFY_ENABLED}
      # GOTRUE_MFA_MAX_ENROLLED_FACTORS: ${MFA_MAX_ENROLLED_FACTORS}

      # SAML SSO
      # See: https://supabase.com/docs/guides/self-hosting/self-hosted-saml-sso
      # GOTRUE_SAML_ENABLED: ${SAML_ENABLED}
      # GOTRUE_SAML_PRIVATE_KEY: ${SAML_PRIVATE_KEY}
      # GOTRUE_SAML_ALLOW_ENCRYPTED_ASSERTIONS: ${SAML_ALLOW_ENCRYPTED_ASSERTIONS}
      # GOTRUE_SAML_RELAY_STATE_VALIDITY_PERIOD: ${SAML_RELAY_STATE_VALIDITY_PERIOD}
      # GOTRUE_SAML_RATE_LIMIT_ASSERTION: ${SAML_RATE_LIMIT_ASSERTION}
      # Optional, defaults to API_EXTERNAL_URL if not set
      # GOTRUE_SAML_EXTERNAL_URL: ${SAML_EXTERNAL_URL}

      # Uncomment to enable custom access token hook.
      # See: https://supabase.com/docs/guides/auth/auth-hooks for
      # full list of hooks and additional details about custom_access_token_hook

      # GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_ENABLED: "true"
      # GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_URI: "pg-functions://postgres/public/custom_access_token_hook"
      # GOTRUE_HOOK_CUSTOM_ACCESS_TOKEN_SECRETS: "<standard-base64-secret>"

      # GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_ENABLED: "true"
      # GOTRUE_HOOK_MFA_VERIFICATION_ATTEMPT_URI: "pg-functions://postgres/public/mfa_verification_attempt"

      # GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_ENABLED: "true"
      # GOTRUE_HOOK_PASSWORD_VERIFICATION_ATTEMPT_URI: "pg-functions://postgres/public/password_verification_attempt"

      # GOTRUE_HOOK_SEND_SMS_ENABLED: "false"
      # GOTRUE_HOOK_SEND_SMS_URI: "pg-functions://postgres/public/custom_access_token_hook"
      # GOTRUE_HOOK_SEND_SMS_SECRETS: "v1,whsec_VGhpcyBpcyBhbiBleGFtcGxlIG9mIGEgc2hvcnRlciBCYXNlNjQgc3RyaW5n"

      # GOTRUE_HOOK_SEND_EMAIL_ENABLED: "false"
      # GOTRUE_HOOK_SEND_EMAIL_URI: "http://host.docker.internal:54321/functions/v1/email_sender"
      # GOTRUE_HOOK_SEND_EMAIL_SECRETS: "v1,whsec_VGhpcyBpcyBhbiBleGFtcGxlIG9mIGEgc2hvcnRlciBCYXNlNjQgc3RyaW5n"

  rest:
    container_name: supabase-rest
    image: postgrest/postgrest:v14.17
    restart: unless-stopped
    depends_on:
      db:
        # Disable this if you are using an external Postgres database
        condition: service_healthy
    healthcheck:
      test: [ "CMD", "postgrest", "--ready" ]
      interval: 5s
      timeout: 5s
      retries: 3
    environment:
      PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
      PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS}
      PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
      PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
      PGRST_DB_ANON_ROLE: anon

      PGRST_ADMIN_SERVER_PORT: 3001
      PGRST_ADMIN_SERVER_HOST: localhost

      # PostgREST accepts a plain-text symmetric secret, a single JWK, or a JWKS.
      # For Podman, use either PGRST_JWT_SECRET: ${JWT_SECRET} or
      # PGRST_JWT_SECRET: ${JWT_JWKS}
      PGRST_JWT_SECRET: ${JWT_JWKS:-${JWT_SECRET}}

      PGRST_DB_USE_LEGACY_GUCS: "false"
      PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY}
    command:
      [
        "postgrest"
      ]

  realtime:
    # This container name looks inconsistent but is correct because realtime constructs tenant id by parsing the subdomain
    container_name: realtime-dev.supabase-realtime
    image: supabase/realtime:v2.134.10
    restart: unless-stopped
    depends_on:
      db:
        # Disable this if you are using an external Postgres database
        condition: service_healthy
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "curl -sSfL --head -o /dev/null -H \"Authorization: Bearer ${ANON_KEY}\" http://localhost:4000/api/tenants/realtime-dev/health"
        ]
      timeout: 5s
      interval: 30s
      retries: 3
      start_period: 10s
    environment:
      PORT: 4000
      DB_HOST: ${POSTGRES_HOST}
      DB_PORT: ${POSTGRES_PORT}
      DB_USER: supabase_admin
      DB_PASSWORD: ${POSTGRES_PASSWORD}
      DB_NAME: ${POSTGRES_DB}
      DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
      DB_ENC_KEY: ${REALTIME_DB_ENC_KEY:-supabaserealtime}

      # Legacy symmetric HS256 key
      API_JWT_SECRET: ${JWT_SECRET}

      # JWKS for token verification (EC public + legacy symmetric).
      # For Podman, use: API_JWT_JWKS: ${JWT_JWKS}
      #API_JWT_JWKS: ${JWT_JWKS:-{"keys":[]}}

      SECRET_KEY_BASE: ${SECRET_KEY_BASE}
      METRICS_JWT_SECRET: ${JWT_SECRET}
      ERL_AFLAGS: -proto_dist inet_tcp
      DNS_NODES: "''"
      RLIMIT_NOFILE: "10000"
      APP_NAME: realtime
      SEED_SELF_HOST: "true"
      RUN_JANITOR: "true"
      DISABLE_HEALTHCHECK_LOGGING: "true"

  # To use S3 backed storage: docker compose -f docker-compose.yml -f docker-compose.s3.yml up
  storage:
    container_name: supabase-storage
    image: supabase/storage-api:v1.74.0
    restart: unless-stopped
    depends_on:
      db:
        # Disable this if you are using an external Postgres database
        condition: service_healthy
      rest:
        condition: service_started
      imgproxy:
        condition: service_started
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://storage:5000/status"
        ]
      timeout: 5s
      interval: 5s
      retries: 3
      start_period: 10s
    environment:
      ANON_KEY: ${ANON_KEY}
      SERVICE_KEY: ${SERVICE_ROLE_KEY}
      POSTGREST_URL: http://rest:3000

      # Legacy symmetric HS256 key
      AUTH_JWT_SECRET: ${JWT_SECRET}

      # JWKS for token verification (EC public + legacy symmetric).
      # For Podman, use: JWT_JWKS: ${JWT_JWKS}
      #JWT_JWKS: ${JWT_JWKS:-{"keys":[]}}

      DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
      STORAGE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
      REQUEST_ALLOW_X_FORWARDED_PATH: "true"
      FILE_SIZE_LIMIT: 52428800
      STORAGE_BACKEND: file
      # S3 bucket when using S3 backend, directory name when using 'file'
      GLOBAL_S3_BUCKET: ${GLOBAL_S3_BUCKET}
      # S3 Backend configuration
      #GLOBAL_S3_ENDPOINT: https://your-s3-endpoint
      #GLOBAL_S3_PROTOCOL: https
      #GLOBAL_S3_FORCE_PATH_STYLE: "true"
      #AWS_ACCESS_KEY_ID: your-access-key-id
      #AWS_SECRET_ACCESS_KEY: your-secret-access-key
      FILE_STORAGE_BACKEND_PATH: /var/lib/storage
      TENANT_ID: ${STORAGE_TENANT_ID}
      # TODO: https://github.com/supabase/storage-api/issues/55
      REGION: ${REGION}
      ENABLE_IMAGE_TRANSFORMATION: "true"
      IMGPROXY_URL: http://imgproxy:5001
      # S3 protocol endpoint configuration
      S3_PROTOCOL_ACCESS_KEY_ID: ${S3_PROTOCOL_ACCESS_KEY_ID}
      S3_PROTOCOL_ACCESS_KEY_SECRET: ${S3_PROTOCOL_ACCESS_KEY_SECRET}
    volumes:
      - ./volumes/storage:/var/lib/storage:z

  imgproxy:
    container_name: supabase-imgproxy
    image: darthsim/imgproxy:v3.31.4
    restart: unless-stopped
    volumes:
      - ./volumes/storage:/var/lib/storage:z
    healthcheck:
      test:
        [
          "CMD",
          "imgproxy",
          "health"
        ]
      timeout: 5s
      interval: 5s
      retries: 3
    environment:
      IMGPROXY_BIND: ":5001"
      IMGPROXY_LOCAL_FILESYSTEM_ROOT: /
      IMGPROXY_USE_ETAG: "true"
      IMGPROXY_AUTO_WEBP: ${IMGPROXY_AUTO_WEBP}
      IMGPROXY_MAX_SRC_RESOLUTION: 16.8

  meta:
    container_name: supabase-meta
    image: supabase/postgres-meta:v0.99.0
    restart: unless-stopped
    depends_on:
      db:
        # Disable this if you are using an external Postgres database
        condition: service_healthy
    environment:
      PG_META_PORT: 8080
      PG_META_DB_HOST: ${POSTGRES_HOST}
      PG_META_DB_PORT: ${POSTGRES_PORT}
      PG_META_DB_NAME: ${POSTGRES_DB}
      PG_META_DB_USER: postgres
      PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
      CRYPTO_KEY: ${PG_META_CRYPTO_KEY}

  functions:
    container_name: supabase-edge-functions
    image: supabase/edge-runtime:v1.76.2
    restart: unless-stopped
    volumes:
      - ./volumes/functions:/home/deno/functions:z
      - deno-cache:/root/.cache/deno
    depends_on:
      api-gw:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "timeout 1 bash -c '</dev/tcp/127.0.0.1/9000'"]
      interval: 5s
      timeout: 5s
      retries: 3
    environment:
      # Legacy symmetric HS256 key
      JWT_SECRET: ${JWT_SECRET}
      # JWKS for token verification (EC public + legacy symmetric).
      # For Podman, use: SUPABASE_JWKS: ${JWT_JWKS}
      #SUPABASE_JWKS: ${JWT_JWKS:-{"keys":[]}}

      SUPABASE_URL: http://api-gw:8000
      SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
      # Legacy API keys (HS256-signed JWTs)
      SUPABASE_ANON_KEY: ${ANON_KEY}
      SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
      # New opaque API keys
      SUPABASE_PUBLISHABLE_KEYS: "{\"default\":\"${SUPABASE_PUBLISHABLE_KEY:-}\"}"
      SUPABASE_SECRET_KEYS: "{\"default\":\"${SUPABASE_SECRET_KEY:-}\"}"
      SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
      # TODO: Allow configuring VERIFY_JWT per function.
      VERIFY_JWT: "${FUNCTIONS_VERIFY_JWT}"
    command:
      [
        "start",
        "--user-worker-request-idle-timeout",
        "150000",
        "--main-service",
        "/home/deno/functions/main"
      ]

  # Comment out everything below this point if you are using an external Postgres database
  db:
    container_name: supabase-db
    # To upgrade an existing Postgres 15 database in place, see utils/upgrade-pg17.sh.
    image: supabase/postgres:17.6.1.136
    restart: unless-stopped
    volumes:
      - ./volumes/db/realtime.sql:/docker-entrypoint-initdb.d/migrations/99-realtime.sql:Z
      # Must be superuser to create event trigger
      - ./volumes/db/webhooks.sql:/docker-entrypoint-initdb.d/init-scripts/98-webhooks.sql:Z
      # Must be superuser to alter reserved role
      - ./volumes/db/roles.sql:/docker-entrypoint-initdb.d/init-scripts/99-roles.sql:Z
      # Initialize the database settings with JWT_EXP
      - ./volumes/db/jwt.sql:/docker-entrypoint-initdb.d/init-scripts/99-jwt.sql:Z
      # PGDATA directory is persisted between restarts
      - ./volumes/db/data:/var/lib/postgresql/data:Z
      # Changes required for internal supabase data such as _analytics
      - ./volumes/db/_supabase.sql:/docker-entrypoint-initdb.d/migrations/97-_supabase.sql:Z
      # Changes required for Analytics support
      - ./volumes/db/logs.sql:/docker-entrypoint-initdb.d/migrations/99-logs.sql:Z
      # Changes required for Pooler support
      - ./volumes/db/pooler.sql:/docker-entrypoint-initdb.d/migrations/99-pooler.sql:Z
      # Use named volume to persist pgsodium decryption key between restarts
      - db-config:/etc/postgresql-custom
    healthcheck:
      test:
        [
        "CMD",
        "pg_isready",
        "-U",
        "postgres",
        "-h",
        "localhost"
        ]
      interval: 5s
      timeout: 5s
      retries: 10
    environment:
      POSTGRES_HOST: /var/run/postgresql
      PGPORT: ${POSTGRES_PORT}
      POSTGRES_PORT: ${POSTGRES_PORT}
      PGPASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      PGDATABASE: ${POSTGRES_DB}
      POSTGRES_DB: ${POSTGRES_DB}
      JWT_EXP: ${JWT_EXPIRY}
    command:
      [
        "postgres",
        "-c",
        "config_file=/etc/postgresql/postgresql.conf",
        "-c",
        "log_min_messages=fatal" # prevents Realtime polling queries from appearing in logs
      ]

  # Update the DATABASE_URL if you are using an external Postgres database
  supavisor:
    container_name: supabase-pooler
    image: supabase/supavisor:2.9.12
    restart: unless-stopped
    ports:
      - ${POSTGRES_PORT}:5432
      - ${POOLER_PROXY_PORT_TRANSACTION}:6543
    volumes:
      - ./volumes/pooler/pooler.exs:/etc/pooler/pooler.exs:ro,z
    healthcheck:
      test:
        [
          "CMD",
          "curl",
          "-sSfL",
          "--head",
          "-o",
          "/dev/null",
          "http://127.0.0.1:4000/api/health"
        ]
      interval: 10s
      timeout: 5s
      retries: 10
      start_period: 30s
    depends_on:
      db:
        condition: service_healthy
    environment:
      PORT: 4000
      POSTGRES_PORT: ${POSTGRES_PORT}
      POSTGRES_HOST: ${POSTGRES_HOST}
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      DATABASE_URL: ecto://supabase_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/_supabase
      CLUSTER_POSTGRES: "true"
      SECRET_KEY_BASE: ${SECRET_KEY_BASE}
      VAULT_ENC_KEY: ${VAULT_ENC_KEY}
      API_JWT_SECRET: ${JWT_SECRET}
      METRICS_JWT_SECRET: ${JWT_SECRET}
      REGION: local
      ERL_AFLAGS: -proto_dist inet_tcp
      POOLER_TENANT_ID: ${POOLER_TENANT_ID}
      POOLER_DEFAULT_POOL_SIZE: ${POOLER_DEFAULT_POOL_SIZE}
      POOLER_MAX_CLIENT_CONN: ${POOLER_MAX_CLIENT_CONN}
      POOLER_POOL_MODE: transaction
      DB_POOL_SIZE: ${POOLER_DB_POOL_SIZE}
    command:
      [
        "/bin/sh",
        "-c",
        "/app/bin/migrate && /app/bin/supavisor eval \"$$(cat /etc/pooler/pooler.exs)\" && /app/bin/server"
      ]

volumes:
  db-config:
  deno-cache:

That compose file is only one part of the deployment. It depends on the rest of the docker/ folder:

  • .env.example;
  • run.sh;
  • update.sh;
  • reset.sh;
  • utils/generate-keys.sh;
  • utils/add-new-auth-keys.sh;
  • volumes/api/envoy/*;
  • volumes/db/*.sql;
  • volumes/functions/*;
  • optional override compose files.

For a new install, the official quick path is:

curl -fsSL https://supabase.link/setup.sh | sh
cd supabase-project
sh run.sh start

For the pinned manual path:

git clone --depth 1 --branch self-hosted/v0.8.2 https://github.com/supabase/supabase
mkdir supabase-project
cp -rf supabase/docker/. supabase-project
cd supabase-project
cp .env.example .env
printf 'ref=self-hosted/v0.8.2\n' > .supabase-version

Before starting, generate and review secrets:

sh utils/generate-keys.sh
sh utils/add-new-auth-keys.sh
nano .env

Then:

sh run.sh start

Field Note: I Validated Config, Not a Full Launch

I did not start the full Supabase stack on this server.

That was intentional.

The default .env.example is explicitly not production-safe, and a meaningful Supabase test pulls/runs a full backend platform with Postgres, Studio, Auth, Realtime, Storage, Edge Runtime, Envoy, Supavisor, and supporting services.

What I did run:

docker compose --env-file .env.example config --services

It resolved these core services:

studio
api-gw
db
auth
imgproxy
rest
storage
supavisor
functions
meta
realtime

I also generated the full Compose config:

docker compose --env-file .env.example config

That passed.

This is a configuration validation, not a claim that the stack is production-ready.

Important URLs and Ports

By default, the API gateway listens on port 8000.

Common paths:

Studio / Dashboard: http://your-server:8000
REST API:           http://your-server:8000/rest/v1/
Auth API:           http://your-server:8000/auth/v1/
Storage API:        http://your-server:8000/storage/v1/
Realtime:           http://your-server:8000/realtime/v1/
Functions:          http://your-server:8000/functions/v1/<function>

For production, put HTTPS in front of the API gateway.

The official Docker folder includes Caddy and Nginx override files:

sh run.sh config add caddy
sh run.sh config add nginx

Then update:

SUPABASE_PUBLIC_URL=https://supabase.example.com
API_EXTERNAL_URL=https://supabase.example.com/auth/v1
SITE_URL=https://app.example.com

SITE_URL is your own app frontend, not necessarily the Supabase dashboard URL.

Optional Overrides

Supabase’s Docker setup is designed around override files:

Override Purpose
logs Adds Logflare and Vector for Logs & Analytics
caddy Adds Caddy reverse proxy with automatic HTTPS
nginx Adds Nginx + Certbot reverse proxy
kong Uses Kong as API gateway instead of default Envoy
rustfs Uses RustFS for S3-compatible object storage backend
s3 Legacy MinIO-style S3 backend, marked for future removal
pgbouncer Replaces Supavisor transaction pooling with PgBouncer
pg15 Legacy Postgres 15 override for deployments not yet upgraded
pg17 Explicit Postgres 17 override matching current default

Enable one with:

sh run.sh config add logs

Inspect active compose files:

sh run.sh config

Supabase vs PocketBase, Better Auth, Appwrite, Firebase, and CloudflareBase

Tool Best fit
Supabase Postgres-centered backend platform with auth, APIs, realtime, storage, functions, dashboard
PocketBase Small single-binary backend with SQLite, auth, realtime, files, admin UI
Better Auth TypeScript auth framework inside your own app
Appwrite Broader self-hosted backend platform with database/auth/storage/functions, less Postgres-native
Firebase Managed proprietary backend platform
CloudflareBase Cloudflare-native Firebase/Supabase-style idea built around Workers/Durable Objects/R2/D1-like primitives

If you want a serious Postgres platform, Supabase is the natural option.

If you want the easiest homelab backend with the smallest operational surface, PocketBase is much simpler.

If you only need auth in an existing TypeScript app, Better Auth is lighter.

FAQ

Is Supabase really self-hostable?

Yes.

The official repo ships a self-hosted Docker directory, and the docs describe Docker as the fastest recommended self-hosting path.

The key caveat is that you are self-hosting a platform, not a tiny app. You own upgrades, backups, monitoring, secrets, HTTPS, database reliability, and incident response.

How many containers does self-hosted Supabase use?

The current base stack resolves to 11 core services:

studio, api-gw, db, auth, imgproxy, rest, storage, supavisor, functions, meta, realtime

Logs/analytics add Logflare and Vector. Reverse proxy overrides add Caddy or Nginx. S3/RustFS/PgBouncer/Kong overrides can change or extend the graph.

Is this similar to PocketBase?

Only at the product-category level.

Both can give you auth, data APIs, files, and an admin UI. Architecturally they are very different:

PocketBase = one Go binary + SQLite
Supabase   = Postgres platform + many services

PocketBase is simpler for small single-server apps. Supabase is stronger when you want normal Postgres, SQL, extensions, row-level security, generated APIs, and a larger ecosystem.

Is Supabase just Postgres?

No.

Postgres is the center, but Supabase adds Auth, REST, Realtime, Storage, Edge Functions, Studio, connection pooling, and gateway routing.

That is why self-hosting Supabase is heavier than running postgres:17.

Does Supabase replace Better Auth?

Sometimes.

Supabase Auth can be your app’s auth system if you are also buying into the Supabase platform model.

Better Auth is a library/framework you embed into your own TypeScript backend. It is a better fit when you want auth logic inside your existing app stack and database choices, instead of running Supabase’s platform services.

Does Supabase include object storage?

Yes.

Supabase Storage provides the storage API and uses Postgres for metadata and permissions. The self-hosted Docker setup can use local storage by default and optional S3-compatible backends.

The current stack also includes a RustFS override, which is notable because we recently covered RustFS as a self-hosted S3-compatible object storage project.

Does Supabase use Supavisor or PgBouncer?

Supavisor is the default pooler.

It exposes session-mode connections on port 5432 and transaction-mode pooling on port 6543. PgBouncer is available as an optional override if you prefer that pooler model.

For migrations, pg_dump, and administrative work, you may still want a direct Postgres connection, but exposing Postgres directly should be protected carefully.

Is Envoy replacing Kong?

In the current self-hosted Docker stack, Envoy is the default API gateway.

Kong is still available as an optional override, but the changelog marks Kong override support as an upcoming deprecation area. If you are starting fresh, follow the Envoy path unless you have a strong reason not to.

Can I expose this through Cloudflare Tunnel?

For simple HTTPS access to the API gateway, a tunnel can work as a reverse-proxy path.

But do not expose internal-only pieces casually. Postgres, the Docker socket, internal Studio/MCP access, and service-to-service ports should stay private.

Realtime also requires working WebSocket proxying.

What about the MCP server?

Self-hosted Supabase includes MCP-related support, but the docs are clear that the MCP server is not intended to be exposed directly to the internet.

The recommended access pattern is via VPN or SSH tunnel with network restrictions.

Treat MCP as an operator/developer tool, not as a public endpoint.

Can I migrate from hosted Supabase to self-hosted?

Yes, but plan it like a database/platform migration.

You need to think about:

  • database dump/restore;
  • auth users and identities;
  • storage objects;
  • secrets and API keys;
  • extensions;
  • functions;
  • redirects and callback URLs;
  • downtime or cutover strategy.

The official docs include restore-from-platform material, but this is not a one-click downgrade from managed operations to a homelab.

How should I back it up?

At minimum:

  • back up Postgres with tested restore procedures;
  • back up volumes/storage or your S3-compatible backend;
  • back up .env securely because it contains key material;
  • record your .supabase-version;
  • document enabled override files;
  • test restoring to another machine.

Do not rely only on Docker volumes existing on one disk.

Should I self-host Supabase for production?

Only if you actually want to operate it.

Self-hosted Supabase is a good fit when you need data control, isolated infrastructure, compliance boundaries, or local/private deployments.

Managed Supabase is usually a better fit if your priority is shipping an app without owning database upgrades, dashboard uptime, storage operations, metrics, backups, and security patching.

Conclusion

Supabase is one of the most important open-source backend platforms because it keeps Postgres at the center.

Self-hosting it is absolutely possible, but it is not casual.

For a homelab, I would use Supabase when I specifically want a Postgres-based Firebase-style platform. For a small personal app, PocketBase is dramatically simpler. For auth inside an existing TypeScript backend, Better Auth is lighter. For Cloudflare-native experiments, CloudflareBase is closer to that edge/serverless direction.

Supabase wins when the database matters and the platform surface is worth the operational weight.