Skip to main content
[ PIER ]

Supabase

The open-source Firebase alternative — Postgres + Auth + Realtime + Storage.

Service #firebase#postgresql#auth#realtime#api

Supabase is an open-source backend-as-a-service built on PostgreSQL. It bundles authentication, instant REST + GraphQL APIs from your schema, realtime subscriptions, file storage, edge functions, and pgvector — all running on Postgres extensions. Pier deploys the full stack as a single one-click service.

Deploy with Pier

  1. 1 Open the Pier dashboard and click Add service.
  2. 2 Pick Supabase from the template list.
  3. 3 Choose the version, set a service name, and Pier provisions the container, storage, and ports automatically.
  4. 4 Attach a domain if you want HTTPS. Traefik auto-provisions the Let's Encrypt certificate.

What is Supabase?

Supabase is “the open-source Firebase alternative” — a backend-as-a-service that bundles authentication, an auto-generated REST + GraphQL API, realtime subscriptions, file storage, edge functions, and vector search on top of PostgreSQL. Where Firebase locks your data into Google’s proprietary Firestore, Supabase keeps everything in plain Postgres — you can pg_dump your database at any time and walk away.

Architecturally it’s a Docker Compose stack: Postgres in the middle, PostgREST + pg_graphql exposing the schema as APIs, GoTrue handling auth, Realtime broadcasting changes over WebSockets, and Storage API wrapping S3-compatible buckets. Kong sits in front as the gateway. Supabase Studio gives you a web UI to browse tables, edit RLS policies, and inspect logs.

How Pier deploys it

Pier deploys Supabase as a multi-container Docker Compose template. All the sidecars — Postgres, PostgREST, GoTrue, Realtime, Storage, Kong, Studio — come up together with sensible defaults and a generated JWT secret. The service exposes ports 8000 (API) and 3000 (Studio) internally.

For HTTPS, attach a domain — Traefik handles cert issuance. The standard Supabase env vars (SUPABASE_URL, ANON_KEY, SERVICE_ROLE_KEY) are shown in the Pier service page so you can plug them straight into your client SDK.

When NOT to use Supabase

For pure storage or pure auth, the bundled stack is overkill — use plain PostgreSQL + a single auth library. For mobile-only apps with no web side, PocketBase is lighter. For deep enterprise SSO and RBAC needs out of the box, look at Keycloak. Supabase wins when you want a Firebase-level developer experience without giving up Postgres or self-hosting freedom.

Key features

PostgreSQL at the core

Every Supabase feature is a Postgres extension or sidecar. Your data lives in plain Postgres — no proprietary database, no lock-in. pg_dump exports work.

Auto-generated REST + GraphQL

PostgREST exposes every table and view as a REST endpoint with row-level security. pg_graphql adds GraphQL on top — no resolvers to write.

Auth out of the box

Email/password, magic links, OAuth (Google, GitHub, Apple, Discord, 30+ providers), MFA, anonymous sign-ins. JWT tokens enforced via Postgres RLS policies.

Realtime subscriptions

Subscribe to INSERT/UPDATE/DELETE on any table over WebSockets. Built on Postgres logical replication — same mechanism as cross-region replication.

Object storage

S3-compatible storage with per-bucket RLS policies. Image transformations, signed URLs, large file uploads — all without leaving Supabase.

Vector search (pgvector)

First-class support for AI embeddings. Store, index, and query 1536-dim vectors with HNSW indexes. RAG and semantic search without a separate vector DB.

Use cases

SaaS app backend

Replace Firebase + Stripe + Algolia + S3 with one self-hosted stack. Auth, database, file storage, search, vector — all in one Postgres.

Internal tools backend

PostgREST + auth gives you a full API in minutes. Combine with Retool, Tooljet, or Pier's Directus template for the UI.

Mobile app backend

Supabase JS/Swift/Kotlin/Flutter SDKs handle auth, realtime, storage. Offline-first with PowerSync or Watermelon overlays.

