How to Point a Domain to Your Server: DNS Records Explained
Connect your domain to a VPS or hosting account with confidence. DNS record types in plain English, nameservers vs individual records, TTL and propagation, email records…
Snapshots alone are not a backup plan. How to apply the 3-2-1 rule to a VPS with automated, encrypted, off-site backups and regular restore tests.
On a VPS you have full control, which also means backups are your responsibility. Hardware fails, people delete the wrong directory, updates break things, and compromised servers sometimes need to be rebuilt from scratch. A solid backup strategy turns each of these from a disaster into an inconvenience. The time-tested framework for that strategy is the 3-2-1 rule.
Some teams extend this to 3-2-1-1-0: one copy offline or immutable (cannot be changed or deleted, protecting against ransomware), and zero errors when restores are verified.
| Risk | Snapshot on same platform | Off-site backup |
|---|---|---|
| Accidental file deletion | Yes | Yes |
| Bad update or config change | Yes | Yes |
| Compromised server | Partly (if snapshot predates attack) | Yes |
| Attacker or mistake deletes backups | No, if same credentials | Yes, if append-only or separate keys |
| Account or billing problem | No | Yes |
| Data centre incident | No | Yes |
Rather than imaging the whole disk, back up what you cannot easily recreate:
/etc (especially web server, PHP, firewall and cron), Docker Compose files, environment files.The OS itself can be reinstalled in minutes. Better still, script your setup so rebuilding is repeatable.
Your RPO sets backup frequency. Your RTO determines whether you need a warm standby server or whether restoring onto a fresh VPS is fast enough.
Copying database files while the database runs can produce an inconsistent backup. Use the database's dump tools instead:
# MySQL / MariaDB (InnoDB)
mysqldump --single-transaction --routines --all-databases | gzip > /backup/db-$(date +%F).sql.gz
# PostgreSQL
pg_dumpall | gzip > /backup/pg-$(date +%F).sql.gz
Run the dump just before your file backup so both are captured together.
| Tool | Strengths | Notes |
|---|---|---|
| restic | Encrypted, deduplicated, many storage backends | Great default for most VPS users |
| BorgBackup | Encrypted, deduplicated, fast | Works best with an SSH target |
| rsync | Simple, ubiquitous | No built-in encryption or versioning; combine with snapshots |
| Panel backups (cPanel etc.) | Easy, complete account backup | Send copies off-site |
# Install
sudo apt install restic
# Set the repository and password (store these safely)
export RESTIC_REPOSITORY=sftp:backup@backup-host:/srv/restic/web1
export RESTIC_PASSWORD_FILE=/root/.restic-pass
# Initialise once
restic init
# Back up
restic backup /var/www /etc /backup
# Apply retention
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
Schedule the dump and restic commands in a script run nightly by cron or a systemd timer. Send yourself an alert if the job fails.
Options for the off-site copy:
Choose a different location from your main server. If your server is in Frankfurt, keep backups in Amsterdam or London, for example. See our guide to choosing a server location.
| Copy | Where | Frequency | Retention |
|---|---|---|---|
| 1. Live data | Production VPS | - | - |
| 2. Local dumps | /backup on production VPS | Nightly | 3 days |
| 3. Off-site encrypted | Backup VPS in another city | Nightly (hourly DB for shops) | 7 daily, 4 weekly, 6 monthly |
Consider a small online shop on a VPS that takes orders throughout the day. Losing a full day of orders would mean lost revenue, unhappy customers and manual reconciliation with the payment processor, so a daily backup is not enough.
A personal blog, by contrast, might be perfectly well served by nightly backups, 30 days of retention and a quarterly restore test. Match the plan to what losing data would actually cost you.
Backups fail silently more often than they fail loudly. A full disk, an expired SSH key or a changed password can stop backups for weeks before anyone notices. Protect against this in three ways:
set -euo pipefail in bash.stats command helps you spot this.RexaHost shared hosting plans include daily backups, which covers many accidents. For important sites, download a full cPanel backup periodically, or store it with a separate provider, to meet the off-site part of the 3-2-1 rule.
Backups are your safety net when something goes wrong, from a failed upgrade to a security incident. After a compromise, restore onto a fresh server from a backup taken before the intrusion, rather than cleaning the infected system. Our DDoS response runbook covers another type of incident worth planning for.
Need a primary server or a backup target? Browse Linux VPS plans across ten Standard locations, pay with crypto and deploy in minutes.
Keep at least three copies of your data, on two different types of storage or systems, with one copy off-site, away from the primary server.
A snapshot is useful for quick rollbacks, but if it lives on the same platform as the server it does not protect against every failure. Keep independent off-site copies too.
It depends on how much data you can afford to lose. Daily is a common minimum; busy databases and shops often need hourly backups or continuous replication.
A typical policy keeps 7 daily, 4 weekly and several monthly backups, balancing recovery options against storage cost.
Test restores regularly to a separate server or directory and confirm the application runs with the restored data.
Plans in this article
Keep reading
Connect your domain to a VPS or hosting account with confidence. DNS record types in plain English, nameservers vs individual records, TTL and propagation, email records…
A calm, practical runbook for the first hour of a DDoS attack: how to tell an attack from a traffic spike, what to send your host, which mitigations to apply and how to …
Hosting adverts love uptime percentages. Here is what 99.95% means in real minutes, the difference between a target and a contractual SLA, and how to measure availabilit…