Self-hosting Supabase Docker vs PostgreSQL with NextAuth
user: tell me the difference between using on my server the Supabase Docker stack vs a lighter PostgreSQL + NextAuth setup
assistant: I’ll compare them as two self-hosting philosophies: “full backend platform” versus “just the pieces you need,” with special attention to RAM, operational complexity, auth, and future scaling.
assistant: The biggest difference is that **self-hosted Supabase is an entire backend platform**, while **PostgreSQL + Auth.js/NextAuth is a deliberately small application stack**.
For a server you control yourself, that distinction matters quite a bit.
| | Supabase Docker stack | PostgreSQL + Auth.js / NextAuth |
|---|---|---|
| Database | PostgreSQL | PostgreSQL |
| Authentication | Separate Supabase Auth service | Runs inside your Next.js app |
| REST API | Automatic PostgREST API | You build API routes/server actions |
| Realtime | Built in | Add yourself if needed |
| File storage | Built in | Add filesystem/S3/etc. |
| Image processing | imgproxy included | Add if needed |
| Admin UI | Supabase Studio | pgAdmin/Adminer/etc. optional |
| Edge functions | Supabase Edge Runtime | Next.js/server code |
| Connection pooling | Supavisor included | Optional PgBouncer |
| API gateway | Envoy | Usually Nginx → app |
| Containers/services | Many | Usually 2–4 |
| RAM requirement | Official minimum **4 GB**, 8 GB+ recommended | Potentially much lighter |
| Maintenance | Larger moving target | Much simpler |
| Flexibility | Supabase conventions | Total control |
Supabase's current self-hosted stack is pretty substantial. The default architecture includes PostgreSQL plus Auth, PostgREST, Realtime, Storage, imgproxy, postgres-meta, Studio, Edge Runtime, Supavisor, and an Envoy API gateway. Logs/analytics add still more components. Supabase currently specifies **4 GB RAM / 2 CPU cores as the minimum and recommends 8 GB+ / 4 cores** for the complete stack.
By comparison, a lightweight setup can literally be:
```text
Internet
│
Nginx
│
Next.js
├── Auth.js
│
└── PostgreSQL
```
Auth.js isn't another server in that architecture. It's part of your application. It handles things such as OAuth, credentials, magic links, passkeys, sessions, and database adapters, and it can store its users/accounts/sessions in your PostgreSQL database.
So instead of maintaining ten-ish c…
user: make an infographic about this for my blog
Showing first 4 of 5 messages. View the full conversation at https://mcwai.org/ai-conversation/self-hosting-supabase-docker-vs-postgresql-with