VPS Backup Strategy: How to Back Up a VPS and Actually Restore It

Cover graphic: VPS Backup Strategy: How to Back Up a VPS and Actually Restore It

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:

  1. Regular backups of databases, application files, uploads, and configuration.
  2. At least one backup copy stored away from the production VPS.
  3. Encryption for sensitive backup data.
  4. Retention of multiple backup versions rather than one constantly overwritten copy.
  5. A snapshot before major changes or risky deployments.
  6. A documented restore process.
  7. 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 upWhy it mattersTypical examples
DatabasesOften hold the live content, accounts, orders, settings, and application dataMySQL, MariaDB, PostgreSQL, Redis data where persistence is required
Application filesNeeded to run the website, API, or serviceWordPress files, Laravel app, Node.js project, Python app
Uploaded mediaMay not exist in source control or deployment packagesImages, PDFs, customer uploads, product assets
Configuration filesRebuild the working environment correctlyNginx, Apache, PHP, systemd, Docker Compose, firewall configuration
Environment settingsApplications often depend on specific variables and service endpointsEnvironment files, API endpoints, queue settings, service URLs
SSL and certificate configurationHelps restore secure web service settings quicklyNginx TLS configuration, certificate-renewal setup
Scheduled jobsImportant automated work may not be obvious until it stops runningCron jobs, backup jobs, queue workers, cleanup scripts
Deployment documentationMakes recovery repeatable rather than dependent on memorySetup 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.

ToolWhat it is good forWhat it does not replace
VPS snapshotFast rollback before an update, migration, deployment, or configuration changeIndependent, long-term, off-site backups
File backupRecovering application files, uploads, configuration, or selected directoriesConsistent database protection on its own
Database backupRestoring site content, user records, orders, application data, and settingsApplication files, server configuration, media uploads
Full server imageRebuilding a whole machine or cloning a known-good systemMultiple versions, independent storage, and routine restore testing
Off-site backupRecovering after VPS failure, account problems, ransomware, or accidental deletionA 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:

CopyLocationPurpose
Production dataYour VPSThe live website, application, or service
Automated backupSeparate backup storage or provider backup serviceRoutine recovery from file loss, broken updates, or database problems
Independent off-site copyA separate cloud-storage account, backup provider, or controlled local archiveRecovery 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 workloadSensible starting point
Static brochure websiteWeekly files and monthly full snapshot, plus a snapshot before changes
Small blog or portfolio siteDaily database backup, weekly files, snapshot before updates
Active WordPress or CMS siteDaily database and files, multiple retained versions, pre-update snapshot
Ecommerce, membership, booking, or client portalDatabase backups every few hours or more often, daily files, tested recovery plan
SaaS application or active APIFrequent database backups, application and configuration backups with every deployment, strong retention and monitoring
Development or staging VPSSnapshot 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:

ComponentWhy you need it
Database exportPosts, pages, users, settings, comments, orders, and plugin data
wp-content/uploadsImages, documents, and media not stored in Git
Themes and pluginsNeeded if the deployed versions are not otherwise recorded
wp-config.php or equivalent configurationDatabase connection settings and application-specific configuration
Nginx or Apache configurationVirtual-host rules, redirects, TLS setup, and performance settings
Certificate renewal setupHelps restore HTTPS operations cleanly
Deployment and restore notesPrevents 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 destinationStrengthsWatch for
Provider backup serviceConvenient, often integrated with restore toolsCheck retention, restore options, pricing, account separation, and whether it is genuinely independent enough for your needs
Object storageScalable, durable, suitable for encrypted automated backupsConfigure access carefully and monitor storage costs
Separate backup providerClear separation from the production VPS providerConfirm restore speed, retention, encryption, and account controls
Another serverFlexible and directDo not create a second poorly secured single point of failure
Local encrypted archiveUseful as an additional independent copyNot 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 measureWhy it matters
Encrypt backups in transitPrevents interception while data moves from the VPS to storage
Encrypt backups at restProtects backup content if storage is exposed or accessed improperly
Use separate backup credentialsLimits the chance that a compromised VPS account can erase all copies
Enable MFA on backup and provider accountsMakes account takeover harder
Restrict delete permissionsHelps protect retained backups from accidental or malicious deletion
Store encryption keys securelyA perfectly encrypted backup is useless if nobody can recover the key
Review who can access backupsFormer 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 typeFrequencyRetention
Database backupDaily14 to 30 daily copies
Application files and uploadsDaily or weekly, depending on change rate7 to 12 copies
Full VPS or server imageWeekly4 to 8 weekly copies
Monthly archiveMonthly3 to 12 monthly copies
Pre-change snapshotBefore major updates, migrations, or deploymentsKeep 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:

  1. Choose a backup from a recent but not necessarily newest date.
  2. Create an isolated test environment.
  3. Restore application files, uploads, configuration, and the database.
  4. Confirm the application starts and connects to its dependencies.
  5. Check representative content, user access, media files, and core functions.
  6. Record how long the process takes.
  7. Note missing components, unclear steps, access problems, and configuration gaps.
  8. 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:

