# Self Hosted Backup

**URL:** <https://forum.ghost.org/t/self-hosted-backup/45220>\
**Category:** Self-hosting\
**Created:** [February 22, 2024, 7:29pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220 "2024-02-22T19:29:27Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Browne](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/barry_browne/32/26003_2.png) [@Barry\_Browne](https://forum.ghost.org/u/Barry_Browne)\
**Post date:** [February 22, 2024, 7:29pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/1 "2024-02-22T19:29:27Z")

</div>

Hey, you self hosters out there. What/how are you guys backing up your ghost installs?

I know we can download the JSON file, but I would love for a way to automate the export of the /content directory, as well as the JSON file on a schedule. Perhaps send to object storage (s3?) somehow.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [February 22, 2024, 9:47pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/2 "2024-02-22T21:47:29Z")

</div>

I guess it depends on your host. My strategy includes the following:

- scheduled `mysqldump`
- `ghost backup` when I perform an upgrade
- Host backup (off-site snapshots)
- Manual snapshot for major OS or Ghost upgrades

On my local machines, I use BorgBackup for local and off-site backups, and could use this on the VPS, too.

---

<div class="post-metadata">

**Author:** ![mheland](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mheland/32/26236_2.png) [@mheland](https://forum.ghost.org/u/mheland)\
**Post date:** [February 25, 2024, 8:52pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/3 "2024-02-25T20:52:48Z")

</div>

I use a combination of BackBlaze for very cost-efficient S3 storage and Restic for writing incremental backups.

Restic has support for BackBlaze using “b2” prefix

> **[Integrate Restic with Backblaze B2](https://www.backblaze.com/docs/cloud-storage-integrate-restic-with-backblaze-b2)**
>
> Restic is an open-source backup tool that works with local storage, network-attached storage (NAS) devices, and Backblaze B2 Cloud Storage.

Run a cron job nightly…

```auto
#!/bin/bash
export B2_ACCOUNT_ID="12345"
export B2_ACCOUNT_KEY="123secretkey"
export RESTIC_REPOSITORY="b2:bucketName:repoName"
export RESTIC_PASSWORD_FILE="/usr/local/bin/resticpw.txt"
restic backup /home/ghost/content/

```

- [https://restic.net/](https://restic.net/)
- [https://www.backblaze.com/](https://www.backblaze.com/)

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [March 2, 2024, 11:44pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/4 "2024-03-02T23:44:47Z")

</div>

I’m looking at this now. The plan I’m considering is using Ansible to configure Autorestic to back up to BackBlaze B2.

I’m already familiar with Ansible. If you aren’t, you might want to skip that layer.

Ansible+autorestic allows me to manage all the configuration details including the installation details in a YAML file.

I plan to define the of the server with Ansible, so I’ll have all the configuration details in one place.

I’m not sure if I’ll even bother to run `mysqldump` or just instead backup the underlying the file system.

Even if the filesystem isn’t completely “clean” when a snapshot is taken, MySQL should still be able to recover and boot. Whether to use mysqldump or not is a detail I may look into more!

Actually, I will add one layer to my system, which is 1Password for secret storage. Ansible playbooks can be easily written to pull secrets from a password manager.

So the Ansible playbooks can be reasonable stored in git as a backup and rollback option without the secrets being embedded there.

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 3, 2024, 4:32am UTC](https://forum.ghost.org/t/self-hosted-backup/45220/5 "2024-03-03T04:32:00Z")

</div>

I would choose a hosting company that integrates automatic backups with “snapshots”. Digital Ocean already does that. Pikapods will soon.

---

<div class="post-metadata">

**Author:** ![matribeiro](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/matribeiro/32/25185_2.png) [@matribeiro](https://forum.ghost.org/u/matribeiro)\
**Post date:** [March 4, 2024, 3:33pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/6 "2024-03-04T15:33:45Z")

</div>

A few days ago, Diolinux, a blog here in Brazil, had problems with Digital Ocean backups and Snapshots. The files were all corrupted. And he reports that Digital Ocean support didn’t solve his problem.

---

<div class="post-metadata">

**Author:** ![matribeiro](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/matribeiro/32/25185_2.png) [@matribeiro](https://forum.ghost.org/u/matribeiro)\
**Post date:** [March 4, 2024, 3:37pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/7 "2024-03-04T15:37:40Z")

</div>

I’ve been using [CloudPanel](https://www.cloudpanel.io/).  
It makes daily backups in a cloud of my choice (OneDrive) and dumps the database.  
Snapshots of the machine are made with Oracle.  
When I needed to, I was able to restore the services in both cases.

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [March 5, 2024, 5:52pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/8 "2024-03-05T17:52:34Z")

</div>

Are there any useful tutorials for setting up automated Ghost backups?

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 14, 2024, 8:28pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/9 "2024-03-14T20:28:37Z")

</div>

It depends on your hosting. Digital Ocean does it (it’s an additional service that comes with a price) and I heard Pikapods will do it in a few months too.

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [March 19, 2024, 12:11pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/10 "2024-03-19T12:11:36Z")

</div>

I know about Digital Ocean. I use Contabo’s Cloud VPS.

---

<div class="post-metadata">

**Author:** ![johnny004](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@johnny004](https://forum.ghost.org/u/johnny004)\
**Post date:** [March 19, 2024, 6:10pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/11 "2024-03-19T18:10:20Z")

</div>

use the software that are designed for website backup. There are many option available in free and paid trial like, automatic backup, Schedule backup and cloud storage integration.

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 20, 2024, 7:15pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/12 "2024-03-20T19:15:32Z")

</div>

Ghost has no plugins, so there aren’t really software to back it up. If you do self hosting, it must be integrated in your hosting. Digital Ocean has it, while others not.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [April 2, 2024, 11:24am UTC](https://forum.ghost.org/t/self-hosted-backup/45220/13 "2024-04-02T11:24:05Z")

</div>

> [@martinverbic](#):
>
> I use Contabo’s Cloud VPS.

Then you can follow their docs on [creating snapshots on CONTABO](https://help.contabo.com/support/solutions/articles/103000270385-how-do-i-create-a-snapshot-of-my-server-).

---

<div class="post-metadata">

**Author:** ![hafidzaini](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hafidzaini/32/20043_2.png) [@hafidzaini](https://forum.ghost.org/u/hafidzaini)\
**Post date:** [April 2, 2024, 7:01pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/14 "2024-04-02T19:01:22Z")

</div>

yes,  
cloud provider usually have Snapshot menu  
i use GCP and Snapshot schedule everyday (autodel snapshot if older than 7 day)

want manual backup?

- use shell command to dump SQL and cron job it
- use shell command to zip content folder and cron job it

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [April 2, 2024, 7:25pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/15 "2024-04-02T19:25:38Z")

</div>

I’ve started building an Ansible role to manage my Ghost installs (discussed here: [Interested in Ansible Role to install Ghost to run with podman containers / systemd / private networking?](https://forum.ghost.org/t/interested-in-ansible-role-to-install-ghost-to-run-with-podman-containers-systemd-private-networking/46226) ).

I’m considering extending it to add this Ansible Role for the Restic backup tool along with BackBlaze B2 backups.

> **[GitHub - roles-ansible/ansible\_role\_restic: Ansible role to deploy and...](https://github.com/roles-ansible/ansible_role_restic)**
>
> Ansible role to deploy and configure restic. Contribute to roles-ansible/ansible\_role\_restic development by creating an account on GitHub.

The idea is simply by defining a new Ghost blog in my Ansible config, per-site backups with Restic would automatically be set up for it. So, rather than restoring a snapshot of the whole filesystem, I would be able to restore just the files or MySQL database for a single Ghost instance.

But since I’m using Ansible, I would only have to define the backup scheme once for it be available to all my Ghost installs.

---

<div class="post-metadata">

**Author:** ![carla](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/carla/32/37946_2.png) [@carla](https://forum.ghost.org/u/carla)\
**Post date:** [September 24, 2025, 1:34pm UTC](https://forum.ghost.org/t/self-hosted-backup/45220/16 "2025-09-24T13:34:55Z")

</div>

Yes, is there a way to download and backup files as well? For example, I upload my podcast’s episodes, and so some posts have mp3s attached. I would love to be able to archive them with the site in place, as another podcast backup.
