Docs apolopanel.com ↗ Start trial ↗
Documentation Hosting

Backups

APOLO backs up every account (its files, databases, mail and settings) and the server's own configuration, encrypted and without duplicates, to S3-compatible storage, an SFTP server or a folder. Restores go back to a single file, a database, a mailbox or a whole account, also on a new server.

How backups work

  • Encrypted and incremental: backups use restic. Everything is encrypted before it leaves the server, only what changed since the last backup is stored, and it is compressed.
  • One repository per server at the destination, optionally copied to a second destination after each run.
  • Accounts one after another: runs never overlap; Back up now waits for its turn.
  • Gentle on the server: backups run with low CPU and disk priority, can be limited in upload and download speed, and wait while the server's load is above a limit you set.
The Backups page: last backup, next run, storage used and recent runs
Backups: the last and next run, the storage used and every account's backups.

Destinations

Under Backups → Settings (administrators), choose where backups go. Test connection checks the destination and writes to it.

S3-compatible storage

Pick the provider and the region and APOLO fills in the address: Amazon S3, Backblaze B2, Cloudflare R2, Wasabi, Hetzner, DigitalOcean Spaces, Scaleway, OVHcloud, IONOS, Exoscale, Akamai, Vultr, Contabo and IDrive e2. MinIO, Ceph and any other S3-compatible storage are entered by their address. Enter the bucket and the access keys (the secret is stored only for root on the server).

SFTP

A server you reach over SSH: host, port, user and folder. APOLO makes its own SSH key and shows the public key to add to the backup server; it trusts the backup server's host key only after you confirm its SHA256 fingerprint.

A folder on the server

For a second disk or a mounted network share. Not inside /home, /etc or the panel's state; the panel warns when the folder is on the same disk as /home, because a backup on the same disk doesn't survive that disk.

Keep backups off the server. A backup on the same server doesn't help when the server is lost. Use S3 or SFTP, or add one as the second destination.

The encryption password

The repository's password is made when you first save a destination and is shown once. Save it somewhere safe, outside the server: without it nobody, not even APOLO's support, can read the backups, for example to recover on a new server. It is stored on the server only for root.

What a backup contains

PartWhat
FilesThe account's home folder (websites and their files), without caches that build themselves and rotated logs
DatabasesEvery MariaDB/MySQL and PostgreSQL database of the account, as a consistent dump, always whole
MailEvery mailbox of the account's domains, always whole
Account settingsThe account, its package and limits, websites and their settings, databases and their users, cron jobs, mail domains, mailboxes and forwarders, SSH keys, and the hashes of its passwords (so a restored account works with the same passwords)
Server configurationAt the end of each nightly run: APOLO's settings, the certificates, and the configuration of Nginx, Apache, PHP, mail, FTP and SSH

Schedule

The schedule: time, days and extra database backups
The schedule, in the panel's time zone.
  • Scheduled backups: a time and the days of the week, in the panel's time zone. Off: only Back up now. A run missed while the panel was down starts later, up to 6 hours late.
  • Extra database backups: databases only, every 2, 4, 6 or 12 hours between the nightly runs.
  • Back up now for one account or all; hosting users can back up their own account at most once an hour.

Retention

How many daily, weekly and monthly backups are kept, for the whole server or per package. Everything from the last 24 hours is always kept. Space is freed once a week, and once a month 2% of the data is read back to check the repository. The storage used is shown on the page.

What to leave out

  • Folders and patterns to leave out, for the whole server or per account (hosting users can add their own, always inside their home folder), for example */node_modules or a folder of large media.
  • Files larger than a size you set, in MB or GB.

Databases and mail are always backed up whole.

Restoring

Each account's backups are listed by date. Open one to restore or download a part:

