# Self-hosting Supabase: Postgres, Auth, Storage and what you actually operate

Self host Supabase as a Docker Compose stack. You operate Postgres, Auth, Storage, secrets, backups, and the public URL.

Canonical URL: https://unbroker.cloud/blog/self-host-supabase
Published: 2026-11-06
Reviewed: 2026-11-06
Author: Timoteo Borgobello

## The short answer

To self host Supabase is to run a Docker Compose stack, not one container. You operate the secrets, the backups, the upgrades, and the public URLs. Postgres data and Storage files have to survive a new container.

There is no Supabase template on Unbroker, and this note does not promise one. The templates that exist are on the [templates index](https://unbroker.cloud/templates). A smaller self-hosted app with its own Postgres is [self-host n8n](https://unbroker.cloud/blog/self-host-n8n). The map from a Compose file to services is [Docker Compose in production](https://unbroker.cloud/blog/docker-compose-to-production).

## What self-hosting Supabase is

Supabase's Docker guide is the source for the stack. The architecture list is Studio, Envoy, Auth, PostgREST, Realtime, Storage, imgproxy, postgres-meta, Postgres, Edge Runtime, and Supavisor. Logflare and Vector are not in the default configuration. Enabling them raises the resource need.

Envoy is the default API gateway. Kong is an optional override, not the gateway the default setup uses. The gateway listens on port 8000. REST, Auth, Storage, and Realtime are paths on that same gateway.

The guide's manual install clones a `self-hosted/v*` tag. The example on the page is `self-hosted/v0.8.4`. Read the guide again for the current tag. Images in one snapshot are tested together. Changing a single image tag is allowed, and compatibility is not guaranteed. That is the [self-hosting with Docker](https://supabase.com/docs/guides/self-hosting/docker) guide.

You can remove services you do not need, including Realtime, Storage, imgproxy, and Edge Runtime (`functions`), and drop their dependencies from the Compose file. That can lower the resource need. It also means those APIs are gone.

## What you operate

The example `.env` is not a configuration you start. Supabase says never to start the stack on those defaults. `generate-keys.sh` writes passwords and secrets. `add-new-auth-keys.sh` adds the API keys and the asymmetric JWT signing key pair. The values you pass to an application are `POSTGRES_PASSWORD`, `SUPABASE_PUBLISHABLE_KEY`, `SUPABASE_SECRET_KEY`, and `SUPABASE_PUBLIC_URL`. The secret key stays on the server.

Three URLs have to match how clients reach the stack:

```text
SUPABASE_PUBLIC_URL=http://example.com:8000
API_EXTERNAL_URL=http://example.com:8000/auth/v1
SITE_URL=http://example.com:3000
```

`SUPABASE_PUBLIC_URL` is the base URL for the dashboard, the API, and Storage. `API_EXTERNAL_URL` is what Auth uses for callback URLs. `SITE_URL` is Auth's default redirect. The Linux quick start also prompts for `PROXY_DOMAIN`. Behind a TLS proxy, the public URL is `https://` on port 443, not `:8000`.

Studio is HTTP basic auth. Set `DASHBOARD_PASSWORD` before the first start. The password needs at least one letter. Numbers only are rejected, and so are special characters. `DASHBOARD_USERNAME` is optional.

Self-hosted Supabase Postgres is the database those services share. Supabase Storage, when you self host it, stores files on the server filesystem by default, through a bind mount. An S3-compatible backend is a separate configuration, not the default.

## Postgres: an Apps node or managed Postgres

Unbroker has two database models. A database node in Apps is a private service from a database image. You own more of the engine: upgrades, users, and recovery of its volume. A managed database is a provider-operated cluster. The comparison is [Choose a database model](https://docs.unbroker.cloud/databases/choose).

The Postgres container in the Supabase Compose file is the first kind. Schema migration scripts are mounted at `/docker-entrypoint-initdb.d` and run when that container starts. Auth, Storage, Realtime, and PostgREST expect that database, its roles, and its extensions. Managed Postgres is not a drop-in replacement for that container. It is a cluster you provision for application data, with its own plan and connection details.

Managed Postgres requires Pro. The smallest catalogue plan is 1 vCPU, 1 GB of RAM, and 10 GB of storage, up to 30 GB on that plan, at $21.21 per month. Extra storage on a plan is $0.30 per GB-month. Pro is $25 per month with $25 of usage credit, and the cluster price is separate. Free does not include managed databases. The 1 GB plan is a single node. Standby nodes need a plan with at least 2 GB of RAM. Read the quoted price in the create flow. The plan list is [managed Postgres](https://unbroker.cloud/managed-databases/postgres). Operating the database you keep is [Postgres in production](https://unbroker.cloud/blog/postgres-in-production).

## Volumes for Postgres and Storage

The uninstall script deletes the Postgres data directory `volumes/db/data` and the Storage data in `volumes/storage`. Those are the two stores that have to outlive a container.

On Unbroker a volume belongs to one service and mounts at one absolute path. It can grow, up to 50 GB, and it cannot shrink. Growing it does not restart the service. Deleting the service deletes the volume and its data. A service with a volume runs one replica. Files outside the volume are temporary, because a deploy, a restart, or a reschedule can replace the container.

A volume is not a backup. Cloud Apps can send volume backups to an S3-compatible destination you control. Restore is a separate action, and you confirm it with the service name. The rules are [persistent storage](https://docs.unbroker.cloud/apps/storage) and [persistent storage and volumes](https://unbroker.cloud/blog/persistent-storage-volumes).

## The gateway, Studio, and public URLs

Publish the gateway. Leave the rest private. Studio opens through the gateway on port 8000, and the APIs are paths on that same port: `/rest/v1/`, `/auth/v1/`, `/storage/v1/`, and `/realtime/v1/`. A private service has no public URL. Another service in the same environment uses that service's host and port. A preview cannot reach production.

Supabase's guide puts a reverse proxy in front of the gateway when you need HTTPS. On Unbroker, a custom domain and managed TLS require Pro. The default hostname stays. The steps are [custom domain and HTTPS](https://unbroker.cloud/blog/custom-domain-https). Put the URL clients actually use into `SUPABASE_PUBLIC_URL`, `API_EXTERNAL_URL`, and `SITE_URL`. Do not ship the example secrets in that same file.

## Minimum resources

Supabase's Docker guide gives a minimum for running every component, for development and for small to medium production:

| Resource | Minimum | Recommended |
| --- | --- | --- |
| RAM | 4 GB | 8 GB+ |
| CPU | 2 cores | 4 cores+ |
| Disk | 40 GB SSD | 80 GB+ SSD |

Those figures are Supabase's, for that Compose install on one machine. They are not an Unbroker server size. Dropping services you do not run can reduce what the stack needs. Turning on Logs and Analytics adds Logflare and Vector and raises the need.

## Run it on Unbroker

Map the Compose file the way [Docker Compose in production](https://unbroker.cloud/blog/docker-compose-to-production) maps any file: one service per piece, secrets in environment variables, and only the gateway public. An image service pulls a pinned tag or a digest and runs one replica. Prefer the tag from the snapshot you tested. The Docker walkthrough is [Deploy a Docker container](https://docs.unbroker.cloud/guides/deploy-docker).

Pasting a Compose file creates one service per entry for images, environment, ports, commands, and one volume per service. It does not decide what is public, and it does not turn the Supabase Postgres container into a managed cluster. Review every service after a paste.

Free cannot run this stack. Container images, Dockerfile builds, persistent volumes, and managed databases are Pro. Custom domains are Pro. Free services run on the serverless runtime, which does not include images, Dockerfiles, volumes, or private networking. Pro is $25 per month with $25 of usage credit. The credit does not roll over. If usage stays under the credit, the charge is still $25. Current figures are on [pricing](https://unbroker.cloud/pricing). Plan rows are in [Plans](https://docs.unbroker.cloud/billing/plans).

If the Compose file has to stay one machine you operate, that host is a [Linux cloud server](https://unbroker.cloud/cloud-servers). This note does not pick a size for it. Supabase's minimums above are the requirements in their guide, not a catalogue row.

## Backups, upgrades, and secret rotation

`reset.sh` stops the stack, removes Docker volumes, and deletes Postgres data and Storage files. Treat that as uninstall, not as a backup.

Back up the Postgres volume and the Storage volume, and restore one of each before you depend on them. Rotating a key without a copy of the data does not bring the files back. If the app was generated elsewhere and the database is still on hosted Supabase, the access rules stay on that project. That split is [an AI-built app in production](https://unbroker.cloud/blog/ai-built-app-to-production).

Upgrades follow Supabase's `update.sh`, which merges a newer `self-hosted/v*` snapshot over the files you have. To move one service, change its image tag, pull, and recreate that service. The guide's Studio example is a tag shaped like `2026.04.27-sha-5f60601`. Pin the tag you mean to run. A newer tag on Docker Hub is not automatically the snapshot the rest of the stack was tested with.

API keys live in `.env`, not in a dashboard rotation. `rotate-new-api-keys.sh --update-env` rotates `SUPABASE_PUBLISHABLE_KEY` and `SUPABASE_SECRET_KEY` without changing the asymmetric signing key pair, then you recreate the services and update the applications. That rotation does not invalidate existing user session tokens. Regenerating the asymmetric key pair does affect active sessions. `db-passwd.sh` changes the database password and rewrites `.env`. After it, recreate the stack.

## Checklist

1. Start from the Docker guide's current `self-hosted/v*` tag, not from the example secrets.
2. Run the key scripts before the first start. Set a Studio password that contains a letter and no special characters.
3. Set `SUPABASE_PUBLIC_URL`, `API_EXTERNAL_URL`, and `SITE_URL` to the URLs clients use.
4. Keep Postgres data and Storage files on volumes. Back them up to storage you control, and restore once.
5. Publish the gateway. Keep the other services private.
6. Pin each image to the tag or digest you tested with the rest of the stack.
7. Use Pro. Images, Dockerfiles, volumes, custom domains, and managed databases are not on Free.
8. Do not point the stack at managed Postgres and expect the Compose database's roles and init scripts to be there.

## FAQ

### What do you need to self host Supabase?

The official Docker Compose stack, secrets you generate instead of the example .env, public URLs for Auth and the API, and durable storage for Postgres and for Storage files. On Unbroker that means Pro, because container images, Dockerfiles, and persistent volumes are not on Free.

### Is self-hosted Supabase a single container?

No. Supabase's Docker guide describes a stack: Studio, the API gateway, Auth, PostgREST, Realtime, Storage, imgproxy, postgres-meta, Postgres, Edge Runtime, and Supavisor. Logflare and Vector are optional and off by default.

### Which services are in the Docker stack?

The architecture list is Studio, Envoy as the default gateway, Auth, PostgREST, Realtime, Storage, imgproxy, postgres-meta, Postgres, Edge Runtime, and Supavisor. Kong is an optional gateway override, not the default. You can remove services you do not need, such as Realtime, Storage, imgproxy, or Edge Runtime.

### Is there a one-click Supabase template on Unbroker?

No. There is no Supabase template. The templates that exist are listed on the templates index. The n8n template is a different product. Do not look for a Supabase deploy button.

### Can you self host Supabase on the Free plan?

No. Free does not include container images, Dockerfile builds, persistent volumes, custom domains, or managed databases. Free services use the serverless runtime, which does not include private networking. Pro is $25 per month with $25 of usage credit.

### Should Supabase Postgres be an Apps node or managed Postgres?

The Postgres container in the Compose file is an Apps database node: an image, a volume, and recovery you operate. Managed Postgres is a separate provider-operated cluster, from $21.21 per month for 1 vCPU, 1 GB of RAM, and 10 GB. It is not a drop-in replacement for that Compose database, which is initialized with Supabase's roles, extensions, and scripts.

### What has to persist?

Postgres data and Storage files. The Compose uninstall deletes volumes/db/data and volumes/storage. On Unbroker each of those belongs on a volume. A volume is not a backup. Backups go to an S3-compatible destination you control, and you should restore one before you trust it.

### What are the minimum requirements?

Supabase's Docker guide lists 4 GB of RAM, 2 CPU cores, and a 40 GB SSD as the minimum for every component, and 8 GB of RAM, 4 cores, and an 80 GB SSD as the recommendation. Those numbers are for that install. Removing services you do not need can lower them. This page does not map them onto a server size.

### Is Kong still the default API gateway?

No. Envoy is the default API gateway. Kong is an optional override. Studio and the APIs are reached through that gateway on port 8000.

### How is self-hosting different from hosted Supabase?

On the hosted platform, Supabase operates the stack. Self-hosted, you operate the host, the secrets, the backups, the upgrades, and the public URLs. If the database stays on hosted Supabase, its access rules stay there. This page does not compare prices.

## Related reading

- [Self-host n8n](https://unbroker.cloud/blog/self-host-n8n)
- [Docker Compose in production](https://unbroker.cloud/blog/docker-compose-to-production)
- [Postgres in production](https://unbroker.cloud/blog/postgres-in-production)
- [Persistent storage and volumes](https://unbroker.cloud/blog/persistent-storage-volumes)
- [Managed Postgres](https://unbroker.cloud/managed-databases/postgres)
- [Pricing](https://unbroker.cloud/pricing)
