Deploy Supabase

Self-hosted Supabase: Postgres, Auth, REST, Realtime, Storage, Studio

Deploy Supabase

Just deployed

Just deployed

Just deployed

Just deployed

Just deployed

Deploy and Host Supabase on Railway

Supabase is an open-source Firebase alternative built on Postgres. It gives you a Postgres database with an auto-generated REST and GraphQL API, user sign-up and login, file storage, realtime subscriptions and a web dashboard (Studio) to manage it all. Apps talk to it with the supabase-js client or any HTTP client, and Row Level Security in Postgres decides what each user can read and write.

About Hosting Supabase

Self-hosted Supabase is a set of services around one Postgres database: Auth (GoTrue), REST (PostgREST), Realtime, Storage, Postgres Meta and Studio, behind an API gateway that checks API keys. Supabase's docker-compose setup expects you to generate a JWT secret, sign the anon and service_role keys with it, and paste them into every service. It also mounts several SQL files into Postgres on first start and shares volumes between containers, which Railway doesn't allow.

This template does all of that for you. Every secret is generated at deploy time, the API keys are derived from the JWT secret when each service starts, and the database is set up on first start with Supabase's own SQL. You get one public URL, a publishable key and a secret key, ready for supabase-js.

Common Use Cases

  • Backend for a web or mobile app: database, REST API, auth and file uploads in one place
  • Moving off hosted Supabase or Firebase to keep data on your own infrastructure
  • Internal tools and dashboards on Postgres with row-level access rules
  • Realtime features such as chat, live dashboards and presence
  • Prototypes that need sign-up, login and storage without writing a backend

Dependencies for Supabase Hosting

  • Supabase Postgres 17 (Postgres with Supabase's extensions and roles)
  • Caddy, as the API gateway in front of every service

Deployment Dependencies

Implementation Details

What you set: nothing. Database password, JWT secret, API keys, Studio password and encryption keys are generated. Optionally set SITE_URL on the Auth service to your app's URL.

After deploy:

  1. Wait 2 to 4 minutes for the first start while Postgres creates the Supabase schemas.
  2. Open the Supabase service. SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY and SUPABASE_SECRET_KEY are in its variables.
  3. Open the URL and log in to Studio with DASHBOARD_USERNAME and DASHBOARD_PASSWORD.
  4. Create tables in Studio, turn on Row Level Security and add policies.
  5. In your app: createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY).

This template:

  • Runs the official Supabase images: Postgres 17.6, Auth v2.197, PostgREST v14.18, Realtime v2.148, Storage v1.89, Postgres Meta v0.100 and Studio, all pinned
  • Generates every secret and derives the legacy anon and service_role JWTs from the JWT secret on start, so nothing has to be generated by hand or on an external website
  • Gives you the new opaque keys (sb_publishable_..., sb_secret_...); the gateway swaps them for JWTs as hosted Supabase does. The legacy JWT keys work too
  • Puts Studio behind a login; REST, Auth, Realtime and the database metadata API need an API key, and admin endpoints need the secret key
  • Sets up Postgres on first start with Supabase's own SQL (roles, Realtime, webhooks, JWT settings) and keeps the Vault encryption key in a variable
  • Waits for Postgres before starting Auth, Storage and Realtime, so the first deploy needs no manual redeploys
  • Stores the database, uploaded files and Studio's saved SQL snippets on volumes
  • Exposes Postgres over a TCP proxy for migrations, psql and the Supabase CLI, with a generated password

Notes: Edge Functions, the log explorer (Logflare/Vector), image resizing (imgproxy) and the connection pooler (Supavisor) are not included. New email users are confirmed automatically until you set SMTP on the Auth service and set GOTRUE_MAILER_AUTOCONFIRM to false. Sign-up is open to anyone with the publishable key, as in Supabase; set GOTRUE_DISABLE_SIGNUP to true to close it.

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

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8