
Core takeaway
- Aim for recovery, not backups: decide what must be recoverable, how much recent work you can afford to lose, where the copies live, and whether you have actually restored one.
- Never keep the only copy on the server: store at least one backup away from the production VPS, encrypted, and keep multiple versions rather than one overwritten copy.
- A snapshot alone is not a plan: a provider snapshot, a nightly job or a database export each helps, but none alone is a complete recovery plan. Take a snapshot before major changes.
- Test the restore: document the restore process and test it regularly in a safe environment.
Disclosure: con1ainer.com participates in affiliate programs. This article contains no affiliate links. See the Affiliate & Commercial Disclosure.
Two quick reminders on why a copy on the same server is not a backup.
A VPS backup is only useful if it can restore your website, application, database, and configuration when something goes wrong.
That sounds obvious, but many VPS owners discover the difference between “we have backups” and “we can recover” at the worst possible moment: after a failed update, accidental deletion, corrupted database, ransomware incident, storage failure, or badly timed deployment.
A provider snapshot can be useful. A nightly backup job can be useful. A database export can be useful. None of those alone is necessarily a complete recovery plan.
A proper VPS backup strategy answers four questions:
- What exactly must be recoverable?
- How much recent work can you afford to lose?
- Where are the backup copies stored?
- Have you actually restored one successfully?
This guide explains how to build a practical backup plan for a VPS without turning a straightforward job into a bureaucratic exercise.
The Short Answer
A sensible VPS backup strategy should include:
- Regular backups of databases, application files, uploads, and configuration.
- At least one backup copy stored away from the production VPS.
- Encryption for sensitive backup data.
- Retention of multiple backup versions rather than one constantly overwritten copy.
- A snapshot before major changes or risky deployments.
- A documented restore process.
- Regular restore tests in a safe environment.
The basic principle is simple: do not keep your only recovery option on the same server that may fail, be compromised, or be deleted.
CISA recommends maintaining offline, encrypted backups of critical data and regularly testing their availability and integrity in a disaster-recovery scenario. That matters because ransomware and other destructive events can target accessible backups as well as production data. (source: CISA #StopRansomware Guide)
What Needs Backing Up?
A VPS is more than the files in one website directory.
To rebuild a working server or application, you may need several different kinds of data. Missing any one of them can turn a quick restore into a long and unpleasant reconstruction job.
For most website or application VPS setups, back up:
| What to back up | Why it matters | Typical examples |
|---|---|---|
| Databases | Often hold the live content, accounts, orders, settings, and application data | MySQL, MariaDB, PostgreSQL, Redis data where persistence is required |
| Application files | Needed to run the website, API, or service | WordPress files, Laravel app, Node.js project, Python app |
| Uploaded media | May not exist in source control or deployment packages | Images, PDFs, customer uploads, product assets |
| Configuration files | Rebuild the working environment correctly | Nginx, Apache, PHP, systemd, Docker Compose, firewall configuration |
| Environment settings | Applications often depend on specific variables and service endpoints | Environment files, API endpoints, queue settings, service URLs |
| SSL and certificate configuration | Helps restore secure web service settings quickly | Nginx TLS configuration, certificate-renewal setup |
| Scheduled jobs | Important automated work may not be obvious until it stops running | Cron jobs, backup jobs, queue workers, cleanup scripts |
| Deployment documentation | Makes recovery repeatable rather than dependent on memory | Setup notes, server inventory, restore instructions |
Do not casually copy secrets into a backup plan without thinking about access. Private keys, API tokens, database passwords, encryption keys, and environment files may be necessary for recovery, but they deserve stronger protection than ordinary website files.
If you are still getting familiar with what sits inside your server, start with What Is a VPS and How Does It Work?. A VPS gives you control, but it also makes you responsible for the operating system, applications, data, and recovery process.
Snapshot vs Backup: What Is the Difference?
The short answer: a snapshot is a point-in-time copy of the whole VPS disk, usually stored by the provider on the same platform and built for fast rollback. A backup is an independent copy of the data you need, stored separately and kept in multiple versions, built for recovery when the server, the account or the platform is gone. A snapshot answers “undo that change.” A backup answers “rebuild from nothing.”
These terms are often used as though they mean the same thing. They do not.
| Tool | What it is good for | What it does not replace |
|---|---|---|
| VPS snapshot | Fast rollback before an update, migration, deployment, or configuration change | Independent, long-term, off-site backups |
| File backup | Recovering application files, uploads, configuration, or selected directories | Consistent database protection on its own |
| Database backup | Restoring site content, user records, orders, application data, and settings | Application files, server configuration, media uploads |
| Full server image | Rebuilding a whole machine or cloning a known-good system | Multiple versions, independent storage, and routine restore testing |
| Off-site backup | Recovering after VPS failure, account problems, ransomware, or accidental deletion | A local rollback point before a small change |
A snapshot is valuable because it captures a point in time and can allow a quick rollback. Create one before major system updates, panel changes, database migrations, or infrastructure work.
But a snapshot is not automatically a complete backup plan. It may live inside the same provider account, use the same billing relationship, depend on the same provider infrastructure, or be unavailable if the underlying account is compromised. Treat it as one layer of recovery, not the only layer.
Apply the 3-2-1 Backup Rule to a VPS
The familiar 3-2-1 backup rule is a useful starting point:
- Keep three copies of important data.
- Store those copies on two distinct storage systems or locations.
- Keep one copy off-site or otherwise isolated from production.
For a small VPS running a website, that does not need to mean three different data centres and a rack of tapes in the basement. It can be as practical as:
| Copy | Location | Purpose |
|---|---|---|
| Production data | Your VPS | The live website, application, or service |
| Automated backup | Separate backup storage or provider backup service | Routine recovery from file loss, broken updates, or database problems |
| Independent off-site copy | A separate cloud-storage account, backup provider, or controlled local archive | Recovery if the VPS, provider account, or primary backups are unavailable |
The critical detail is separation. A backup stored only on the production VPS is not a backup against VPS failure. A backup stored under the same easily compromised credentials as the production server is also weaker than it appears.
Where practical, use separate credentials for backup storage and restrict the production VPS to writing backups rather than deleting old ones. CISA specifically advises offline, encrypted backups because ransomware often tries to find and encrypt or delete accessible backup copies. (source: CISA #StopRansomware Guide)
How Often Should You Back Up a VPS?
Backup frequency depends on how much data changes and how much loss you can tolerate.
If your website changes once a month, daily database backups may be excessive. If you run an active ecommerce site, membership service, booking system, client portal, or application that changes constantly, a weekly backup is plainly not enough.
Think in terms of your acceptable data loss window.
| Type of VPS workload | Sensible starting point |
|---|---|
| Static brochure website | Weekly files and monthly full snapshot, plus a snapshot before changes |
| Small blog or portfolio site | Daily database backup, weekly files, snapshot before updates |
| Active WordPress or CMS site | Daily database and files, multiple retained versions, pre-update snapshot |
| Ecommerce, membership, booking, or client portal | Database backups every few hours or more often, daily files, tested recovery plan |
| SaaS application or active API | Frequent database backups, application and configuration backups with every deployment, strong retention and monitoring |
| Development or staging VPS | Snapshot before major experiments, daily backup if the environment contains valuable data |
These are starting points, not laws. The right schedule is the one that matches your tolerance for lost work.
If losing the last 24 hours of database changes would be painful, daily backups are not sufficient. If losing the last hour would be unacceptable, your strategy needs more frequent data protection.
Back Up Databases Properly
For most dynamic websites and applications, the database is the part that changes most often.
A WordPress site can often be rebuilt from files and a database backup. An ecommerce store, booking system, CRM, membership site, or web application may have orders, customer records, payments, messages, account changes, and content updates arriving throughout the day.
Back up databases separately from the rest of the server.
A good database backup process should:
- Run automatically on a schedule.
- Create a timestamped backup rather than overwriting the previous one immediately.
- Store copies away from the production VPS.
- Alert you if the backup job fails.
- Retain enough history to recover from a problem discovered days or weeks later.
- Be tested by restoring into a safe environment.
For MySQL or MariaDB, that may involve scheduled logical dumps. For PostgreSQL, it may mean using the appropriate PostgreSQL backup tools. Larger and busier databases may require point-in-time recovery, replication, managed-database features, or specialist tooling.
The exact tool matters less than the outcome: you need a usable copy of the database from a known point in time.
Do not assume a server snapshot captures a database in a clean, recoverable state during active writes. Snapshot-based backups can be useful, but database-aware backups are often safer for important transactional data.
Back Up Files, Uploads, and Configuration
A database backup without application files is incomplete. Application files without a database backup may be equally incomplete.
At a minimum, include:
- Website or application directories.
- Uploaded media and customer-generated files.
- Web-server configuration.
- Application configuration.
- Docker Compose files or container definitions, if used.
- Systemd service files.
- Scheduled task configuration.
- Deployment scripts and operational notes.
If you deploy application code from Git or another source-control system, that reduces the importance of backing up every line of source code. It does not remove the need to back up uploads, environment settings, server configuration, deployment configuration, and the database.
For a WordPress site, for example, a practical recovery set often includes:
| Component | Why you need it |
|---|---|
| Database export | Posts, pages, users, settings, comments, orders, and plugin data |
wp-content/uploads | Images, documents, and media not stored in Git |
| Themes and plugins | Needed if the deployed versions are not otherwise recorded |
wp-config.php or equivalent configuration | Database connection settings and application-specific configuration |
| Nginx or Apache configuration | Virtual-host rules, redirects, TLS setup, and performance settings |
| Certificate renewal setup | Helps restore HTTPS operations cleanly |
| Deployment and restore notes | Prevents recovery from becoming guesswork |
Store Backups Away From the VPS
The most common backup mistake is keeping every copy on the same machine.
If the VPS fails, is wiped, is locked by a provider issue, is compromised, or is hit by a destructive command, local backup files can disappear along with everything else.
Use one or more of these destinations:
| Backup destination | Strengths | Watch for |
|---|---|---|
| Provider backup service | Convenient, often integrated with restore tools | Check retention, restore options, pricing, account separation, and whether it is genuinely independent enough for your needs |
| Object storage | Scalable, durable, suitable for encrypted automated backups | Configure access carefully and monitor storage costs |
| Separate backup provider | Clear separation from the production VPS provider | Confirm restore speed, retention, encryption, and account controls |
| Another server | Flexible and direct | Do not create a second poorly secured single point of failure |
| Local encrypted archive | Useful as an additional independent copy | Not a substitute for automatic off-site backups; protect the device and test restores |
When evaluating a host, backup capabilities should be part of the decision—not an afterthought. The provider-selection questions in How to Choose a VPS Provider are useful here: know what is included, how often copies run, how long they are retained, what restores cost, and whether you can test one independently.
Encrypt Backup Data and Protect Access
Backups often contain everything an attacker would want: customer data, database contents, passwords, configuration, application secrets, and private files.
Protect them accordingly.
| Protection measure | Why it matters |
|---|---|
| Encrypt backups in transit | Prevents interception while data moves from the VPS to storage |
| Encrypt backups at rest | Protects backup content if storage is exposed or accessed improperly |
| Use separate backup credentials | Limits the chance that a compromised VPS account can erase all copies |
| Enable MFA on backup and provider accounts | Makes account takeover harder |
| Restrict delete permissions | Helps protect retained backups from accidental or malicious deletion |
| Store encryption keys securely | A perfectly encrypted backup is useless if nobody can recover the key |
| Review who can access backups | Former contractors, old accounts, and unused tokens should not retain access |
Be cautious with environment files and secrets. If they are backed up—and many must be—make sure the backup storage and restore process do not casually expose them to people who should not have access.
Keep Multiple Versions
A backup strategy with one rolling copy can fail at precisely the wrong time.
Imagine a database begins corrupting quietly on Monday. Your daily backup job overwrites the only backup every night. You discover the problem on Friday. By then, every available copy may contain the same corruption.
Multiple versions give you options.
A practical retention pattern for a typical website VPS might look like this:
| Backup type | Frequency | Retention |
|---|---|---|
| Database backup | Daily | 14 to 30 daily copies |
| Application files and uploads | Daily or weekly, depending on change rate | 7 to 12 copies |
| Full VPS or server image | Weekly | 4 to 8 weekly copies |
| Monthly archive | Monthly | 3 to 12 monthly copies |
| Pre-change snapshot | Before major updates, migrations, or deployments | Keep until the change is verified and stable |
Retention needs vary. A quiet personal site may need less. A business system with legal, financial, operational, or client obligations may need a more deliberate policy.
The point is not to hoard backups forever. The point is to preserve enough historical versions to recover from problems that are discovered late.
Protect Against Ransomware and Corruption
Backups can be damaged by the same event that damages production.
Ransomware operators frequently look for accessible backups. A script with unrestricted delete access can erase old backup versions. A corrupted database can be faithfully backed up night after night.
Reduce that risk by:
- Keeping at least one backup copy isolated from the production VPS.
- Using separate credentials for backup storage.
- Restricting deletion permissions where possible.
- Maintaining retention and version history.
- Encrypting backup data.
- Monitoring backup success and failure.
- Testing restore points from more than just the newest backup.
- Keeping a snapshot before major changes, but not relying on snapshots alone.
The best time to discover that a backup is inaccessible, incomplete, or corrupt is during a routine test—not after a real failure. NIST guidance emphasizes that backups should be conducted, maintained, and tested, while restore testing verifies both integrity and the ability to recover within the required time.
How to Test a VPS Restore
A successful backup job means only that the job reported success. It does not prove that the restored service will work.
A restore test should answer:
- Can you find the backup?
- Can you access it with the right credentials?
- Can you decrypt it?
- Can you restore the files?
- Can you restore the database?
- Does the application start?
- Can users log in or complete the important task?
- Are uploads, configuration, and scheduled tasks intact?
- How long does recovery actually take?
Do not test by overwriting the production server.
Instead, restore to a separate VPS, staging environment, isolated directory, or temporary database. Verify the restored system without exposing it publicly or sending accidental emails, payment requests, or notifications.
A useful restore-test process looks like this:
- Choose a backup from a recent but not necessarily newest date.
- Create an isolated test environment.
- Restore application files, uploads, configuration, and the database.
- Confirm the application starts and connects to its dependencies.
- Check representative content, user access, media files, and core functions.
- Record how long the process takes.
- Note missing components, unclear steps, access problems, and configuration gaps.
- Update the recovery documentation and test again after major changes.
For critical data, NIST recommends periodically testing backups—at least monthly in some contexts—to validate their integrity and ability to be restored. (source: NIST SP 800-209, Security Guidelines for Storage Infrastructure)
A Practical Website VPS Backup Schedule
For a typical self-managed VPS running a website or small application, this is a solid starting point:
| Task | Schedule | Notes |
|---|---|---|
| Database backup | Daily; more often for active sites | Store off-site and retain multiple versions |
| Application files and uploads | Daily | Include media directories and user-generated content |
| Configuration backup | After every meaningful server or app change | Include Nginx, Apache, systemd, Docker, cron, and deployment settings |
| VPS snapshot | Before updates, migrations, and risky deployments | Use for short-term rollback, not as the only backup |
| Full server backup or image | Weekly | Keep multiple retained copies |
| Backup verification | Daily or weekly | Alert if jobs fail, files are unusually small, or storage is unreachable |
| Restore test | Quarterly at minimum; more often for critical systems | Restore to a separate environment and record the result |
As the VPS grows more important, increase backup frequency, tighten monitoring, improve storage isolation, and rehearse recovery more often.
If the server has grown beyond what one VPS can sensibly handle, the resource and architecture question may be larger than backups alone. When to Upgrade From VPS to a Dedicated Server helps identify when a single virtual server is becoming the wrong foundation.
VPS Backup Checklist
| Check | Priority | What to verify |
|---|---|---|
| Database backups run automatically | 🟩 Essential | Schedule backups at a frequency that matches how quickly the data changes |
| Application files are backed up | 🟩 Essential | Include application directories, uploads, and user-generated files |
| Configuration is backed up | 🟩 Essential | Save web-server, application, service, deployment, and scheduled-task configuration |
| At least one copy is off-site | 🟩 Essential | Store a backup outside the production VPS and preferably outside its immediate environment |
| Multiple backup versions are retained | 🟩 Essential | Keep historical recovery points instead of one constantly overwritten copy |
| Backup failures generate alerts | 🟩 Essential | Notify someone when jobs fail, storage fills, or backups are unexpectedly small |
| Backups are encrypted | 🟧 Hardening | Protect sensitive data in transit and at rest |
| Backup credentials are separate | 🟧 Hardening | Avoid using unrestricted production credentials to manage backup storage |
| A snapshot is taken before major changes | 🟧 Hardening | Create a fast rollback point before updates, migrations, or deployments |
| Restore instructions are documented | 🟩 Essential | Record the files, commands, credentials, dependencies, and recovery order |
| Restores have been tested | 🟩 Essential | Restore into a safe environment and verify the application actually works |
| Restore time is known | 🟪 Operations | Measure how long recovery takes so expectations match reality |
| Sensitive secrets are protected | 🟧 Hardening | Secure keys, passwords, tokens, and environment files in the backup process |
| Backup retention is reviewed | 🟪 Operations | Confirm that daily, weekly, and monthly copies match business needs |
Common VPS Backup Mistakes
| Mistake | Why it fails | Better approach |
|---|---|---|
| Keeping the only backup on the VPS | The same failure can destroy production and the backup | Keep at least one encrypted off-site copy |
| Assuming a snapshot is enough | Snapshots may share provider, account, and infrastructure risk | Use snapshots for rollback plus independent backups for recovery |
| Backing up files but not databases | Dynamic sites and applications often keep their real state in the database | Run database backups separately and frequently |
| Backing up databases but not uploads | Restored sites can lose images, documents, media, and customer files | Include uploads and other generated content |
| Overwriting the only backup daily | Corruption or ransomware can silently replace good copies | Keep multiple retained versions |
| Never testing a restore | A backup may be incomplete, inaccessible, or unusable | Restore to a safe environment on a regular schedule |
| Using the same credentials everywhere | One compromised account can threaten production and backups | Separate access, enable MFA, and limit delete permissions |
| Forgetting configuration files | A restored application may fail without web-server, service, or environment settings | Back up configuration and document the rebuild process |
| Ignoring backup alerts | A failed job can go unnoticed until recovery is needed | Monitor backup success, storage availability, and file size |
| Treating provider backups as guaranteed | Retention, scope, restore timing, and responsibility vary | Read the provider terms and keep an independent copy |
Frequently Asked Questions
Are VPS snapshots the same as backups?
Not exactly. A snapshot is a point-in-time image that can be very useful for quick rollback before an update or deployment. A complete backup strategy includes independent copies, multiple retained versions, off-site storage, and tested restores.
How often should I back up a VPS?
It depends on how much data changes and how much loss you can tolerate. A quiet site may need daily or weekly backups. An ecommerce store, active membership site, client portal, or SaaS application may need database protection every few hours or more often.
Should I pay for my VPS provider’s backup service?
It can be worthwhile, especially for convenience and fast restoration. But understand exactly what it covers, how long backups are retained, whether you can restore independently, and whether you still need another backup copy outside that provider account.
Is a backup stored in cloud storage considered off-site?
Usually, yes, if it is separate from the production VPS and properly protected. The strength of that separation depends on the provider, account credentials, access controls, retention settings, and whether a compromised production server can delete the stored backups.
Do I need to back up a static website?
Yes, although the requirement is simpler. Back up the site files, deployment configuration, web-server configuration, DNS notes, and any assets not preserved elsewhere. If the site is deployed entirely from version control, recovery may be easier—but configuration and deployed assets still matter.
How do I know my backup works?
Restore it into a separate test environment and verify that the website, application, database, configuration, and core functions actually work. A completed backup job is not proof of recoverability.
Recovery Is the Point
A VPS backup plan is not about collecting copies of files. It is about restoring a working service when the original one is gone, broken, compromised, or no longer trustworthy.
The practical standard is straightforward:
Keep more than one copy, store at least one away from the VPS, protect access, retain useful history, and test the restore before the day you need it.
Backups belong beside security, not beneath it. After hardening your server in How to Secure a VPS, make recovery the next part of the job. If you are deciding how much operational responsibility you want in the first place, read Managed VPS vs Unmanaged VPS: What Are You Responsible For?.