Transferring from platform to self-hosted Supabase

Last edited: 2/17/2026

For a detailed, step-by-step guide on restoring your database from the Supabase platform to a self-hosted Supabase instance, see Restore a Platform Project to Self-Hosted.

Quick reference

Back up your cloud database:

1
supabase db dump --db-url "[CONNECTION_STRING]" -f roles.sql --role-only
1
supabase db dump --db-url "[CONNECTION_STRING]" -f schema.sql
1
supabase db dump --db-url "[CONNECTION_STRING]" -f data.sql --use-copy --data-only

Restore to your self-hosted instance:

1
psql \
2
--single-transaction \
3
--variable ON_ERROR_STOP=1 \
4
--file roles.sql \
5
--file schema.sql \
6
--command 'SET session_replication_role = replica' \
7
--file data.sql \
8
--dbname "postgres://postgres.your-tenant-id:[POSTGRES_PASSWORD]@[your-domain]:5432/postgres"