How to Setup Automated Database Backups with Coolify (backed by S3 Object Storage)
Date: 2025-04-04 | coolify | craft | create | database | hosting |
I've been using Coolify to host my sites for the past several months. Database backups are a crucial part of disaster recovery, providing a checkpoint from which to restore your data in case something bad happens.
In this post we'll walk through setting up automated backups with Coolify.
How to Create Database Backups with Coolify
We're assuming you've created your database on your server using Coolify's built-in DB Creator. This is going to ensure it's setup in a standard way that Coolify understands - like how to access it, where it's located on disk, etc.
Coolify currently supports backups for Postgres, MySQL, MariaDB, and MongoDB according to the official docs.
To setup DB Backups:
- Navigate to your Coolify project and select your database
- Click the
Backups
tab - Create a
Scheduled Backup
Once the Scheduled Backup is created, it will automatically create a backup based on the configuration.
If you want to create a backup immediately, click into the backup and select Backup Now
.
Setting up Automated DB Backups
Coolify allows for automated backups on a cron (recurring time-based schedule).
The available options are:
- every_minute
- hourly
- daily
- weekly
- monthly
- yearly
- Or anything you can put in a cron expression
If you're storing backups locally, you can set retention limits to cleanup old backups you don't need anymore: number of backups, days to keep, or max storage.
Storing Database Backups
By default Coolify will store the backups locally on your server. For many indie usecases this is fine and gives you an ability to restore to a previous checkpoint if something bad were to occur. However if a true disaster occurs where you lose access to your server entirely, all the backups would be lost as well.
To solve for this, many people choose to upload their backups directly to Object Storage (like S3) which is a relatively cheap way to store large files. Because this storage is hosted independently of your server, it can be used to restore your db even if your server becomes unreachable.
Coolify has built-in S3 connection capabilities so you can have the database backups uploaded directly to your own S3-compatible Object Storage.
To configure this:
- Enable an S3 compatible Object Storage on your cloud of choice
- I'm currently using Hetzner Object Storage (sign up with my referral link to get $20 in credits)
- Configure it in Coolify under
S3 Storages
- Then go back to your database backups, check
S3 Enabled
, and select the one you want your db backups uploaded to
Next
I've been having a good time with Coolify and am frequently surprised by the nice utilities they've built in. It really lives up to its promise of bringing the ease of cloud hosting to ~self hosting.
I use Hetzner to host my server / Object Storage because it's reliable and very cost-effective. Sign up with my referral link to get $20 off Hetzner cloud hosting.
If you liked this post you might also like:
Want more like this?
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.