Deploy Supabase (Self-Hosted, Full Stack)
Full Supabase stack: Postgres, Auth, REST, Storage, Studio behind Kong.
Just deployed
Just deployed
Postgres
Just deployed
/var/lib/postgresql
Just deployed
storage
Just deployed
/var/lib/storage
Just deployed
kong
Just deployed
Deploy and Host Supabase (Self-Hosted, Full Stack) on Railway
Supabase is the open-source Firebase alternative: a full backend built on PostgreSQL with instant REST and GraphQL APIs, authentication, file storage, and a beautiful admin dashboard. This template deploys the real self-hosted stack — 7 services wired together over Railway's private network — not just a bare database.
About Hosting Supabase (Self-Hosted, Full Stack)
One click deploys PostgreSQL 17 (Supabase build, on a persistent volume), GoTrue auth, PostgREST, Storage API (persistent volume), postgres-meta, Supabase Studio, and a Kong API gateway that exposes everything on a single public URL — exactly like the official docker-compose, adapted for Railway. Before deploying you must generate three secrets (2 minutes): open the official generator at https://supabase.com/docs/guides/self-hosting/docker#securing-your-services, create a JWT_SECRET with matching ANON_KEY and SERVICE_ROLE_KEY, and paste them into the deploy form. Everything else (database password, dashboard password) is auto-generated.
After deploy:
- Open the
kongservice's public URL → Supabase Studio (login:DASHBOARD_USERNAME/DASHBOARD_PASSWORDfrom the kong service variables) - Your API endpoints:
https:///rest/v1/,/auth/v1/,/storage/v1/,/graphql/v1 - Use with supabase-js:
createClient("https://", "")
Common Use Cases
- Full open-source Firebase alternative you own end-to-end: database, auth, APIs, and file storage on one URL
- Escaping Supabase Cloud project pricing while keeping the exact same client SDKs and Studio workflow
- Internal tools and MVPs that need instant CRUD APIs, row-level security, and user management out of the box
Dependencies for Supabase (Self-Hosted, Full Stack) Hosting
- JWT_SECRET + ANON_KEY + SERVICE_ROLE_KEY generated with Supabase's official tool (required at deploy time)
- Two persistent Railway volumes (database + file storage), included
Deployment Dependencies
Implementation Details
Kong routes /auth/v1/, /rest/v1/, /graphql/v1, /storage/v1/ and /pg/ to the right internal services and serves Studio at / behind basic-auth, using a declarative config generated from your keys. All inter-service traffic stays on Railway's private network. Image transformation is disabled because it would require a volume shared between two services, which Railway does not support; everything else matches the official docker-compose (Realtime and Edge Functions are not included in this template).
Why Deploy Supabase (Self-Hosted, Full Stack) on Railway?
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 (Self-Hosted, Full Stack) 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.
Template Content
Postgres
supabase/postgres:17.6.1.136JWT_SECRET
REQUIRED. 40+ char JWT secret shared by all Supabase services. Generate it together with matching ANON_KEY and SERVICE_ROLE_KEY at https://supabase.com/docs/guides/self-hosting/docker#securing-your-services
storage
supabase/storage-api:v1.60.4kong
kong/kong:3.9.1ANON_KEY
REQUIRED. Public anon API key (a JWT signed with your JWT_SECRET). Generate at https://supabase.com/docs/guides/self-hosting/docker#securing-your-services
SERVICE_ROLE_KEY
REQUIRED. Secret service_role API key (a JWT signed with your JWT_SECRET). Generate together with ANON_KEY. Never expose to browsers.