---
title: "Deploy Supabase Lite"
description: "Minimal self-hosted Supabase stack: 7 services in ~1.5 GB of RAM"
category: "Storage"
url: https://railway.com/deploy/supabase-lite
---

# Deploy Supabase Lite

Minimal self-hosted Supabase stack: 7 services in ~1.5 GB of RAM

**[Deploy Supabase Lite on Railway](https://railway.com/template/supabase-lite)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/supabase-lite/manifest.json

- **Creator:** INAPP
- **Category:** Storage
- **Total deploys:** 4

## Template content

### rest

- **Image:** postgrest/postgrest:v14.8@sha256:4173b72e0be29cf15349dc827798c3e464c5f2cc7f9c1697022f9cd1874b4c36

### realtime

- **Image:** supabase/realtime:v2.76.5@sha256:ec6607368a2b41f54fb6edffbb821984522d0ba47399937aeeba75673c36a6f8
- **Health check:** /healthcheck

### auth

- **Image:** supabase/gotrue:v2.186.0@sha256:f2112b9289422f205df4ea15b8b550d425ae42528ea54521faa32cc7b62490de
- **Start command:** `sh -c 'until nc -z $POSTGRES_HOST $POSTGRES_PORT 2>/dev/null; do echo waiting for postgres; sleep 2; done; exec gotrue'`
- **Health check:** /health

### minio

- **Source:** INAPP-Mobile/railway-supabase-lite

### postgres

- **Source:** https://github.com/INAPP-Mobile/railway-supabase-lite
- **Start command:** `/custom-entrypoint.sh`

### storage

- **Image:** supabase/storage-api:v1.48.26@sha256:86487b496499561225c1f79c546645421890125539a8d9e00da45dee0a834314
- **Start command:** `sh -c 'until nc -z $POSTGRES_HOST $POSTGRES_PORT 2>/dev/null; do echo waiting for postgres; sleep 2; done; until nc -z $MINIO_HOST 8080 2>/dev/null; do echo waiting for minio; sleep 2; done; exec node dist/start/server.js'`
- **Health check:** /status

### kong

- **Source:** https://github.com/INAPP-Mobile/railway-supabase-lite
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host

A minimal, cost-optimized self-hosted Supabase stack for Railway. Unlike the full 12-service Supabase template that needs 4–8 GB RAM, **Supabase Lite runs the 7 core services in ~1.5 GB RAM for roughly $10–15/mo**.

[![Deploy to Railway](https://railway.app/button.svg)](https://railway.com/deploy/mv2xIy)

## About Hosting

Supabase Lite runs 7 Docker-based services on Railway's managed infrastructure. All inter-service communication uses Railway private networking (`*.railway.internal`). Only the Kong gateway is exposed publicly via a Railway domain. Two persistent volumes are provisioned automatically: `postgres-data` (mounted at `/var/lib/postgresql`) and `minio-data` (mounted at `/data`).

## Why Deploy

- **Cost-efficient:** ~1.5 GB RAM total vs 4–8 GB for the full Supabase template
- **Production-ready auth, REST, realtime, and storage** — the core Supabase API surface
- **Private by default:** only Kong is public; all other services are internal
- **No vendor lock-in:** standard Supabase images, portable schemas, standard Postgres

## Common Use Cases

- Self-hosted backend for a web or mobile app needing auth + database + storage
- Cost-conscious Supabase alternative for hobby/staging projects
- API gateway pattern with Kong routing to auth/rest/realtime/storage
- S3-compatible file storage with MinIO backend

## What's included

| Service | Upstream image | Port | Purpose |
|---|---|---|---|
| **postgres** | `supabase/postgres:15.8.1.085` | `5432` | PostgreSQL with pgvector, pgjwt, pg_graphql |
| **kong** | `kong:3.9.1` | `8080` | API gateway — only public-facing service |
| **auth** | `supabase/gotrue:v2.186.0` | `8080` | Auth / user management (GoTrue) |
| **rest** | `postgrest/postgrest:v14.8` | `8080` | Auto-generated REST API from Postgres |
| **realtime** | `supabase/realtime:v2.76.5` | `8080` | WebSocket realtime subscriptions |
| **storage** | `supabase/storage-api:v1.48.26` | `8080` | S3-compatible object storage API |
| **minio** | `minio/minio:RELEASE.2025-09-07T16-13-09Z` | `8080` | S3 backend for Storage |

**Not included:** Studio UI, imgproxy, postgres-meta, edge-runtime, logflare, supavisor, vector.

## Dependencies for

### Deployment Dependencies

- PostgreSQL volume (`postgres-data`) for persistent database storage
- MinIO volume (`minio-data`) for persistent S3 object storage
- Railway private networking for inter-service communication
- Postgres must be healthy before auth/storage/rest start (handled by startCommand wait loops)

## Architecture

```
┌─────────┐     ┌─────┐     ┌─────────────────────────────────┐
│  Client │────▶│ Kong│────▶│ auth / rest / realtime / storage│
└─────────┘     └─────┘     └─────────────────────────────────┘
                                  │
                    ┌─────────────┴─────────────┐
                    ▼                             ▼
              ┌──────────┐                ┌──────────┐
              │ postgres │                │  minio   │
              └──────────┘                └──────────┘
```

## Post-deploy setup

Your public Supabase URL is the Kong service domain:
```
https://.up.railway.app
```

### Service paths

| Feature | Kong path | Upstream |
|---|---|---|
| Auth | `/auth/v1/` | auth:8080 |
| REST | `/rest/v1/` | rest:8080 |
| Realtime | `/realtime/v1/` | realtime:8080 |
| Storage | `/storage/v1/` | storage:8080 |
| Health | `/health` | Kong request-termination plugin (200 OK) |

### Verify the stack

```bash
curl -sS "https:///health" -w "\nHTTP %{http_code}\n"
# expected: HTTP 200
```

### Connect with the JS client

```js
import { createClient } from '@supabase/supabase-js'
const supabase = createClient('https://.up.railway.app', '')
```

## Key design decisions

- **Postgres roles:** Custom entrypoint elevates `postgres` to SUPERUSER and creates `anon`, `authenticated`, `service_role` roles for migrations.
- **Kong DB-less:** Declarative config rendered at runtime from Railway private-domain env vars. `/health` route returns 200 via request-termination plugin.
- **Startup ordering:** auth and storage use startCommand wait loops (`nc -z`) to block until postgres (and minio for storage) are accepting TCP connections.
- **MinIO binding:** Forces `0.0.0.0:8080` for Railway healthcheck compatibility.
- **No SMTP:** `GOTRUE_MAILER_AUTOCONFIRM=true` auto-confirms emails. Set SMTP vars for real email.

## Troubleshooting

- **Services FAILED but logs fine:** Set `PORT` env var to match the app's listening port.
- **"permission denied for schema auth":** Check postgres logs — `ALTER ROLE postgres WITH SUPERUSER` must succeed.
- **Kong 404 on `/health`:** Don't change healthcheck path; entrypoint defines `/health` returning 200.
- **Realtime crashes:** Set `APP_NAME=realtime`.

## License

MIT. All upstream images retain their respective licenses.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/supabase-lite
