supabase
How to self-host Supabase for your app's backend
A plain-English guide to what self-hosting Supabase means, what you need, and where the sharp edges are before you use it for an app backend.
You want the useful parts of Supabase without handing your app’s whole backend to someone else, but the moment you look up “self host supabase,” you run into a pile of services, ports, secrets, and warnings.
Short version: to self-host Supabase, you run the Supabase stack on your own server, usually with Docker, and expose the parts your app needs through a domain with HTTPS. The hard part is not starting it once; it is keeping PostgreSQL, Auth, Storage, Realtime, backups, updates, and access rules understandable and healthy over time.
What does it mean to self-host Supabase?
Supabase is a backend platform built around PostgreSQL, the database at the center of the system. Around that database, it adds common app-backend pieces: user login, file storage, real-time updates, an API layer, and an admin dashboard.
When you self-host Supabase, you move those pieces onto your own server. Think of it like running your own small restaurant kitchen instead of ordering from a shared food hall. You get control over the ingredients, the layout, and the keys to the back door. You also become responsible for the fridge, the locks, the cleaning, and the fire alarm.
This is different from just hosting a simple web app. Supabase is a group of services that must agree with each other. If one address, password, certificate, or storage path is wrong, the whole thing can look “up” while login, file uploads, or database access quietly fail.
If Docker is still new to you, it helps to treat it as a way to run each part in its own labeled box. We explain that idea in plain English in Docker on a server for beginners.
What do you need before you self-host Supabase?
You need a server with enough room for the database, file uploads, logs, and temporary spikes. Supabase is not just a landing page; it is a backend that may hold your users, sessions, images, events, and app data.
At minimum, you should have a domain name, HTTPS, a firewall, and a backup plan before real users depend on it. The domain is the street address. HTTPS is the sealed envelope around traffic. The firewall is the locked front door. Backups are the spare key and photocopy of your notebook after something spills.
You also need to decide what kind of app this backend supports. A private internal tool with a few users is very different from a public app with file uploads, password resets, and live updates. If you are unsure about sizing, start with the shape of your workload: how much data, how many users, how many uploads, and how painful downtime would be. Our guide on what size server you need walks through CPU, RAM, and storage without assuming you are a sysadmin.
The most important requirement is not hardware. It is clarity. You need to know where data lives, which services are public, which ones stay private, and how to restore the system if the server disappears tomorrow.
How do the Supabase pieces fit together?
A self-hosted Supabase setup is more like an apartment building than a single house. PostgreSQL is the foundation. Most of the value sits there: tables, rows, permissions, and the data your app cannot afford to lose.
Supabase Auth handles users and sessions. Storage handles files. Realtime listens for database changes and pushes updates to your app. The API layer turns database access into web requests. Supabase Studio is the admin screen where you inspect and manage the setup.
These pieces need shared secrets, internal addresses, and the right public entry point. A reverse proxy usually stands at the front, like a reception desk, sending traffic to the right room. Your app should not talk directly to every internal service. It should use the public API addresses you intentionally expose.
This is where many installs get messy. A project may work on the first day, then break later because a certificate expires, a secret was copied into the wrong place, a storage volume was not kept, or an update changed how services expect to talk. Self-hosting Supabase is less about one heroic install and more about keeping the map readable.
Is self-hosting Supabase safe for a real app?
It can be, but only if you treat it like real infrastructure. The danger is not that Supabase is unusual. The danger is that it combines several sensitive jobs in one place: database access, user identity, file storage, and public web traffic.
PostgreSQL should not be casually exposed to the internet. Admin screens should not be left open with weak passwords. API keys and JWT secrets, which are the strings used to sign and trust requests, must be protected. HTTPS must be correct, not “mostly working.” If your browser warns about the certificate, your users’ apps may fail in less obvious ways too.
Backups deserve special attention. A backup is not a backup until you know you can restore it. For Supabase, that means thinking about the database and uploaded files together. Restoring only one side can leave your app with database rows pointing at missing files, like a library catalog for books that are no longer on the shelves.
Before a real launch, read through how to back up your server and actually restore it. For Supabase, this is not optional housekeeping. It is part of the backend.
The shortcut
Server Manager helps by keeping the setup legible instead of turning it into a private maze of notes, half-remembered paths, and one-off fixes. The outcome you want is simple: your Supabase stack has a clear home, the public entry points are understandable, and you are less likely to forget which part owns the database, files, HTTPS, or routing.
That matters for the exact failure modes that make self-hosted Supabase stressful: a wrong or expired certificate breaking Auth callbacks, one project’s routing confusing another project, storage living somewhere no one remembers, or a backend that works today but is impossible to explain six months later.
The real benefit is that your app backend stays understandable as it grows. When you come back to fix login, check storage, or move the project, you are not starting from archaeology.
FAQ
Can I self-host Supabase for production? Yes, if you handle security, backups, updates, HTTPS, and monitoring seriously. It is not a set-and-forget install.
Do I need Docker to self-host Supabase? In practice, yes for most people. The official self-hosted setup is built around running multiple services together, and Docker keeps those parts separated.
Is self-hosted Supabase cheaper than hosted Supabase? It can be, especially for predictable workloads, but you pay with maintenance time and responsibility. The server bill is only one part of the cost.
What breaks most often? Common pain points are wrong environment values, broken HTTPS, missing storage volumes, weak backup plans, and services that cannot reach each other internally.
Can I move from self-hosted Supabase later? Usually, but plan for it early. Keep your database, files, and secrets organized so migration is a project, not a rescue mission.
Self-hosting Supabase gives you control over your app’s backend, but control is only useful when the system stays clear. If you know where the data lives, how traffic enters, what must be backed up, and how the pieces depend on each other, you can run Supabase without turning your backend into a black box.