How do you back up a VPS?
Back up a VPS in layers. Keep the provider's daily full-server backups for whole-server recovery, take a snapshot before any risky change, and send your own copy off the server every night: files with restic or rsync, databases with mysqldump or pg_dump, and Windows with Windows Server Backup to another machine. Keep three copies on two kinds of storage with one off-site, and test a restore every month.
Below is what every RapidServer VPS in Mumbai (BOM1) or Delhi NCR (DEL1) includes, then each layer with commands.
What every RapidServer VPS includes
From our VPS hosting plans and SLA clause 9, for Linux and Windows VPS, managed or unmanaged:
- Daily backups, kept 7 days, free. An automated full-server backup runs every day and is kept for 7 days, included with every plan.
- Snapshots on demand. Take one before a risky upgrade and roll back in minutes if it goes wrong.
- Extended backups, optional. In the VPS configurator, Extended backups keep 30 days instead of 7, for 20% of the compute price.
- Encrypted archives. Backup archives on storage we manage are encrypted at rest.
How restores work. Send a restore request through a client area ticket. The SLA sets a 24-hour Recovery Point Objective, so up to a day of changes can be lost, and an 8-hour Recovery Time Objective from when we accept a valid request. Each service gets 1 free restore request per calendar month; further restores may be charged, and you are told before work starts.
The SLA also says backups are a convenience, not a replacement for your own, and no backup is promised to be restorable.
VPS snapshot vs backup: the difference
A snapshot captures the whole server at one moment: a safety net for a change you are about to make, such as an OS upgrade or a Windows feature update. A backup is taken on a schedule and kept for a set time, so you can go back after a mistake, a failure or a bad deploy you noticed late. Your own off-server backup lives outside your hosting account.
| Snapshot | Daily backup (included) | Your own off-server backup | |
|---|---|---|---|
| When it's taken | When you take it | Automatically, every day | On your schedule, from cron or Task Scheduler |
| What it covers | The whole server at that moment | The whole server | The files and databases you choose |
| How long it's kept | Short term, until the change has proved itself | 7 days; 30 with Extended backups | As long as you set |
| How you restore | Roll back in minutes | Restore request: 1 free a month, 8-hour target | Yourself, to any server |
| Best for | Undoing a bad update | Recovering the server after a mistake or failure | Longer history, account problems, moving providers |
Use all three: they cover different failures.
The 3-2-1 backup rule
The 3-2-1 rule is a simple test for any backup plan: keep 3 copies of your data (the live copy plus two backups), on 2 kinds of storage, with 1 copy off-site.
For a VPS, that means the live server, the included daily backups, and a copy you control: a restic repository on another server, object storage or an office machine. The daily backups sit with the same provider and account as the VPS, so they aren't your off-site copy. Ideally, keep one copy the server itself can't change or delete.
Linux VPS backup: restic and rsync
restic is a free backup program that encrypts your data and keeps a history of snapshots on another server (over SFTP) or on S3-compatible object storage. As root (see SSH kya hai), run apt install restic on Ubuntu or Debian, set up SSH key login to the backup server, then create a password file and the repository:
openssl rand -base64 32 > /root/.restic-pass && chmod 600 /root/.restic-pass export RESTIC_REPOSITORY=sftp:backup@backup.example.com:/srv/restic-repo export RESTIC_PASSWORD_FILE=/root/.restic-pass restic init
For object storage, set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and use a repository such as s3:https://s3.example.com/bucket_name. Keep the restic password off the server too: without it, the data can't be recovered.
Save this as /root/backup.sh, run chmod 700 on it and run it nightly from root's crontab, for example 30 2 * * * /root/backup.sh. It follows restic's backup and forget pages:
#!/bin/sh export RESTIC_REPOSITORY=sftp:backup@backup.example.com:/srv/restic-repo export RESTIC_PASSWORD_FILE=/root/.restic-pass set -e mkdir -p /root/db-dumps mysqldump --single-transaction --quick shop > /root/db-dumps/shop.sql restic backup /etc /var/www /home /root/db-dumps restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
set -e stops the script if the dump fails, so restic never stores a broken dump. The forget line keeps six monthly copies, a longer history than the 7-day server backups.
rsync copies a folder to another server over SSH; add -n first for a dry run:
rsync -az --delete /var/www/ backup@backup.example.com:/srv/mirror/www/
With --delete it is a mirror: a file deleted or damaged on the VPS is deleted or damaged in the copy too. Use rsync for a second copy and restic for history.
Databases: mysqldump and pg_dump
Copying a live database's files can give a copy that won't start, so dump it instead. For MySQL or MariaDB, mysqldump with --single-transaction dumps InnoDB tables in a consistent state without blocking the site:
mkdir -p /root/db-dumps mysqldump --single-transaction --quick shop > /root/db-dumps/shop-$(date +%F).sql mysqldump --single-transaction --all-databases > /root/db-dumps/all-$(date +%F).sql mysql -e 'CREATE DATABASE shop_test' mysql shop_test < /root/db-dumps/shop-2026-11-28.sql
For PostgreSQL, pg_dump exports consistently while the database is in use. Restore its custom format (-Fc) with pg_restore, and save roles with pg_dumpall --globals-only:
sudo -u postgres pg_dump -Fc shop > /root/db-dumps/shop-$(date +%F).dump sudo -u postgres pg_dumpall --globals-only > /root/db-dumps/globals.sql sudo -u postgres createdb shop_test sudo -u postgres pg_restore -d shop_test < /root/db-dumps/shop-2026-11-28.dump
For large or busy databases, both projects point beyond dumps: see MySQL's notes on physical backups and PostgreSQL's backup chapter. Include /root/db-dumps in your restic backup.
Windows VPS backup
On a Windows VPS, use Windows Server Backup. It isn't installed by default: add it in Server Manager or with PowerShell, as Microsoft Learn shows, then run wbadmin start backup as Administrator:
Install-WindowsFeature -Name Windows-Server-Backup wbadmin start backup -backupTarget:\\backup-pc\vps1\mon -include:C:\Data -quiet wbadmin start backup -backupTarget:\\backup-pc\vps1\full -allCritical -quiet
The first backup copies a data folder; -allCritical covers every volume Windows needs for a bare-metal recovery. That backup can't go to a volume it includes, so on a single-drive VPS, target a shared folder on another machine (add -user and -password if it needs a login). Microsoft warns that a new backup to the same shared folder overwrites the last one, so use a subfolder per day. wbadmin enable backup sets a schedule.
Reach the share over a VPN, never file sharing open to the internet, and limit Remote Desktop to your own IP addresses with the client area firewall (see our firewall guide). For TallyPrime, also keep Tally's own backups: how to use Tally on cloud.
Test your restores
A backup you have never restored is a hope, not a plan. Once a month, restore the latest restic snapshot to a scratch folder, load a database dump into a test database, and on Windows recover a folder to another path with wbadmin start recovery. restic check --read-data-subset=10% verifies a random 10% of the repository's data files (restic docs):
restic snapshots restic restore latest --target /tmp/restore-test restic check --read-data-subset=10%
Time each test, and keep the steps, the restic password and database logins somewhere you can reach when the server is down.
What backups don't protect against
- Problems noticed too late. If malware or corrupted data goes unnoticed longer than your retention, every copy holds it. Server backups keep 7 days (30 with Extended backups), so keep monthly copies of your own.
- Restoring an infected copy. A backup taken after a break-in brings the attacker back. Reinstall a clean image, restore only data from before the break-in, and change every password and key.
- Mirrors and reachable backups.
rsync --deletecopies deletions, and anyone with root on the VPS can use the backup login stored there. Limit that login to its own folder and keep one copy the VPS can't reach. - Data leaks. A backup can't take back data that was stolen.
- A service that has ended. Its data is kept for 30 calendar days for export, then the data and all backup copies are erased.
Want the server looked after for you? See managed vs unmanaged VPS; your off-server copy of important data stays your job either way.
KVM VPS in Mumbai or Delhi NCR with daily full-server backups kept 7 days and snapshots on demand, ready a few minutes after payment, from ₹581/mo plus 18% GST.
See VPS plansQuestions
Are backups included with a RapidServer VPS?+
What is the difference between a VPS snapshot and a backup?+
How do I restore my VPS from a backup?+
Do I still need my own backups if backups are included?+
How do I back up a Windows VPS?+
wbadmin start backup -allCritical, to a shared folder on another machine, using a subfolder per day.