Files and folders
Browse the backup and choose files or folders. Original puts them back in place (a folder's content is replaced), or restore them as a copy into a restored-<date> folder next to the original. Restored files belong to the account and can't bring in special files or set-id bits.
A database
Into the same database (a backup of its current state is made first, as "Before restore"), or into a new database of the account. A database can't bring in users or objects of other accounts. MariaDB and MySQL databases are loaded by the database's own user, so its views, routines and triggers belong to that user afterwards; with binary logging on (the default for MySQL), APOLO turns on log_bin_trust_function_creators while it loads the database, so its functions and triggers can be made, and sets the value back afterwards.
Mail
A whole domain's mail or one mailbox: the messages missing now come back, the current ones stay.
Download
A file as it is, a folder as .tar.gz, of any size.
A whole account
See Recovery.

Hosting users can browse, restore and download their own backups when their package includes backups; the account settings and the server configuration are for administrators only. An account sees the backups made since it was created: those of a removed account with the same name stay with the administrator (Recovery).

The weekly test restore

Once a week after the nightly run (and with Test now), APOLO restores one file and one database of a random account from the last backup into a temporary folder and checks them: the size, the same content as on the server when the file hasn't changed since, and a complete database dump. Nothing on the server changes. The result is on the page, and a failure sends a notice.

Runs, logs and notices

  • Recent runs shows each run with its accounts, size, time and result; its Log has the whole output (kept 30 days). A running backup shows live progress and can be stopped.
  • Notices: in the panel, and by e-mail to the administrators when a run fails, optionally a daily report, and optionally to the account's owner.

Recovery on a new server

When a server is lost, install APOLO on a new server, add the same destination and enter the saved encryption password (the destination already has a repository). Backups → Recovery lists the accounts in the backups; Restore account creates each account again with its websites, databases and users, mail domains, mailboxes, forwarders, cron jobs and SSH keys, restores its files, databases and mail, and sets its saved passwords (the panel password only when APOLO made it; otherwise the restore says to set a new one). A restored account keeps its older backups.

Not restored by themselves: certificates (issued again once the DNS points to the new server), the websites' Redis cache, WordPress's entry in the WordPress manager (use Scan for sites) and MySQL 8 passwords.

Full account backup

Full account backup on the account's Backups page (and in the administrator's backups of an account) makes one .tar.gz file with everything of the account: its websites and every file of its home folder, a dump of each database, its mail, DNS zones, cron jobs, SSH keys and panel settings, and its password hashes. It is the file another APOLO server imports in its Migration tool (From an APOLO backup); it works whether or not the server's backups are set up.

  1. Create full backup. The page shows each step (the settings, each database, the mail, the files); it keeps going when you leave the page.
  2. The file is saved in the home folder as apolo-backup-<account>-<date>.tar.gz: Download it from the list, or take it with SFTP. Delete removes it for good.
  • The home folder is read as the account itself, so a file the account can't read is left out (the page names a few). The backups' own exclusions apply (caches, rotated logs, node_modules when it is left out of backups), and older full backups in the home folder are never packed into a new one.
  • Leave out large archive files: before Create full backup, tick it and choose a size (128 MB, 256 MB, 512 MB, 1 GB or 2 GB). Files ending in .zip, .rar, .tar, .tar.gz, .tgz or .gz above that size stay out, for example an old backup or a download kept in the home folder; the finished backup names them.
  • A file with several names (hard links, as pnpm makes them) goes in once, its other names as links to it. A file larger than 1 GB that is almost all empty space on disk (a sparse file) is left out, and the page names it. The file is never larger than what the account takes on disk.
  • The file counts toward the account's storage: with the storage full it stops and says so, and nothing is left behind. One full backup of an account is made at a time, and one that makes no progress for 10 minutes stops with a message.
  • It holds the account's password hashes, so it is private to the account (0600); keep the downloaded copy safe.

If a backup fails

  • Open the run's Log: restic's message says why (a wrong key, a full bucket, a refused connection).
  • Test connection on the destination; check the keys, the bucket and the region, or the SFTP key on the backup server.
  • "Repository not found" or a wrong password: the destination or the password changed; enter the saved password.
  • Runs are skipped: the server's load stayed above the limit for the whole waiting time; raise the limit or the waiting time.

Something missing or unclear? Ask support or report a bug.