AI / RAG backend

pgvector for embeddings + storage for source docs + auth for multi-tenant access. The de-facto OSS stack for RAG products.

Realtime collaboration (Notion-style)

Realtime subscriptions on Postgres tables sync state across users. Pair with Yjs or Liveblocks for OT/CRDT in the editor layer.

Code examples

Connect from a JS client javascript
import { createClient } from "@supabase/supabase-js";

const supabase = createClient(
  "https://your-supabase.example.com",
  "<anon key>"
);

const { data, error } = await supabase
  .from("posts")
  .select("id, title, author:profiles(name)")
  .eq("published", true)
  .order("created_at", { ascending: false })
  .limit(10);
Realtime subscription javascript
const channel = supabase
  .channel("posts-changes")
  .on(
    "postgres_changes",
    { event: "INSERT", schema: "public", table: "posts" },
    (payload) => console.log("New post:", payload.new)
  )
  .subscribe();
RLS policy for multi-tenancy sql
ALTER TABLE projects ENABLE ROW LEVEL SECURITY;

CREATE POLICY "Users see only their own projects"
ON projects FOR ALL
USING (owner_id = auth.uid());
pgvector RAG query sql
SELECT id, title, content
FROM documents
ORDER BY embedding <-> '[0.1, 0.2, ...]'::vector
LIMIT 5;

How it compares

vs Firebase Firebase is closed-source and Google-locked-in. Supabase is OSS, self-hostable, Postgres-based. Equivalent feature set; portable away the moment you want to leave.
vs PocketBase PocketBase is a single-binary SQLite-based Firebase-alike. Lighter, simpler, lower ceiling. Pick PocketBase for hobby projects; Supabase for production multi-tenant SaaS.
vs Hasura Hasura generates GraphQL from any Postgres. Supabase generates REST + GraphQL and bundles auth/storage/realtime/edge functions. Hasura is the GraphQL layer; Supabase is the full stack.
vs Postgres + handwritten API You can build everything yourself on raw Postgres — but you re-invent auth, RLS plumbing, realtime websockets, and storage. Supabase saves months of plumbing.

Frequently asked questions

Is Supabase really 100% open source?
Yes — the core (Postgres + PostgREST + GoTrue + Realtime + Storage) is Apache 2.0 or MIT. Supabase Studio (the UI) is also OSS. The hosted Supabase cloud adds support and managed scaling, but every component is self-hostable.
How does Pier deploy it?
Pier uses the official `supabase/supabase` Docker Compose stack (multi-container). The compose template provisions Postgres, GoTrue (auth), PostgREST (REST API), Realtime, Storage API, Kong (gateway), and Studio (UI).
Default ports?
8000/tcp (Kong gateway / API), 8443 if HTTPS configured. Pier exposes these via Traefik when you attach a domain.
How do I access Supabase Studio?
Studio runs on a separate path. Once the service is up, Pier shows the URL on the service page. Login uses the dashboard credentials Pier generated.
Can I migrate from hosted Supabase to self-hosted on Pier?
Yes — `supabase db dump` from the hosted side, `supabase db push` on the self-hosted side. The schemas and RLS policies port cleanly.
Postgres extensions available?
pg_graphql, pg_net, pgsodium, pgjwt, pgvector, postgis, pg_cron, pgaudit, http, plpgsql_check, pg_stat_statements — all pre-installed in the Supabase image.
Backups?
Pier backs up the underlying Postgres on schedule. Storage object files require separate handling — back up the storage volume.

Related services

Deploy on your VPS

Supabase is an open-source backend-as-a-service built on PostgreSQL. It bundles authentication, instant REST + GraphQL APIs from your schema, realtime subscriptions, file storage, edge functions, and pgvector — all running on Postgres extensions. Pier deploys the full stack as a single one-click service.

Deploy this service →