
Deploy Supabase vs Firebase
Open-source Postgres backend vs Google Firebase
Just deployed
/app/snippets
realtime
Just deployed
Just deployed
Just deployed
Just deployed
/var/lib/postgresql/data
Just deployed
/var/lib/storage
Just deployed
Just deployed
Just deployed
Deploy and Host Supabase vs Firebase (Open-Source Firebase Alternative) on Railway
Self-hosted Supabase is a Firebase-shaped backend on your own Postgres. This Railway template runs nine Docker services: Postgres 17, GoTrue auth, PostgREST, Realtime, Storage, Edge Functions, Studio, postgres-meta, and Envoy gateway. You get SQL, RLS, storage, and realtime without Google lock-in. The Postgres and Storage volumes are the only stateful parts; the rest are stateless and can be recreated on deploy.
About Hosting Supabase open-source software on Railway (self hosted Supabase template)
The stack is upstream Supabase self-hosted, pinned to current images. Envoy v1.39.1 on port 8000 routes /rest/v1 to PostgREST, /auth/v1 to Auth, /storage/v1 to Storage, /functions/v1 to Edge Functions, /realtime/v1 to Realtime, /graphql/v1 via PostgREST, /pg to postgres-meta, and / to Studio with basic auth. Postgres is supabase/postgres 17.6.1.136 with volume and init SQL for roles, realtime, webhooks, JWT.
Why Deploy Supabase, the Firebase alternative on Railway (Railway Free Trial)
Firebase is proprietary NoSQL with usage-based pricing. Supabase gives real Postgres with SQL, RLS, and full data export. On Railway you pay flat resource costs for nine small services, so your bill does not spike with read/write counts. A Firebase Blaze project can jump when reads, writes, or egress increase.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Supabase vs Firebase on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for Supabase self hosting
| Provider | Best for | Supabase self-hosting notes |
|---|---|---|
| DigitalOcean | Single Droplet or App Platform deploys | You manage Docker Compose and backups; one VM can run all nine services if sized correctly |
| AWS | Organizations already using EC2, ECS, or RDS | Most control, highest setup overhead; you must handle networking, volumes, and secrets |
| Hetzner | Budget dedicated or cloud servers in EU | Strong price to RAM ratio, but you operate every service and update path yourself |
Railway handles the container orchestration, persistent volumes, networking, and deploy logs for this nine-service stack. You still own the Postgres data and can back it up or export it. A manual VPS setup often turns into a second job when a container exits, a volume fills, or an Envoy route changes.
Common Use Cases for hosted Supabase
- Postgres API with auth, REST, GraphQL
- Realtime chat, notifications, collaboration
- File uploads with RLS-protected buckets
- Edge functions for webhooks, Stripe, Deno jobs
- Admin dashboards needing SQL reporting
- Migration target from Firestore
- Multi-tenant SaaS apps where RLS keeps tenant data isolated
Dependencies for Supabase Docker hosted on Railway
Nine linked containers on a private network. Postgres is source of truth; all services connect with generated POSTGRES_PASSWORD. Envoy gateway routes HTTP. Two volumes: Postgres data and Storage files. Secrets are env vars. Every deploy regenerates some secrets, but the anon and service_role keys always derive from the same JWT_SECRET, so clients keep working after a restart.
Deployment Dependencies for Managed Supabase Service (Postgres Backend)
- db: Postgres volume and init SQL
- auth: db and JWT_SECRET
- rest: db and JWT_SECRET
- realtime: db, JWT_SECRET, encryption keys
- storage: db, volume, PGSODIUM_ROOT_KEY
- meta: db and encryption key
- functions: JWT_SECRET and router
- studio: db, auth, rest, storage, functions
- gateway: all HTTP services
Implementation Details for Supabase (Using official Supabase docker images)
Uses official Supabase/PostgREST images. Same JWT_SECRET across services. Postgres init creates roles authenticated, anon, service_role and realtime publication. Storage files under /var/lib/storage volume. Studio volume for snippets. No Supavisor pooler or direct external Postgres connections.
How does Supabase compare against other backend platforms
Supabase vs Firebase
- Data: relational Postgres vs Firestore NoSQL
- Queries: SQL joins vs client-side joins
- Security: RLS vs Firestore rules
- Lock-in: pg_dump vs Google export
- Realtime: Postgres changes vs document listeners
- Pricing: flat resources vs usage-based
- Migration: export Firestore, model tables, move auth, rewrite rules
Supabase vs Appwrite
- Core: Postgres SQL vs MariaDB BaaS
- License: Apache-2.0 vs BSD-3
- Realtime: Postgres logical replication vs WebSocket channels
- Functions: Deno vs multiple runtimes
- Migration: standard Postgres tooling vs API-defined schema
Supabase vs PocketBase
- Footprint: nine services vs single Go binary
- Scale: production vs small apps
- Auth: RLS integrated vs built-in auth only
- Storage: policies join tables vs basic files
- Tradeoff: more power vs simpler to run
Supabase vs Neon
- Scope: full backend vs Postgres only
- Auth: GoTrue JWT vs none
- Realtime: built-in vs absent
- Storage: included vs absent
- Use case: complete backend vs database only
How to use Supabase (the OSS Postgres backend)?
After deploy, open supabase domain, log in Studio with supabase and DASHBOARD_PASSWORD. Create tables via SQL, enable RLS, add policies. Copy anon key from gateway logs, use with supabase-js and public URL. service_role stays server-side. Email autoconfirm on, set SMTP to send real mail. Realtime on tables in supabase_realtime publication. Storage respects JWT/RLS.
A simple table with RLS looks like this:
create table notes (
id bigint generated always as identity primary key,
user_id uuid not null references auth.users (id),
body text
);
alter table notes enable row level security;
create policy "own notes" on notes for all
using (auth.uid() = user_id)
with check (auth.uid() = user_id);
The policy uses auth.uid() from the JWT, so a signed-in user can only touch their own rows.
How to self host Supabase on other VPS Services (Supabase self hosting guide)
Clone the Repository
Run git clone --depth 1 https://github.com/supabase/supabase then cd supabase/docker.
Install Dependencies
Install Docker Engine and Compose, run docker compose pull.
Configure Environment Variables
Copy .env.example to .env, change all secrets. Replace JWT_SECRET and POSTGRES_PASSWORD with long random values, for example using openssl rand -base64 48. Do not reuse example secrets.
Start the Supabase Application
Run docker compose up -d. Studio on port 8000, gateway logs show URL/anon key. Check status with docker compose ps. 4 GB RAM recommended.
Official Pricing of Supabase (Supabase pricing)
Supabase Cloud: Free (2 projects, 500 MB, pauses after 1 week), Pro from $25/mo with $10 credits, Team $599/mo, Enterprise custom. Self-hosting free. Railway: 9 services ~$20-40/mo light use. The software license is Apache-2.0, so there is no per-seat or per-project charge in self-hosted mode.
Supabase cloud vs self hosted comparison (Pricing, features, costs, and more)
Cloud adds managed backups, branching, multiple projects, org UI, pooling. Self-host gives control, pg_dump, flat pricing. Lose cloud conveniences. Railway is middle ground. You still manage Postgres backups and image updates, but you do not maintain a separate VM, DNS, or reverse proxy.
Monthly cost of self hosting Supabase on Railway
About $20-40/mo for nine small services at light use. 5 USD trial covers testing. Costs scale with volume, RAM, CPU, not read/write counts. Postgres is usually the first service to need more memory as rows and indexes grow.
System Requirements for Hosting Supabase on a VPS
Upstream recommends at least 4 GB RAM. Postgres benefits from more memory. db and storage need persistent volumes. Scale db independently on Railway. Recreating a service without its volume will delete Postgres data or uploaded files, so keep those volumes attached.
Frequently Asked Questions (FAQs)
Can I migrate from Firebase to self-hosted Supabase?
Yes. Export Firestore as JSON, design Postgres tables, import rows, move auth users to GoTrue, translate security rules to RLS. Firestore references often become foreign keys; nested documents often become joined tables.
Does the Railway Supabase template include Supavisor pooling?
No. Supavisor and Logflare are not included. Direct external pooling off, Studio logs disabled. If you need pooling later, you can add a separate pooler service, but the template does not promise one.
How do Row Level Security policies work with joins?
RLS applies to each table in a query. Both tables need policies allowing the JWT user. PostgREST enforces at Postgres level, so a missing policy on a joined table will return zero rows instead of leaking data.
Is the Supabase anon key safe to expose in a browser?
Yes. It carries anon role, works only where RLS allows. service_role bypasses RLS, must stay server-side. Never put service_role in frontend code or a public environment variable.
What is missing compared to Supabase Cloud?
Managed backups, branching, multiple projects, org UI, managed pooling. You handle backups and upgrades. Cloud also offers log analytics, but this template has no Logflare.
How do I enable real email delivery?
Set GOTRUE_SMTP_HOST, USER, PASS in auth, turn autoconfirm off. Without SMTP, test signups auto-confirmed. Turning off autoconfirm without SMTP will leave users stuck at the confirmation step.
Template Content
realtime
supabase/realtime:v2.134.10