With my team, we use a lot of Firebase features like Firestore.
But there is no simple way to backup the data regularly.
We created a tiny Docker image
zenika/alpine-firestore-backup and this simple tutorial to perform backups automatically on the Google Cloud Platform with Serverless services like
Cloud Run and
Create a GCP coldline bucket and save the name of your bucket.
Create a GCP Service account with the following rights:
Cloud Datastore Owner
Cloud Datastore Import Export Admin
Then, download the JSON private key file.
Please fill in the following information:
GCLOUD_SERVICE_KEY, make a base64 encoded string using this command:
cat key.json | base64
Cloud Run is a serverless service to automatically serve your containers using http.
Cloud Run service using the public image
Be careful to:
- Choose your newly image in
- Choose "Cloud Run (fully managed)" and a location
- Enter a service name
- Select "Allow unauthenticated invocations"
- In the "Show optional settings / Environment variables", set the 3 environment variables seen in the previous section
You can test the service using your browser:
Save the url created to call your Cloud Run Service.
Cloud Scheduler allow you to schedule a cronjob in order to call a https endpoint at regular intervals.
Cloud Scheduler to send a request to your
Cloud Run Service every time you need.
For example, every Monday at 3:00am
0 3 * * 1 a backup will be done and stored in your bucket.
You can also check the current status of each backup operation using the following url
We also have others images we maintained like a popular and small Chromium Headless image called
Posted on by: