available at


TBD, through the snap package


Nextcloud is updated automatically through the snap.

Restic backups

The instance is backed up to Backblaze B2 using restic.

Install restic and initialize the repo:

apt install restic

export B2_ACCOUNT_ID=abc
export B2_ACCOUNT_KEY=def

restic -r b2:altpeter-restic-nextcloud:restic-repo init

Write the required env vars (see below) to the file Create the files ~/ and ~/ with the contents listed below and make them executable (chmod +x ~/ && chmod +x ~/

Do a test run of the backup script: /root/

Add the following lines to the crontab using crontab -e:

30 5 * * * /root/ && curl -fsS --retry 3
00 8 * * * /root/ && curl -fsS --retry 3

Env file (

export RESTIC_REPOSITORY=b2:altpeter-restic-nextcloud:restic-repo
export B2_ACCOUNT_ID=abc
export B2_ACCOUNT_KEY=def

Backup script (


set -e

source /root/

# Creates a backup folder in `/var/snap/nextcloud/common/backups`

# Get the newest backup folder, see
BACKUPDIR="/var/snap/nextcloud/common/backups/$(ls -t /var/snap/nextcloud/common/backups | head -1)"

restic backup "$BACKUPDIR"
rm -rf "$BACKUPDIR"

Housekeeping script (


set -e

source /root/

restic forget --prune --keep-last 7 --keep-daily 7 --keep-weekly 8 --keep-monthly 3 --keep-yearly 2

restic check