What you will set up
A Linux server usually needs two things from its backup: its data back after a mistake, and the whole machine back after a failed disk or a broken update. BackupZit does both with one agent: a Linux system job backs up all local file systems and the disk layout, so the server can be recreated on an empty disk; Files and folders and Databases jobs protect the data more often. Everything is managed from one self-hosted console. BackupZit is free and open source under the GNU AGPLv3; MaxZit, the company behind it, offers optional paid support.
What you need
- A BackupZit console: a small Linux VM (2 vCPU, 2–4 GB RAM, 16–20 GB disk) from the ready-made image on the download page, or the install script on an existing Debian, Ubuntu, AlmaLinux or Rocky Linux server. The console stores no backup data.
- Backup storage on another machine: SFTP, an SMB share on a NAS, an S3-compatible bucket, Azure Blob Storage, a BackupZit hardened repository, or a local or USB disk of the agent.
- The Linux servers to protect: 64-bit Debian, Ubuntu, AlmaLinux or Rocky Linux. Agent packages are
.deb(amd64) and.rpm(x86_64). Whole-system backup and restore are tested with Debian, Ubuntu 22.04 and Rocky Linux 9 (the same applies to AlmaLinux and RHEL 9); on Ubuntu 22.04 and RHEL-like 9 systems they need agent 0.50.0 or newer. - For a bare-metal restore, a USB stick or a VM to boot the Linux recovery ISO, which is published with every release.
Step 1 — Install the agent
- In the console open Agents and click Create enrollment token. The enrollment code (
BZ1-…) is valid for 7 days and works for any number of machines. - On the server, install the package and enroll it:
apt install ./backupzit-agent_*.deb # or: dnf install ./backupzit-agent-*.rpm backupzit-agent enroll --code "BZ1-..." systemctl enable --now backupzit-agent - Or let the console do it: Agents → Install on a machine from here → Linux, with the server's address and an SSH account (root, or a user with sudo rights; password or private key). Enter the server's SSH host key fingerprint (
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub); without it, the console shows the key it found and sends the password only after you confirm it. - Within a minute the server appears on the Agents page. The agent connects out to the console on TCP 8443 and writes the backups directly to the storage, so the server opens no ports.
Step 2 — Choose the jobs
Under Backup jobs → New backup job, choose the Agent, the Storage target and what to back up. For a Linux server three kinds matter:
| Job kind | What it protects | Restored as |
|---|---|---|
| Linux system | All local file systems and the disk layout: partition tables, LVM, file system UUIDs and labels, boot code | The whole server onto an empty disk, new hardware or a new Proxmox VM; single files |
| Files and folders | Chosen paths such as /etc, /home, /srv or /var/www | Files and folders into a folder or to their original location, on any agent |
| Databases | PostgreSQL or MySQL/MariaDB with the database server's own tools, with log backups | A single database to a point in time, under a new name or in place |
A common combination: a Linux system job every night or every week, a Files and folders job for the changing data several times a day, and a Databases job for each database server. Data that is already in the repository is not stored twice, also between the jobs of the same agent on the same storage target.
Step 3 — Create the Linux system job
- Create a job with Linux system. To cover many servers with one job, choose under Agent one of Several agents (files, disk images, Linux systems), for example All Linux agents: every Linux server gets a system backup in its own repository, with its own history and restores. Servers enrolled later join the job automatically.
- Optionally fill in Exclude with paths that need not come back, for example a large cache.
- Set Keep backups and the Schedule (step 6) and click Create job.
What the job backs up:
- Every local file system (ext2/3/4, XFS, vfat), also on LVM, file by file, with owners, permissions, setuid bits, ACLs, extended attributes (SELinux labels, file capabilities), hard links and device files. Network shares and virtual file systems (
/proc,/sys,/run) are skipped. - The disk layout: GPT or MBR partition tables with their IDs, LVM volume groups, file system UUIDs, labels and features, and the boot code (MBR and the BIOS boot partition of GRUB).
Linux has no built-in snapshot of a running disk, so BackupZit does not copy the disk block by block, which would be inconsistent. It reads each file whole and recreates the layout so the restored disk boots again. Files that change while they are read, above all databases, belong in their own job (step 5) or a dump made before the backup (step 4).
Step 4 — Back up files and folders
- Create a job with Files and folders and enter the paths under Folders and files to back up, one per line, as the server sees them:
/etc,/home,/srv,/var/www. - Wildcards are allowed:
/srv/sites/*/uploads. On Linux upper and lower case count as written. For every user of the computer adds folders of every user, written as{users}/Documents, which the agent finds anew at each backup in/home/<name>and/root. - Under Exclude, one per line: a name pattern that applies in every folder (
*.tmp,node_modules) or a full path (/srv/www/cache). Kernel file systems such as/proc,/sysand/devare always kept as empty folders, also when the job backs up/.
To get a consistent copy of something that keeps changing, administrators can add Commands before and after the backup under Advanced. They run as root with sh, for example:
pg_dump -U postgres app > /var/backups/app.sql
If the command before fails or runs longer than its time limit (30 minutes by default), the backup does not run and the run fails with the command's output. The command after runs also when the backup failed, so it can restart a service the first command stopped.
Step 5 — Databases on the server
A Databases job uses the database server's own tools on the agent's machine: for PostgreSQL pg_basebackup, pg_dumpall --globals-only and a pg_dump of each database; for MySQL and MariaDB a mysqldump of each database with its binary log position. With Back up the logs every (minutes) (archived WAL for PostgreSQL, binary logs for MySQL/MariaDB) a single database can be restored to any point in time, for example to one minute before a wrong DELETE. PostgreSQL needs one restart after the first full backup turns on WAL archiving; MySQL/MariaDB needs the binary log turned on in its configuration. The database guide has the steps per engine.
Step 6 — Schedule, retention and a second copy
- Schedule: At specific times (up to three times a day), Repeatedly, every few hours or minutes (15 minutes to 12 hours, optionally only between two times), Once a month, After another job — for example the system backup after the database backup — or Manually only. Backup window: start only between keeps scheduled runs out of working hours. If the server is offline at the scheduled time, the backup starts as soon as it is back.
- Retention: under Keep backups a backup is kept if any rule selects it: Most recent, Daily, Weekly, Monthly and Yearly (agents 0.62 or newer). 3 recent, 7 daily, 4 weekly and 6 monthly keep about half a year of history with about 20 restore points; unchanged data is stored only once.
- RPO: Recovery point objective (RPO), hours, for example 26 for a daily backup: the dashboard and a notification tell you when the newest good backup is older.
- Encryption: backups are encrypted with AES-256 on the server before they leave it. Keep the Recovery key of the storage target, or its recovery sheet, away from the backups: with it, the storage location and its credentials, backups can be restored even without the console.
- Second copy: a Backup copy job copies the backups to another storage target, for example from the office NAS to S3 with Object Lock or a hardened repository, with its own retention. See 3-2-1 backup with immutable copies.
Restore single files
- Open the backup run in Activity or on the job page, or use Restore → Files and folders in the menu. System backups are listed there too, so a single file comes out of the nightly system backup as well.
- Browse files shows the folders as they were. Tick files and folders, then Download (one file as it is, several as a ZIP; the audit log names the paths) or restore them on an agent.
- Under Restore files from this backup, choose the agent that receives the files (also another server), then Restore into a folder, which recreates the original structure below it and touches nothing existing, or Restore to original location (overwrites existing files). Only these paths limits the restore, for example to
/etc/nginx. - Keep Verify restored files on: each file is read back and compared with the checksum in the backup. Then Start restore.
Owners, permissions, setuid bits, ACLs, extended attributes, symbolic and hard links and file times come back too; owners are set when the agent runs as root, as the service does. While a restore runs, the folders it creates are open only to their owner, so the files of a private folder such as /root are not readable by others in the meantime. Browsing in the console works for backups on network storage; for a local or USB disk of an agent, restore with Only these paths.
Bare-metal restore onto an empty disk
- In the console open Recovery media, download the Linux recovery ISO and click Create recovery code.
- Write the ISO to a USB stick (Rufus, balenaEtcher) or attach it to a VM. It boots on BIOS and UEFI machines.
- Boot the new or repaired machine from it. The recovery system starts the agent, which connects to the console with
backupzit/recovery.jsonfrom any other USB stick or disk, or asks for the server address and the recovery code. The machine then appears as a recovery agent. - Open the system backup run (or Restore → Whole Linux system), click Restore the whole system → Onto a disk, and choose the recovery agent and its disk, usually
/dev/sda,/dev/nvme0n1or/dev/vda. Tick Different hardware when the machine is not the original one.
The target disk may be larger or smaller than the original: the last partition grows to fill it, or shrinks as long as its data fits. File system UUIDs and partition IDs stay the same, so /etc/fstab and the boot loader need no changes. On UEFI systems the boot loader is also installed at \EFI\BOOT\BOOTX64.EFI, which every UEFI firmware starts without a boot entry, and RHEL-like systems (dracut) get a new initramfs with all drivers when they move to different hardware. A restored server that has no network had its settings bound to the old MAC address: restore with Different hardware, or remove the match lines in /etc/netplan/.
Any Linux live system works too: start the agent there with sudo backupzit-agent recovery --server https://console:8443 --token CODE; it names the tools it needs (gdisk, LVM, mkfs) when they are missing. Restore onto a second, empty disk of an existing Linux agent (for example /dev/sdb) the same way. Remove recovery agents when the restore is done; otherwise they are removed a week after they were last online.
Without the console, the command line agent restores from the storage with the recovery sheet:
backupzit-agent system-show --repo ... latest
backupzit-agent system-restore --repo ... --target /dev/sdb [--new-hardware] --yes-erase-target latest
Restore as a new Proxmox VE virtual machine (P2V)
In the system backup run choose Restore the whole system → As a new Proxmox VM, then the Proxmox node (its BackupZit agent does the work), storage, VM ID, name, memory (2048 MiB by default), cores (2) and network bridge (vmbr0). BackupZit creates the VM with the same firmware as the original (UEFI/OVMF or BIOS), a VirtIO SCSI disk and network card, recreates the disk, restores all files and can start the VM. Because the copy may run next to the original:
- network settings bound to the old MAC addresses (common in cloud images: netplan
match: macaddress) are changed to apply to any wired interface; - the BackupZit agent inside the copy is unenrolled, so it does not report as the original server;
- the VM gets the CPU type x86-64-v2-AES, which RHEL 9 and its clones need to boot;
- a system with SELinux on relabels its files on the first boot and restarts once.
The same path also serves as a test: restore last night's system backup as a VM on a separate bridge and check that the services start.
Restore tests and alerts
- Automatic restore tests (weekly by default, under Settings → Restore tests): the agent of each job restores a random sample of files from the newest backup into a temporary folder, verifies every byte against the stored checksums and deletes it again. Test restore on the job page starts one at once.
- Suspicious backups: every backup is compared with the history of its job — far more changed files than usual, new data that no longer compresses, a sudden drop in the number of files, a jump in new data (also for Linux system backups). Such a backup is marked, an alert goes out and the job's retention is paused, so the last clean backups stay; Reviewed — resume retention on the job page releases it.
- Notifications by email, Slack, Microsoft Teams or webhooks for failed runs and missed RPOs, and a daily report that also names offline agents; the Dashboard shows what Needs attention.
Limits
- Linux system jobs do not support encrypted disks (LUKS), software RAID (mdadm) or btrfs yet; the job reports this clearly instead of creating an incomplete backup. Back up the data of such servers with a Files and folders job.
- A system spread over several disks is backed up, but the whole-system restore recreates one disk (the command line chooses it with
--disk). MBR disks with logical partitions cannot be restored as a whole. - Files are read as they are, without a snapshot of the running disk: databases need a Databases job or a dump before the backup.
- As a new VM, a system backup is restored into Proxmox VE only; for another hypervisor, boot the Linux recovery ISO in a new VM and restore Onto a disk.
- Copies of Linux system backups made by a Backup copy job are restored with the command line agent, not from the console.
- Agent packages exist for 64-bit x86 (amd64 / x86_64); the distributions named on the agents page are Debian, Ubuntu, AlmaLinux and Rocky Linux.
- The console and its guide come in 14 languages; paid support is provided in English only.
Next steps
Download BackupZit, see the features for servers and PCs and the supported systems, or read the chapters Linux system backup & P2V and Restoring in the user guide in the console. Related guides: bare-metal restore of a Windows server, SQL Server, PostgreSQL and MySQL backup, 3-2-1 backup with immutable copies and Proxmox VE backup for the VMs on a Proxmox node. Questions are welcome in GitHub Discussions; companies can get commercial support from MaxZit (in English).