Bare metal without the cloud: offsite backups that do not depend on a hyperscaler
Part 4 of the bare-metal series. How to design offsite backups on your own hardware with free software: what the offsite copy has to survive, pull-based Proxmox Backup Server sync with client-side encryption, append-only restic, raw encrypted ZFS sends, S3 Object Lock on your own Ceph, an offline copy on removable disks or tape, seeding the first copy, and restore drills.
This is part 4 of the open series on running distributed bare metal with zero cloud dependence on mostly free software. Part 1 chose the platform, part 2 and part 3 took DNS back in house. This part covers a question that auditors and boards ask as soon as a firm starts leaving the cloud: where is the offsite copy, if it is not in S3?
Often the honest answer today is "in the same cloud account as production," perhaps in another region. That copy may be geographically offsite, but it shares one administrative failure domain with production. A suspended account can make both unreachable, and a leaked admin key with delete rights can endanger both. Building offsite backups on hardware you control is a manageable job, but the design choices decide whether the copy actually survives the bad day.
What the offsite copy has to survive#
Write this list down before you buy anything, because each item rules out a design:
- Loss of the primary site. Fire, flood, power, theft. The copy must be somewhere else, on its own power and network.
- Compromise of the primary site. Ransomware or an attacker with admin rights at home. The copy must not be deletable with credentials that live at home.
- Your own mistakes. A bad prune, a wrong retention policy, a script that deletes the wrong thing. Something must keep older versions.
- Loss of a supplier. A provider that changes terms, raises prices or closes. The copy should be in a format you can restore with free software on replacement hardware you can buy anywhere, with the keys and configuration kept alongside.
The 3-2-1 rule, as CISA's backup paper puts it, is still the right starting point: "Keep 3 copies of any important file: 1 primary and 2 backups," "Keep the files on 2 different media types," and "Store 1 copy offsite." The list above is what the 1 offsite copy must do in practice.
Where the second site comes from#
You do not need a second data centre. Common options:
- A branch office or plant with a rack, reliable power and a decent uplink.
- A small colocation rack in another city.
- A reciprocal arrangement with a partner firm: each hosts a backup box for the other, with separate hardware and no shared credentials.
What matters is that it is far enough away not to share the primary site's disasters, and that the people and credentials that run it are not the same ones an attacker at home would get.
Rule one: the offsite side pulls#
In my view the most useful design decision is that the offsite system connects to the primary and pulls the data, not the other way round. Pull makes it possible for the primary to hold no credentials that can write to, prune or delete the offsite copy. It does not enforce that on its own: keep the offsite admin accounts, management access and any shared identities away from the primary site too. Then an attacker who owns home does not find a ready-made way to wipe the offsite copy.
Connect the sites over a site-to-site tunnel (WireGuard or IPsec). Do not expose the backup services themselves to the internet; only the tunnel endpoint needs to be reachable.
Layer 1: VM and container backups with Proxmox Backup Server#
If you run Proxmox VE, Proxmox Backup Server (PBS) already does most of this, and the sync job documentation covers it:
- Pull sync. A second PBS at the other site pulls from the first. It uses an API token on the primary PBS that only needs read access to the datastore. I covered why a CIFS share is a poor fit next to the fast local storage Proxmox recommends for a datastore, and how to lay out pull sync instead, in an earlier post on PBS garbage collection on CIFS and offsite design.
- Deletions do not follow by default. Snapshots removed at home are only removed offsite if you set the sync job's
remove-vanishedoption. Leave it off and give the offsite PBS its own, longer, prune schedule. That stops a deletion at home from propagating, which covers many of "your own mistakes"; a bad prune configured on the offsite side itself is still possible, so review it. - Encrypt at the client. PBS "supports client-side encryption with AES-256 in GCM mode" (backup client docs). With encrypted backups, the offsite box holds data it cannot read. The backup client needs the working key (on Proxmox VE it sits in a file readable by root on the node), but keep recovery copies of it, on paper or offline, independent of both sites' admin accounts. Without the key, encrypted backups cannot be restored.
- If you must push to a less trusted server, the docs describe
encrypted-onlyandverified-onlyflags that limit a sync job to snapshots that are encrypted or verified, "particularly of interest when sending backups to a less trusted remote backup server."
Layer 2: files and application data#
Not everything is a VM. For file shares, application exports and database dumps:
- restic to an append-only server. restic's rest-server has an
--append-onlymode that "allows creation of new backups but prevents deletion and modification of existing backups." Run it at the offsite site. The client at home can add backups but cannot delete old ones.--append-onlyis a server startup flag, so pruning has to be done another way: the restic docs recommend a separate, well-secured client with full access to the repository for that, for example on the offsite host itself. restic's forget documentation has a section on security in append-only mode; its short version is to use the--keep-withinoption offorgetwhen removing snapshots from such a repository. - Raw ZFS sends. If your data sits on encrypted ZFS datasets,
zfs send -w(--raw) sends the data "exactly as it exists on disk," and per the OpenZFS man page "the backup may then be received on an untrusted machine since that machine will not have the encryption keys to read the protected data or alter it without being detected." Replication tools built onzfs send, such as zrepl with itspulljob type, can run the transfer from the offsite side.
For databases, use a method the database supports for consistent backups: for PostgreSQL a base backup plus a continuous WAL archive; for MongoDB mongodump --oplog on a replica set, a supported filesystem snapshot, or an oplog-aware tool such as Percona Backup for MongoDB. Ship those files the same way. A plain file copy of a running database's data directory, taken without the database's backup mode or an atomic snapshot, is not a reliable backup.
Layer 3: object storage you own#
If your applications already speak S3, you can run your own S3-compatible store at the offsite site. Ceph's RADOS Gateway is the established free option at scale, and it implements the S3 Object Lock API with GOVERNANCE and COMPLIANCE retention modes. The semantics follow the S3 model as AWS documents it. Enable Object Lock when you create the bucket. Older Ceph releases only allowed it at creation; newer ones can also enable it on an existing bucket (the Reef 18.2.8 release notes list that change), so check your version. With a retention period set, locked object versions cannot be deleted or overwritten through the S3 API until it expires, even by a client holding valid keys, with the GOVERNANCE exception below. A client can still add new versions or delete markers, but the locked version stays. (Object Lock is a rule enforced on S3 requests. It does not protect against someone who controls the storage cluster underneath, who could, for example, remove the pools, so keep those credentials separate too.) In that model, GOVERNANCE mode lets users with a special bypass permission remove the lock; COMPLIANCE mode does not, so for backups that must survive stolen keys, COMPLIANCE is the one to use. Confirm how your store implements both before relying on it.
Ceph is a serious system to run; for a single offsite box it is usually more than you need, and the layers above are simpler. If you choose a smaller S3-compatible server, check its Object Lock support and its licence and maintenance status before you rely on it.
Layer 4: an offline copy#
Pull-based, append-only, locked copies all still sit on a machine that is switched on and reachable over a network. For the worst case, keep one copy that is not.
- Removable datastores in PBS. Since PBS 3.3, a datastore can live on removable media; after unmounting, "the medium can be removed," and the same datastore can be used on more than one PBS instance (roadmap, storage docs). PBS 4.0 added sync jobs that run when the device is mounted (
run-on-mount), PBS 4.1 added automatic unmount after such a sync, and PBS 4.2 added agc-on-unmountoption so garbage collection runs before the device detaches. A rotation of two or three disks, with one always in a safe somewhere else, is a cheap way to keep an offline copy. - Tape. PBS also supports tape backup to LTO drives (LTO-5 and later per the docs) and tape libraries. For large estates and long retention it is a common choice, and a tape on a shelf cannot be reached over the network.
Seeding the first copy#
The first full copy is the one that hurts over a WAN. As an illustrative calculation: 10 TB over a 1 Gbit/s link at full line rate is 10 × 10¹² × 8 ÷ 10⁹ = 80,000 seconds, a little over 22 hours. Real throughput is lower, especially if the link also carries production traffic. After the first copy, a PBS sync only transfers the chunks the offsite side does not already have, plus the small index and metadata files of each new snapshot (ZFS incremental sends and S3 tools work differently); how much that saves depends on how much your data changes.
The practical shortcut is to seed by hand: fill a disk at the primary site and carry it to the offsite box. PBS removable datastores make the carrying part straightforward, since a datastore created on one PBS can be added to another with "Reuse existing datastore" checked, per the storage docs. How the seeded data then becomes the base for network syncs (keep pulling into that datastore, or sync it locally into the offsite main datastore first) has to be planned: namespace mapping, compatible owners on the target backup groups, and the same encryption keys on the clients so encrypted chunks keep deduplicating (the PBS boxes themselves do not need the keys). Test that step on a small datastore before you rely on it.
Restore drills, or it did not happen#
An offsite copy is only as good as the last time you restored from it.
- Run verify jobs on the offsite PBS so silent corruption is found early.
- Once a quarter, restore a real system from the offsite copy to spare hardware, over the real link, and time it. That number is your observed restore time for that scenario. Compare it with the recovery time objective in the policy; a real incident will add work around it, so do not expect to beat it.
- Test the bad day too: restore with only the credentials and keys that are kept offsite. If the restore needs something that only exists at the primary site, you have found the gap.
- Alert on sync jobs that fail or stop running. A sync that quietly stopped months ago is easy to miss until the day you need it.
Next in the series: monitoring and alerting that does not depend on a SaaS.
The know-how in this series stays open. If you want an offsite backup design for your estate, across sites, retention and restore drills, planned or built with you, NG-NeXT does consulting and turnkey builds. Tell us what you run today through the contact page.
— Nishant Gauraw, Founder and CEO, NG-NeXT Tech