The VPS hosting your website, family cloud or business database has worked for years—until a disk fails, a configuration is deleted or the wrong command removes the only working directory. A backup plan that exists only in a spreadsheet is no plan at all. Restic or BorgBackup with borgmatic can turn a Linux server into a system that makes encrypted, versioned copies to another storage location and checks them on a schedule. NodeMCP helps an AI assistant inspect an authorized host and design a safe procedure. The real success metric is not 'backup completed': it is whether you can restore a clean service with its data and secrets when the main server is gone.
Restic and borgmatic are two alternatives, not one combined program
Restic is a standalone encrypted backup application that works with local repositories and many remote/object-storage backends. BorgBackup is a separate deduplicating encrypted archiver, often used over SSH, while borgmatic is the configuration and automation layer for BorgBackup—not a plugin that controls Restic. Choose ONE stack after examining storage destinations, supported versions, repository formats and operator skills; do not combine commands from the two tutorials in one job. Restic released version 0.20.0 on November 19, 2026 with important restore-related security fixes, so check the current patched release before handling untrusted repositories. Likewise verify Borg and borgmatic version compatibility before deploying.
Start from a disaster you could realistically experience
Make a list of the assets you would need to recover: website files, databases, application configuration, certificates, container volume contents, identity and backup encryption keys. Put each item next to its acceptable recovery point (how much recent data may be lost) and recovery time (how long a restore may take). A small blog may tolerate daily copies; an order database may need shorter intervals and a consistent transactional dump. Exclude ephemeral caches and huge re-downloadable media deliberately, but include anything that cannot be recreated. Have NodeMCP produce a read-only inventory of directories, mounts, services, databases, disk space and existing backup routines before touching live data.
Use 3-2-1 thinking, with a real off-site destination
The traditional 3-2-1 guideline calls for multiple copies, different storage media or failure domains and one copy off-site. The important part is independence: two snapshots on the same VPS disk do not survive its loss. Choose a destination such as an authorized remote SSH host or object storage compatible with your chosen tool. Encrypt before transfer and verify that the storage provider cannot quietly read the contents. Understand who can delete backups: if the production server possesses unrestricted delete credentials, an attacker who compromises it may erase the remote copies. Retention locks, append-only repositories or restricted backup credentials can reduce that risk but require careful testing.
Keep secrets available to restore, but not visible in logs
Restic uses a repository password or supported password-file mechanism; Borg uses encryption modes and key material that must be preserved under the chosen repository format. Losing the only decryption secret can make every snapshot unreadable. Store secrets using restricted files or a supported key manager, never hard-code them into published scripts, AI chats, shell history or monitoring logs. Keep an emergency recovery kit physically or logically separate from the server, with repository URL, credentials, encryption keys and recovery steps. Test a fresh machine can access the kit without relying on a password manager stored on the failed host.
A live database directory is not a reliable database backup
Copying a running PostgreSQL, MariaDB or SQLite data directory as plain files can produce an inconsistent set when transactions are active. Prefer documented database-specific logical dumps, consistent snapshots or supported physical backup tools appropriate to the workload. For MySQL/MariaDB, validate transactional dump options and special tables; for PostgreSQL, plan pg_dump or a proper physical backup strategy. For Docker volumes, map every persistent mount first and back up the data and configuration through application-aware procedures. Restic and borgmatic can archive the resulting consistent database export, but neither magically makes an arbitrary live database copy transactional. Include restore order and version compatibility in your notes.
Automate with predictable schedules and failure signals
Use systemd timers or a documented scheduler that cannot start overlapping backups accidentally. Measure how long an initial full backup takes, how much bandwidth it consumes, and what happens when the remote destination is unavailable. Schedule backup, validation and retention at suitable times; keep a non-overlapping maintenance window for pruning or repository compaction. Collect exit codes and emit an alert on failure rather than reporting success because a cron command started. A Telegram or email notification should include the host, repository, job time and a redacted error—not the backup password. Run one controlled network-failure test so the team knows how the system recovers.
Retention policy and cleanup can destroy the wrong history
Versioned snapshots are useful only when you know how long they are retained. A starter rule might keep daily recovery points for a week and weekly/monthly points longer, but actual needs depend on legal retention, storage budgets and how long an error can remain undiscovered. In Restic, `forget` changes snapshot retention while `prune` reclaims unreferenced data; review the selected snapshots and repository state before automated destructive cleanup. In borgmatic, retention and consistency checks wrap Borg operations and use their own configuration syntax. Never enable aggressive cleanup on the first day. Test that a file deleted two weeks earlier can still be recovered if the policy promises that.
Check the repository, then actually restore files
Restic's `check` validates repository structure, and optional data-reading modes inspect stored pack contents more thoroughly at a cost in time and bandwidth. Borg and borgmatic have their own consistency checks and extract commands. These tests are necessary but not sufficient: an archive can be internally consistent yet omit the one directory you needed. Restore a sample website file, a configuration tree and a database dump into a new isolated location. Verify owners, modes, symlinks, application compatibility and secret availability. Never restore an untrusted repository directly over production as root without reviewing the source and its contents; recent restic security fixes illustrate why restore boundaries matter.
Build resilience against both human mistakes and attackers
Restrict which user and process can read source secrets and write to the backup destination. Keep the network surface small, consider a separately controlled off-site repository and apply security updates before running archive extraction. Protect monitoring credentials, use encryption for transport, rotate stale access keys where practical, and record who may authorize deleting historic copies. Backups also contain private customer or family information and must be protected under appropriate access policies. Run periodic recovery drills on a disposable VM, record real recovery times and learn from missed files. Don't mistake RAID, filesystem snapshots, cloud sync or a single archive on the same disk for a complete backup strategy.
Prove recovery before announcing the backup service ready
Connect your authorized Linux host through NodeMCP and ask for a read-only inventory of services, databases, volumes, storage and existing recovery procedures. Compare Restic versus BorgBackup plus borgmatic against the selected off-site destination and choose one. Approve restricted credentials, encrypted repository initialization, a safe database export job, a scheduler with alerts, a reasonable retention plan and checks. Back up a small but realistic test dataset, deliberately remove its working copy in an isolated sandbox and restore files plus a test database. Verify data integrity, ownership and the service start sequence. Only after this drill should the system join your production maintenance routine.
Try this practical NodeMCP prompt
I administer authorized NodeMCP Linux host [DEVICE]. I need encrypted, automated off-site backups to [DESTINATION] for [SERVICES, DATABASES, PATHS]. START READ ONLY: inventory data and Docker volumes, database engines, current backups, available space, disk mounts, network, bandwidth, cron/systemd timers and privileges. Compare TWO ALTERNATIVES accurately: Restic directly, or BorgBackup managed by borgmatic (borgmatic does NOT run Restic). Check current security updates and version compatibility. Recommend 3-2-1 separation, encrypted remote repository, limited credentials/append-only or immutable options, securely escrowed decryption keys and a restoration kit. Identify consistent per-database dumps, exclusions, retention with safe prune/forget review, scheduling without overlapping jobs, repository checks and failure Telegram alerts without secrets. Never delete originals or old backups without explicit authorization. After approval test with a sandbox dataset, simulate network failure, then restore selected files and a database to an ISOLATED test VM; verify hashes, ownership, credentials and service boot. Document RPO/RTO, failure modes, periodic restore drills and a rollback plan.
Official documentation
- Restic — official documentation
- Restic 0.20.0 security-related release
- Restic — retention and pruning
- borgmatic — official project
- borgmatic — database backup and restore
NodeMCP — documentation and getting started
Try this prompt
I administer authorized NodeMCP Linux host [DEVICE]. I need encrypted, automated off-site backups to [DESTINATION] for [SERVICES, DATABASES, PATHS]. START READ ONLY: inventory data and Docker volumes, database engines, current backups, available space, disk mounts, network, bandwidth, cron/systemd timers and privileges. Compare TWO ALTERNATIVES accurately: Restic directly, or BorgBackup managed by borgmatic (borgmatic does NOT run Restic). Check current security updates and version compatibility. Recommend 3-2-1 separation, encrypted remote repository, limited credentials/append-only or immutable options, securely escrowed decryption keys and a restoration kit. Identify consistent per-database dumps, exclusions, retention with safe prune/forget review, scheduling without overlapping jobs, repository checks and failure Telegram alerts without secrets. Never delete originals or old backups without explicit authorization. After approval test with a sandbox dataset, simulate network failure, then restore selected files and a database to an ISOLATED test VM; verify hashes, ownership, credentials and service boot. Document RPO/RTO, failure modes, periodic restore drills and a rollback plan.
Illustrative workflow, not a record of completed tasks. Review privileged actions and keep backups.
Take Control of Your Money on Linux with Actual Budget and AI
Host Your Own Password Vault on Linux with Vaultwarden and AI
Host Your Own Git Server on Linux with Forgejo and AI