Migrate Supabase Cloud to self-hosted: what really moves
The official guide covers the database and users, not Storage, Edge Functions or secrets. A full checklist for leaving Supabase Cloud, plus a guided route.
Migrating from Supabase Cloud to a self-hosted Supabase is a database dump plus six things the dump does not carry: Storage files, Edge Functions, secrets, sign-in provider and email settings, custom role passwords and the API keys. Supabase’s own restore guide covers the database, roles, policies, functions, triggers and auth users. It says Storage objects are not covered, Edge Functions must be copied by hand, and JWT secrets, API keys, provider settings and SMTP settings must be set again. This post puts all of that in one checklist, covers the Postgres version trap, and shows how Aria Cloud’s guided move handles the rest. Nothing in your old project is changed or deleted.
We build Aria Cloud, which runs self-hosted Supabase for you, and we recommend it for this move. The steps below also work on any self-hosted Supabase. Facts last checked 31 October 2026.
What moves and what does not?
| Piece | What the official guide says | What to do |
|---|---|---|
| Schema, data, RLS policies, functions, triggers | Moved by the database dump | Dump and restore, rehearsed first |
| Roles | Dumped to a separate roles file | Restore the roles file first |
| Custom role passwords | Roles with LOGIN have passwords left out of the dump |
Set each again with ALTER ROLE |
| Auth users | Preserved in auth.users |
Check a few sign-ins after the move |
| Existing sessions and tokens | The JWT secret differs, so tokens are not valid | People sign in again once |
| JWT secret and API keys | Generate new ones | Update your app’s URL and keys |
| Storage objects | “Not covered here” | Copy files across with a script |
| Edge Functions | Copy them to the self-hosted instance by hand | Redeploy from your repository, with their secrets |
| OAuth provider settings | Set GOTRUE_EXTERNAL_* variables |
Configure again, and update redirect URLs from *.supabase.co to your host |
| SMTP settings | Set SMTP_* variables |
Configure again with a real provider |
| Custom domains and DNS | Point DNS at the new server | Do it at cutover |
| Postgres version | The platform may run 17 while self-hosted defaults to 15 | Match the versions; see below |
What should you do before you start?
- Take an inventory. List your Storage buckets, Edge Functions and their secrets, OAuth providers, SMTP settings, cron jobs, webhooks and Postgres extensions.
- Check the Postgres version on both sides. Run
select version();on the old project and on the new one. - Stand up the target first. It should be healthy and reachable over HTTPS before you touch production traffic. Supabase’s minimum is 4 GB of RAM and it recommends 8 GB or more, plus your app (requirements).
- Rehearse on a throwaway. The official guide says to run the restore on a test instance first to find incompatibilities.
How do you move it, step by step?
These are the steps in Move from Supabase Cloud to Aria, which has your own addresses filled in. They use the Supabase CLI and psql.
1. Dump the database. Use the Session pooler connection string from the Connect button in the Supabase dashboard:
supabase db dump --db-url "$OLD_DB_URL" -f roles.sql --role-only
supabase db dump --db-url "$OLD_DB_URL" -f schema.sql
supabase db dump --db-url "$OLD_DB_URL" -f data.sql --use-copy --data-only
The data file includes auth.users, with password hashes, so people keep their logins.
2. Load it into one transaction. Either everything loads or nothing does. On Aria, aria db url --database main --owner gives a temporary owner login that you approve in the app, and the move guide prints the exact psql command with the right role name for your database:
export ARIA_DB_URL="$(aria db url --database main --owner)"
psql --single-transaction --variable ON_ERROR_STOP=1 \
--command 'SET ROLE postgres' \
--file roles.sql --file schema.sql \
--command 'SET session_replication_role = replica' \
--file data.sql --dbname "$ARIA_DB_URL"
On another self-hosted setup, use the equivalent psql command from Supabase’s restore guide. Load the dump with psql, as shown. Do not paste it into a repository seed.sql: Aria runs the SQL files in your repository without psql, so COPY ... FROM stdin blocks are refused.
3. Set the role passwords again. For each custom role that can log in, run ALTER ROLE ... PASSWORD ....
4. Copy the Storage files. The dump brings the bucket list and each file’s record, but not the files. Aria’s guide gives you a script, copy-storage.mjs, that reads the old project and writes to the new one through both Storage APIs. It is safe to run again. Supabase’s guide leaves this step to you, so on a plain self-hosted target you write or run your own copy.
5. Redeploy the Edge Functions and their secrets. Self-hosted functions live as files in a directory, volumes/functions/<name>/index.ts (self-hosted functions). On Aria, commit them under supabase/functions and list their secrets in aria.yaml.
6. Recreate sign-in settings. Add OAuth providers, SMTP and email templates. On Aria these come from your repository, in supabase/config.toml and the auth.smtp block, so they survive every redeploy. Provider secrets are read with env(NAME). Update the redirect URLs in Google, GitHub or Apple to your new address.
7. Cut over. Pause writes briefly, run a final dump and load, switch your app’s SUPABASE_URL and keys, point DNS, and test sign-in, a file download and a function call. Keep the old project running until you are sure. That is your rollback.
What is the Postgres version trap?
The platform may run Postgres 17 while the self-hosted Docker image defaults to Postgres 15. A dump from 17 can contain things version 15 refuses. The official guide gives examples: SET transaction_timeout = 0, a Postgres 17-only setting that fails on 15 (comment it out), COPY statements for tables missing on the self-hosted side such as auth.oauth_clients and storage.buckets_vectors, and auth.flow_state columns from newer Auth versions. It suggests starting the self-hosted instance on Postgres 17 if your project uses it, and running the restore once without --single-transaction to see all the failures before the final run.
On Aria, check the target with select version(); before you load, in the same way. Aria’s Supabase image was Postgres 17 when we checked its configuration, but confirm it on your own project.
What does Aria’s guided move cover?
Only what exists:
- One line in
aria.yamlturns on the official self-hosted Supabase, included at no extra cost. - A guide in the app, under Database, then Move from Supabase Cloud, with your addresses filled in, and a prompt you can give your coding agent.
- A Storage copy script and auth settings that live in your repository.
- Nothing in your old project is changed.
Not copied: the API keys and JWT secret (people sign in again once), cron jobs and webhooks that call outside addresses, and rate limits, MFA, CAPTCHA and SMS settings, which Aria cannot apply yet. See Supabase on Aria for what it applies. A server with Supabase needs Developer (£25 a month ex VAT) or larger, and nightly encrypted backups that include Storage files are stored off the server (backups). Compare the two in Aria versus Supabase Cloud.
Why move to Aria Cloud?
Supabase Cloud’s Pro plan starts at $25 a month with daily backups kept for 7 days (pricing). On Aria Cloud, Supabase is included at no extra cost on a flat-price server, with nightly encrypted backups stored off the server, and your app and Supabase share one machine. Read the self-hosting guide for the options by situation, and the production checklist before you cut over real users.
FAQ
Do users keep their passwords?
Yes. Auth users and their password hashes live in auth.users, which the dump carries. But the JWT secret differs on the new server, so existing sessions and tokens stop working and people sign in once more.
Does pg_dump move my Storage files?
No. The dump copies bucket definitions and file records, not the files. Copy the files across separately.
What about Edge Functions?
Copy them yourself on a plain self-hosted setup. On Aria, commit them under supabase/functions and they are deployed from your repository, with their secrets listed in aria.yaml.
Which Postgres version should I use?
The same as the platform runs, if you can. Check with select version();. A 17 dump can fail on a 15 target.
What changes in my app?
The project URL and the API keys. The @supabase/supabase-js client keeps working. Search your code for hard-coded Supabase Cloud addresses.
How do I roll back?
Leave the old project untouched, point your app back at it, and switch DNS back. That is why you keep it running until you trust the new one.
How much server do I need?
Supabase lists 4 GB as the minimum and recommends 8 GB or more, before your app. On Aria, start on Developer.
Ready to move? Follow the exact steps in Move from Supabase Cloud to Aria, see pricing, or get started.
Keep reading
Self-hosted Supabase in production: the checklist
What the official Supabase Docker guide leaves to you: secrets, HTTPS, email, backups, upgrades and monitoring. A checklist with the commands that matter.
Supabase self-hosting requirements: RAM, CPU and cost
Official minimum: 4 GB RAM, 2 cores, 40 GB disk. Recommended: 8 GB, 4 cores, 80 GB. What that means for a real server, and what it costs against Cloud.
Where should you deploy your app and database?
Vercel, Railway, Render, Fly.io, a VPS or a managed server? Dated prices, clear trade-offs, and why Aria Cloud is the best home for an app and database.
Your own cloud. Without the DevOps.
One server that’s yours alone, set up and run by Aria, at one flat monthly price.