TaskScheduleNotes
Database backupDaily; more often for active sitesStore off-site and retain multiple versions
Application files and uploadsDailyInclude media directories and user-generated content
Configuration backupAfter every meaningful server or app changeInclude Nginx, Apache, systemd, Docker, cron, and deployment settings
VPS snapshotBefore updates, migrations, and risky deploymentsUse for short-term rollback, not as the only backup
Full server backup or imageWeeklyKeep multiple retained copies
Backup verificationDaily or weeklyAlert if jobs fail, files are unusually small, or storage is unreachable
Restore testQuarterly at minimum; more often for critical systemsRestore 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

CheckPriorityWhat to verify
Database backups run automatically🟩 EssentialSchedule backups at a frequency that matches how quickly the data changes
Application files are backed up🟩 EssentialInclude application directories, uploads, and user-generated files
Configuration is backed up🟩 EssentialSave web-server, application, service, deployment, and scheduled-task configuration
At least one copy is off-site🟩 EssentialStore a backup outside the production VPS and preferably outside its immediate environment
Multiple backup versions are retained🟩 EssentialKeep historical recovery points instead of one constantly overwritten copy
Backup failures generate alerts🟩 EssentialNotify someone when jobs fail, storage fills, or backups are unexpectedly small
Backups are encrypted🟧 HardeningProtect sensitive data in transit and at rest
Backup credentials are separate🟧 HardeningAvoid using unrestricted production credentials to manage backup storage
A snapshot is taken before major changes🟧 HardeningCreate a fast rollback point before updates, migrations, or deployments
Restore instructions are documented🟩 EssentialRecord the files, commands, credentials, dependencies, and recovery order
Restores have been tested🟩 EssentialRestore into a safe environment and verify the application actually works
Restore time is known🟪 OperationsMeasure how long recovery takes so expectations match reality
Sensitive secrets are protected🟧 HardeningSecure keys, passwords, tokens, and environment files in the backup process
Backup retention is reviewed🟪 OperationsConfirm that daily, weekly, and monthly copies match business needs

Common VPS Backup Mistakes

MistakeWhy it failsBetter approach
Keeping the only backup on the VPSThe same failure can destroy production and the backupKeep at least one encrypted off-site copy
Assuming a snapshot is enoughSnapshots may share provider, account, and infrastructure riskUse snapshots for rollback plus independent backups for recovery
Backing up files but not databasesDynamic sites and applications often keep their real state in the databaseRun database backups separately and frequently
Backing up databases but not uploadsRestored sites can lose images, documents, media, and customer filesInclude uploads and other generated content
Overwriting the only backup dailyCorruption or ransomware can silently replace good copiesKeep multiple retained versions
Never testing a restoreA backup may be incomplete, inaccessible, or unusableRestore to a safe environment on a regular schedule
Using the same credentials everywhereOne compromised account can threaten production and backupsSeparate access, enable MFA, and limit delete permissions
Forgetting configuration filesA restored application may fail without web-server, service, or environment settingsBack up configuration and document the rebuild process
Ignoring backup alertsA failed job can go unnoticed until recovery is neededMonitor backup success, storage availability, and file size
Treating provider backups as guaranteedRetention, scope, restore timing, and responsibility varyRead 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?.