Skip to main content
#guide2 min read
views

Manually Backup Supabase Postgres Database

Amir Ardalan

What Is This For?

Important

This post is quite old and is no longer being updated. The following information may not work with the latest versions of the tools, libraries, frameworks, or best practices discussed.

Supabase's free-tier Postgres offering does not include built-in backups. If you need to create a quick copy of your database, you can manually back it up using a simple pg_dump command.

Note

This guide assumes that you have a free-tier Postgres database hosted on Supabase.

Install Postgres

brew install postgresql
bash

Refer to the official documentation for more detailed installation instructions. It also includes information about switching versions if your local Postgres version does not match the version used by your database.

Create a Backup Command

Open the Supabase Dashboard, select your database, and click Connect to find the details required for the command.

Use the parameters from the Session Pooler connection string so that the connection uses IPv4. Click View parameters under Session Pooler to locate the required values.

pg_dump postgresql://[user]:[password]@[host]:[port]/[database] > your_db_backup.sql
bash

Run the Command

Once you have filled in the connection details, run the command in Terminal.

The backup file will be created in the directory from which you run the command. This can also serve as a starting point if you later decide to automate your backups.

Enjoyed this? Like or share.