Deploy Supabase
Self-hosted Supabase: Postgres, Auth, REST, Realtime, Storage and Studio
Just deployed
Just deployed
Just deployed
Just deployed
/app/data
Just deployed
Just deployed
Just deployed
/var/lib/postgresql/data
Functions
Just deployed
Just deployed
Just deployed
Bucket
Bucket
Just deployed
Deploy and Host Supabase on Railway
Supabase is an open-source backend platform built on Postgres. It gives you a database with a REST and GraphQL API, user authentication, file storage with image transformations, realtime subscriptions over WebSockets, Deno edge functions and the Studio dashboard to manage it all, in one project you can host yourself.
About Hosting Supabase
Self-hosted Supabase is a set of services around Supabase's own Postgres image: Auth, PostgREST, Realtime, Storage, imgproxy, postgres-meta, the Edge Runtime, Studio and an API gateway. They share one JWT secret, and each one needs the database's role passwords, API keys signed with that secret, and the others' addresses. This template sets all of that up for you. Every secret is generated at deploy time and the API keys are derived from the JWT secret, so there is nothing to fill in. Postgres data and the Vault encryption key live on a volume, files go to a Railway Bucket, and Studio sits behind a login.
Common Use Cases
- Backend for web and mobile apps: database, auth, file uploads and realtime in one place
- A Firebase alternative you control, on your own Railway account and region
- Postgres with an instant REST API, row-level security and a web SQL editor for internal tools
Dependencies for Supabase Hosting
- Supabase's Postgres 17 image (
supabase/postgres17.6.1.136) with a volume - A Railway Bucket for Storage files
Deployment Dependencies
- Supabase self-hosting guide: https://supabase.com/docs/guides/self-hosting/docker
- Supabase self-hosting kit (versions used here): https://github.com/supabase/supabase/tree/master/docker
- Template source, one folder per service: https://github.com/aalfath/supabase-railway-template
Implementation Details
Services: Supabase (Envoy API gateway, the public URL), Studio, Auth, REST, Realtime, Storage, imgproxy, Meta, Functions, Postgres and the Bucket. Versions: Studio 2026.11.02, Auth v2.197.0, PostgREST v14.18, Realtime v2.148.3, Storage v1.89.12, Edge Runtime v1.77.9, all pinned by digest and built from the template repo, so you get an update notice when the repo moves to a new Supabase release.
After deploying:
- Open the
Supabaseservice's URL and log in withDASHBOARD_USERNAME(supabase) andDASHBOARD_PASSWORDfrom that service's variables. - Your Project URL is the same address. The
anonandservice_rolekeys are in Studio under Project Settings > API Keys. - Connect to Postgres from outside Railway with
DATABASE_URLon thePostgresservice. - Set
SITE_URLonAuthto your app's URL. To send auth e-mails, addSMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASSandSMTP_ADMIN_EMAILtoAuth; until then, new e-mail sign-ups are confirmed automatically. - Edge Functions are files in the repo's
functions/functionsfolder: fork the repo to add your own.
Not included: Supavisor (connection pooler) and the log analytics stack.
Why Deploy Supabase 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 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
Functions
aalfath/supabase-railway-templateBucket
Bucket
