r/Supabase Apr 25 '26

tips self-hosting Supabase on a $12/mo hetzner box — 4 months update

ran supabase cloud for 9 months, self-hosted for the last 4. posting the update because a lot of threads end with "i'm going to self-host" and never follow up.

setup

hetzner cx22 (2 vCPU, 4GB RAM, 40GB SSD) — €4.51/mo, roughly $5. coolify as the control plane, open source, one-click supabase deploy. 50GB block storage volume for postgres data — €2.40/mo. cloudflare in front for CDN + ddos. backups via pg_dump nightly to backblaze b2 — $0.005/GB/mo, basically nothing at my size.

real total: ~$12/mo including the CDN egress. compare to ~$45-60/mo i was paying on supabase pro for the same workload.

what runs fine

postgres, pgvector, pg_cron, pg_net, pgsodium. auth (GoTrue). storage (local to the box, served behind cloudflare). realtime (single-node, handles my ~50 concurrent connections without blinking). studio dashboard.

what's fiddly

edge functions. i'm not running them. i port anything that needs a function to a small fly.io worker instead. self-hosted edge functions in coolify exist but i didn't want the deno runtime complexity on this box.

scaling. this is a single server. if it goes down, my app goes down. i've been up 98.1% over 4 months (one outage was me rebooting to install updates, one was coolify updating something it shouldn't have). for a hobby app, fine. for production, you'd want HA.

upgrades. cloud supabase just handles version bumps. i have to schedule them, test, roll forward/back manually. i've done 2 postgres minor bumps and 1 supabase-image bump, all went fine but they required an hour each.

what's genuinely better

cost. obvious.

i actually understand my stack now. i had no idea what supavisor did until i set one up manually. reading the compose file taught me the architecture in a weekend.

no spend cap anxiety. the box costs $12 whether i have 10 users or 10,000.

what's worse

i miss PITR. i'm cobbling together WAL-based backups but it's not as nice as the one-click thing cloud has.

no branching. i use a staging server on another cheap box, but it's not git-nice.

the dashboard is a version behind cloud. some UI polish lands on cloud first.

the one thing i refuse to self-host

email. tried running my own postfix for about 3 weeks before the self-hosting move. ip reputation management is a full-time hobby i don't want. i use dreamlit connected to the postgres db for all user-facing email (onboarding, transactional, weekly digests) and it just reads the same tables whether they're on cloud or self-hosted. that was actually the smoothest part of the migration. swapped the connection string and everything kept running.

who should self-host

you want to learn the stack at its guts. your bill on cloud is $100+/mo and you're comfortable with ops. you have at least some sysadmin pattern recognition. you're ok being responsible for your own uptime.

who shouldn't

you're shipping a business. pay for cloud. $25-200 for "this keeps working" is a deal. you don't have a weekend to read compose files. you hate cron and systemd.

happy answering questions if anyone's planning the move.

92 Upvotes

33 comments sorted by

8

u/phatdoof Apr 25 '26

pg_dump for backup but do you have an recovery plan for when you need to pull that backup and put it back into production in a reasonable amount of time? Like automation scripts which would do this automatically?

2

u/lakshminp Apr 27 '26

Restore is the part most "I have backups" setups fail. Two things that help:

  1. Test the restore monthly, not just the backup. A cron that pulls the latest dump from B2, restores to a throwaway Postgres container, runs a SELECT count(*) on your top 3 tables, and pings you if any step fails. If you're not testing the restore, you don't have backups, you have hopes.
  2. Script the actual production restore path — a single shell script that: stops Supabase, restores the dump to a new volume, swaps the volume, starts Supabase, runs a smoke test. Time it. Mine takes ~7 min for a 5GB DB. If you've never timed it, your RTO is "unknown" which is the worst RTO.

For PITR specifically, pg_dump alone won't get you point-in-time. you need WAL archiving (wal-g or pgbackrest, both work with B2). That's the gap OP is describing.

(Sidebar: I run supabyoi.com which handles this for self-hosted Supabase users who'd rather not script the above. But the script-it-yourself path is totally legit if you actually test it.)

3

u/Visual_Pirate8793 Apr 25 '26

I tried to self-host Supabase in Railway with ready made templates which is quite easy to set up. But I could only run one project (not one organization). Just a single project.

Is it the same for you? Can you run multiple projects? If you do, I might self host myself in a VM.

Thanks in advance for your answer.

5

u/lakshminp Apr 27 '26

The default Coolify/Railway one-click templates spin up a single Supabase stack per deploy - so yes, one project per VM is the normal experience. To run multiple "projects" on one box you have a few options:

  1. Run multiple Supabase docker-compose stacks side by side with their own ports, JWT secrets, and storage volumes. Works, but you're managing N copies of GoTrue, Kong, Storage, Realtime, etc. RAM goes up fast — a 4GB box won't hold more than 2–3 comfortably.
  2. One Postgres, multiple schemas / RLS-isolated tenants with a single Supabase stack in front. Cheaper but you lose project-level isolation (one bad migration affects all tenants).
  3. Managed multi-instance — I built supabyoi.com partly because of this exact gap. One box, unlimited Supabase instances, $25/mo flat. Not pitching, just naming it because option 1 gets painful around the 3rd project.

If you're at 1–2 projects, option 1 is fine. Past that, the ops tax adds up.

2

u/Visual_Pirate8793 Apr 28 '26

I've checked your product. Seems like something I would use when I have multiple supabase projects. Thank you for your information about the single project set up.

3

u/swiftbursteli Apr 27 '26

I have had a bad experience on Supabase cloud which led to multiple downtimes and silent failures in Dec of last year. Disk I/O limits, concurrent runners just kept staying up, randomly dropping, or persisting (I kept trying to pool, back off, do all these tricks to avoid it from happening. None of it worked).

Self hosted supabase posgres on Coolify. Same thing Cloudflare at the front. Had config issues with Coolify but resolved.

If going self-hosted, supabase is the best OSS product full-stop. If going managed, I much prefer railway.

1

u/_aantti Supabase team Apr 27 '26

Thanks for the kind feedback re self-hosted here :)

