Skip to content

Neon

How to back up Neon managed PostgreSQL databases via SimpleBackups.

Neon is a serverless PostgreSQL platform with branching and autoscaling. Backing it up through SimpleBackups lets you store portable copies in your own storage with custom retention schedules, independent of Neon's built-in history. This guide covers both the automatic API-based setup and the manual connection string approach.

Automatic setup

In this section, you will generate a Neon API key and connect your Neon project to SimpleBackups so that databases are discovered automatically.

Step 1: Obtain Neon API credentials

  1. Go to https://console.neon.tech/app/settings/api-keys.
  2. Click Create new API key.
  3. Copy the generated key to a safe location.

Neon API keys settings page with Create new API key button

Step 2: Get the project ID and whitelist SimpleBackups IPs

  1. From the menu, click Projects and choose the project that contains the database you want to back up.
  2. From the menu, click Settings, then General.
  3. Copy the Project ID.
  4. Navigate to IP Allow and add the SimpleBackups IP addresses.

Neon project settings showing Project ID field

Neon IP Allow settings tab

Neon IP address entry form

Step 3: Create a Neon provider in SimpleBackups

  1. Go to the database backup page and click Add in the Connect your DBaaS Provider section.
  2. Select Neon from the Provider dropdown, enter a name for your Neon account, paste the API key and project ID from the previous steps, then click Save provider.

SimpleBackups provider connection form for Neon

SimpleBackups Neon provider saved confirmation

  1. Select your provider, then the database you want to back up.
  2. Click Validate.

SimpleBackups database selection and validate screen for Neon

Step 4: Schedule and activate

Set a schedule for your backups and configure retention policies and storage. Review your configuration and save — SimpleBackups will start backing up your database according to your schedule.

Manual setup

Use this approach if you prefer to supply connection credentials directly rather than through the Neon API.

Step 1: Copy your connection string

  1. Log in to your Neon dashboard and navigate to the database you want to back up.
  2. Click Overview, then Connect, or refer to Connection Details on the dashboard.
  3. Create a new user or role with read access to the database if needed. This user will be used by SimpleBackups to connect.
  4. Copy the connection string and replace the **** placeholder with your actual password.

Neon connection details screen showing the connection string

Step 2: Whitelist SimpleBackups IP addresses

  1. In the Neon dashboard, go to Project settings, then IP Allow.
  2. Add the SimpleBackups IP addresses to the allowlist.

Neon IP Allow settings with IP address entry

Step 3: Create a database backup in SimpleBackups

  1. Navigate to Backups and click Create Backup, then select Database Backup.
  2. Choose Serverless as the backup server type.
  3. Select PostgreSQL as the database type.
  4. Click Paste connection string and fill in the complete connection string, making sure the password is included.
  5. Click Validate Connection.

SimpleBackups database connection form with Neon PostgreSQL connection string

  1. Set a schedule and configure retention policies and storage. Review your configuration and save.

Restoring a backup

To restore a backup, navigate to your backup page and open the Logs tab. Click the detail icon on the backup you want to restore from, then open the Restore tab. Generate a download link and copy it.

Neon backup logs tab

Neon backup detail view

Neon restore tab with download link

Run the following command to download and decompress your backup (replace the URL with your signed download link):

bash
wget -O - "<signed-download-url>" | gunzip -c > backup.pgsql

Then restore using pg_restore, replacing <your-database-uri> with your full database connection string:

bash
pg_restore -d "<your-database-uri>" ./backup.pgsql