Skip to main content

Self-hosted Supabase backup and restore: Postgres and Storage on an 8 GB VM

Updated 3 min readMarkdown

A successful PostgreSQL restore can leave a Supabase application with working database queries and missing files. Supabase's database backup documentation explains why: database backups contain object metadata, not the actual Storage objects. If you run Supabase yourself, proving that those two parts can be recovered together is a separate job.

On November 18, 2026, we rehearsed that recovery in an isolated MOTSELL Engineering lab. The Linux ARM64 VM had four virtual CPUs, 8 GiB of configured RAM and an 80 GiB disk. We used the upstream Docker configuration at commit 3da15da, recording the image digests before recovery.

What went into the backup

We first created a synthetic database row and uploaded two objects to a private bucket: a 37-byte text file and a 65,536-byte binary file. Both were readable through the Storage API with authorized credentials, inaccessible to anonymous requests, and matched their original bytes.

For this cold-backup rehearsal, we stopped the source Compose services before archiving anything. Ordinary filesystem copies of a running PostgreSQL data directory are unsafe; see PostgreSQL's filesystem-level backup guidance.

The backup contained:

  • The Compose configuration and .env, including the configuration and keys needed by the application.
  • The PostgreSQL data directory and the default file-backed Storage directory under volumes.
  • The separate named PostgreSQL configuration volume mounted at /etc/postgresql-custom.

We preserved archive ownership and permissions, restricted access to the archives, and recorded SHA-256 checksums. In a real deployment, encrypt these sensitive backups and keep independent copies off the server.

How we checked recovery

Instead of overwriting the source, we extracted the archive into an empty directory under another Compose project. We verified that the database and Storage mounts referenced the new directory, restored the PostgreSQL configuration into a different named volume, and started the same image versions. The source stayed stopped throughout recovery.

Our acceptance checks were deliberately more specific than container startup:

  1. All eleven default Compose services reported healthy.
  2. The REST endpoint returned the original database row; SQL separately confirmed two Storage metadata rows for the test bucket.
  3. The restored Storage API returned both original files byte for byte, with unchanged SHA-256 hashes. Anonymous requests were still denied.

The sanitized verification record includes the environment, checks and object hashes. It demonstrates a cold restore of synthetic data, not production load capacity, high availability, point-in-time recovery, or migration from Supabase Cloud. External S3 and x86-64 were not tested.

Before renting a Supabase VPS

The official Docker self-hosting guide recommends at least four CPU cores, 8 GB RAM and 80 GB SSD. Allow additional resources for your actual dataset, traffic and backup staging. MOTSELL offers an equivalent-sized Linux VPS for self-managed Supabase; you handle installation, maintenance and backups. Rehearse your own application recovery before relying on it for production.

About the author

  • MOTSELL: self-managed Linux VPS in Germany and Finland for web apps, APIs and bots. We share reproducible deployment notes and state what was tested. Apps and backups remain the customer’s responsibility. Posts may use AI assistance. https://motsell.com/en/vps-vds?utm_source=hashnode&utm_medium=community&utm_campaign=profile_202611

No comments yet. Be the first to comment.

More from this blog