PostgreSQL database backup stored in your Google Cloud Storage Bucket.
Let's see how we can schedule PostgreSQL backups and store them on your Google Cloud Storage bucket.
Google Cloud Storage is object storage on Google Cloud Platform, and it exposes an S3-compatible interface through HMAC keys. That is what makes it a drop-in destination here: the bucket, region, key and secret map onto the same four fields used for AWS S3.
Prerequisites
- Create a SimpleBackups account
- Make sure you have your server connected to your account (the one on which your PostgreSQL database is hosted)
- Have a Google account and make sure that billing is enabled for your Google Cloud Project (we'll cover how to get your bucket created below)
1. Create your Google Cloud Storage Bucket
-
Sign in to your Google Cloud Console, and then select an existing Google Cloud project or create a new one
-
Open the Cloud Storage browser in the Google Cloud Console
-
Click on "Create bucket" to open the bucket creation form. First define a globally unique permanent name for your bucket, and then click Continue.

-
And the select the region for your bucket

-
Click Create. Your new bucket will be created.
Information you'll need in step 3:
-
Your "Bucket" name
-
Your "Bucket" Region
2. Retrieve your Bucket credentials
In order to give access to your newly created bucket, you'll need to provide credentials to SimpleBackups. Follow this simple article on how to get your Google Cloud Storage Credentials.
Information you'll need in step 3:
- Access Key
- Secret Key
3. Connect your Bucket to SimpleBackups
- Log into SimpleBackups and head to the connect your storage page
- In the storage provider list select "Google Cloud Storage", and fill in the form with the information from step 1 and step 2

You'll have to input :
-
Key: Access Key described in (step 2)
-
Secret: Secret Key described in (step 2)
-
Region: Bucket Region described in (step 1)
-
Bucket: Bucket name described in (step 1)
-
Give your storage a name (the bucket name is usually a good pick, but you can be creative) and click on "Save New storage".
The next step is to authorize SimpleBackups to your Google account. Click on the Connect Your Google Account button.

Grant access to your Google Account by clicking Allow.

On the next screen click Save Changes, and now your Google Cloud Storage is already connected.

4. Final step: Create your PostgreSQL backup
Last step is obviously to schedule your backup.
From this screen you'll be able to configure what data you're backing up (PostgreSQL in this case), where you want it to be saved (in this case your Google Cloud Storage Bucket), and how often you want this to be done.
FYI this section will be the same, no matter what storage you pick. And that's the beauty of it, if you want to change storage, just select another one from the list (Backblaze, AWS, or whatever you might prefer) and you'll be good to go.

What would you like to back up? (A)
- Select "Database" (in this article we're creating a PostgreSQL backup only)
- Select the server on which your database is hosted
How often should we make this backup? (B)
-
Select your schedule option (here we picked a daily schedule)
You can select a pre-defined schedule (daily, weekly, monthly) or a custom option allowing you to schedule it whenever you want to use CRON syntax.
-
Example of CRON schedule for "20:00 every Tuesday" =
0 22 * * 2Finally, the "On demand" option won't schedule anything but will allow you to trigger the backup manually or using our API.
-
Define the backup retention, which is the number of backups you want to keep (kind of the history length of your backup if you prefer)
Choose the database you need to backup (C)
- Select the type of your database, in this case "PostgreSQL"
- Fill in the database connection form
Finalize and create (D)
- Pick the name of your backup (this is how it will be displayed in SimpleBackups interface) and where you want to store it.
- Select your Storage (step 3)
That's it, your PostgreSQL backup is now ready and connected to your Google Cloud Storage Bucket.
Run it once manually (using the "Run" backup button from the backups list) and you'll trigger your first backup!
FAQ
Which Google Cloud Storage credentials does SimpleBackups need?
An HMAC access key and secret from the interoperability settings of your Cloud Storage project, plus the bucket name and region. GCS exposes an S3-compatible interface through these HMAC keys.
Does my Google Cloud project need billing enabled?
Yes. Cloud Storage buckets cannot be created in a project without billing enabled, so set that up before starting the bucket creation step.
Which bucket region should I pick?
Pick a region that matches your data residency requirements, and prefer one that is not the same region as the database it protects. A backup that shares a region with production is exposed to the same regional outage.
How do I restore a PostgreSQL backup stored in Google Cloud Storage?
Download the dump from the bucket, then restore it with psql for a plain SQL file or pg_restore for a custom-format archive. The restore guide covers both paths and the errors that come up most often.
Keep learning
- The ultimate PostgreSQL backup script, if you would rather own the
pg_dumpand upload pipeline yourself. - pg_dump and pg_restore guide, for the dump options behind whichever route you pick.
- How to restore a PostgreSQL backup, because a backup you have never restored is an assumption.
Scheduling, retention and restores across every destination are covered on the managed PostgreSQL backup page.
This article is part of The complete guide to PostgreSQL backup, an honest, practical reference from the team that backs up PostgreSQL every day.