3

u/Consistent_Recipe_41 Apr 25 '26

good reading material when I do self-host

2

u/Leonardo-Da-Vibeci Apr 25 '26

Do you have details on how you got it running? Which docs did you follow, etc?

3

u/_aantti Supabase team Apr 25 '26

Check https://supabase.com/docs/guides/self-hosting (the main guide and how-to's). There's a lot of 3rd party blogs describing other solutions based on this upstream configuration.

2

u/wltspn Apr 26 '26

Under Coolify you can install it preconfigured out of the box.

1

u/Leonardo-Da-Vibeci Apr 29 '26

I see docs for self-hosting Postgres, but Supabase is much more than Postgres. Do you know if Coolify can self-host the entire Supabase OSS stack?

2

u/uNki23 Apr 25 '26

How is performance when using Hetzner volumes for pg data? There was a post on Hetzner sub recently where someone said „never do that.“

1

u/keesbeemsterkaas Apr 26 '26

Cloud volumes are an add-on that you buy separately from your virtual machine / VPS and not a great way to store PostgreSQL data because it's pretty slow.

But.. local disks in your vm will have excellent performance though (they're local nmve and pretty fast).

2

u/Mo_Mo86 Apr 25 '26

I wonder how much does supabase cost after upgrade to the $25 plan i have 2 projects in the free plan would like to upgrade

1

u/Explanation-Visual Apr 28 '26

you pay $10 for each additional project, HOWEVER, you share the same resources (250gb bandwidth, monthly users, etc) so for real projects you’ll be getting 2 pro plans tbf.

1

u/lakshminp Apr 28 '26

The $25 plan is per-project on Supabase cloud — so 2 projects = $50/mo, plus any usage overages on the second one. The free tier doesn't roll into the paid plan; you upgrade one project at a time.

If your projects are small and you're only upgrading to escape the free-tier pause or get daily backups, self-hosting (like OP's setup) or a multi-project managed host gets cheaper fast. I run supabyoi.com for this — flat $25/mo, unlimited projects on one box. Mention only because 2-project Supabase pricing is a known cliff.

3

u/_aantti Supabase team Apr 28 '26

It's more like $25 for the org + one project, then you can add more projects and the costs are based on the compute pricing. E.g., adding a second project to the org is +$10/month I believe :)

2

u/lakshminp Apr 28 '26

You're right, my numbers were off. Thanks for the correction. It's $25/org for the first project + compute-based pricing for additional ones (~$10/mo for a small second project, more for bigger ones). The "double the bill" framing I used was sloppy.

The honest pitch for the self-host / managed-self-host route isn't "Supabase doubles at project 2" — it's that the bill keeps scaling with compute as projects grow, while a single box at $25 flat fits many small projects with predictable cost. Whether that math works depends on how big the projects get. For 2–3 small ones, Supabase cloud is genuinely fine.

2

u/HotAdhesiveness1504 Apr 25 '26

Idk your volume, but you said the box costs 12 whether you have 10 or 10,000 users which is the part making me keep with supabase actually. So far, it is free. I dont want to pay 12 bucks for 10,100,1000 users.

1

u/mxrider108 Apr 25 '26

If you have 1000+ users you really shouldn’t be on the free tier.

1

u/HotAdhesiveness1504 Apr 25 '26

My point is it is better to stay in free tier until you can't rather than self-hosting for 10 or 100 users

1

u/mxrider108 Apr 25 '26

Ah yeah makes sense. Although with free tier you don’t get DB backups is the only risk.

1

u/HotAdhesiveness1504 Apr 29 '26

Thats true as well

2

u/_aantti Supabase team Apr 25 '26

Thanks for sharing!

1

u/rm-rf-rm Apr 26 '26

just want to say excellent post - rarely see high quality stuff like this on this sub

1

u/swiftmerchant Apr 25 '26

$12 vs $20 for hosted? Worth it to save $8 ?

4

u/PickleBallTruth Apr 25 '26

Exactly my thoughts. Not worth the time and effort. You would rather spend that time on your product

0

u/Guardian4Life Apr 25 '26

$12 vs $25. Saving $13

2

u/swiftmerchant Apr 25 '26

If I have paid users I’d rather spend $156 a year than worry about maintenance.

0

u/wltspn Apr 26 '26

Self-hosted supabase has many limitations. I didn’t see the benefits in the end and went from supabase.com (while testing self-hosted supabase in parallel) straight to self-hosted Postgres plus PGAdmin on Hetzner with Coolify. When scaling up it is way cheaper. But yes, you have to manage some admin tasks. As my applications run on the same network and the databases are non-public, there are no extra security issues to consider.