How to Protect Your Backups From Ransomware

A backup is only useful if ransomware cannot reach it.

A backup is the one thing that turns a ransomware attack from a disaster into an inconvenience. In a ransomware attack you will not be able to access your device or the data stored on it, because the files are encrypted1. If you hold a clean copy made before the infection, you can wipe the device and start again. If you do not, you are left hoping the attacker keeps their word, and the National Cyber Security Centre is clear that there is no guarantee that you will get access to your data or computer1.

The catch is that a backup only helps if ransomware cannot reach it. Malware can spread to attached drives, so a backup left plugged in is not really a backup2. The work is to keep one copy out of reach, check it is clean before you restore from it, and clean the infected device first so you do not simply put the malware back.

This page sets out how to do each of those things, in the order you would need them: what to check before restoring, how to keep a copy ransomware cannot touch, how to recover the device itself, and where to get official help.

Check a backup is free from malware before you restore from it

The single most important rule is easy to skip when you are in a hurry. Before you restore from a backup, confirm that it is free from any malware1. A backup made while a device was already infected carries the infection with it, and restoring it puts the malware straight back on a clean machine. If you cannot be sure the backup was created before the malware arrived, do not restore it: factory reset and restore no backups, and do not back up your data before performing a factory reset, as the backup will also contain the malware2.

The NCSC's guidance on infected devices makes the same point from the other direction: restore your backed-up data from the "last known" good backup3. That phrase matters. You are not looking for the newest copy, you are looking for the newest copy you are confident predates the infection. If you cannot establish when the malware arrived, you cannot be sure any recent backup is clean.

There are practical checks you can make:

  • Check the contents. Once you have made your backup, check that it contains all your important data, such as recently taken photos or recently created files or folders2. A backup that opens but is missing half your files is not a backup.
  • Scan before you trust it. If you think a device has been compromised, open your antivirus software if you have it and run a full scan, allowing it to clean up any problems it finds5. When you first install antivirus, run a full scan to make sure your computer is free of all known malware6.
  • Know when to walk away. If you cannot be sure the backup was created before the malware was installed, the NCSC advises performing a factory reset and not restoring any backups at all4. Losing files is painful; reinstalling an infection is worse.

Keeping a backup copy ransomware cannot reach

Ransomware does not sit still. The NCSC warns that ransomware and other types of malware can move to attached media, which means your backup would also be infected, and advises disconnecting removable media when not in use2. An external hard drive that stays plugged in is, in practice, part of the infected machine.

The NCSC's own summary of the risk is blunt: it is important to always have a recent offline backup of the most important files and data7. Offline is the operative word. The copy has to be somewhere the malware running on your device cannot write to.

There are two broad ways to do this, and most households end up using both.

ApproachWhat it does for youWhat to watch
External drive, disconnected after each backupPhysically out of reach when unplugged2You must remember to unplug it, and to reconnect it regularly
Cloud backup, set to run automaticallyKeeps an up-to-date copy without you remembering2Only as safe as the account login2
A laptop with an external drive and a cloud backup icon, showing two separate copies of the same files
A clean copy made before an infection is what lets you recover; a copy made afterwards carries the malware with it.

Whichever you choose, the account behind a cloud backup needs protecting. The NCSC advises protecting cloud accounts, and access to your backups, by using strong passwords and turning on two-factor authentication2. Turning on two-step verification is described by the NCSC as the first and most important step to help protect you if your password gets phished or otherwise compromised8. It usually works by sending a PIN or code, often by SMS or email, to prove it is really you9. If you use a password manager, switch on two-step verification on that account too, so a criminal who knows the primary password still cannot access it8.

If you are weighing the two, our comparison of cloud backup and an external hard drive sets out which suits which household, and how often to back up covers the schedule question.

Recovering an infected device before you restore

Restoring files onto a machine that is still infected undoes the work. The NCSC is explicit that trying to rescue data while the device is still infected risks carrying the infection through after wiping and reinstalling10. The order is: deal with the device, then restore.

For a PC or laptop, the NCSC's sequence is to update your device and programs, open your antivirus product and run a scan, then follow its advice10. Updates matter in their own right: apply updates to your apps and device software as soon as they are available, because updates include protection from viruses9. The WannaCry attack on the NHS in 2017 is the cautionary example, with many organisations having failed to apply recommended software updates in a timely manner, leaving systems vulnerable11.

For a phone or tablet, the reset is usually the cleaner route. The NCSC advises that when you are given the option to restore backups, you should only do so if you are confident that the backup was created before you installed the malware; if you cannot be sure, perform a factory reset and not restore any backups4. It adds a warning that catches people out: do not back up your data before performing a factory reset, as the backup will also contain the malware4.

The order to recover in

Once the device is clean, the NCSC advises keeping it and its programs up to date, backing up your data, checking the device is encrypted, and, for PCs and laptops, making sure you have antivirus that is updating regularly10. Our checklist for after fixing an infected device walks through the same steps, and how to restore files safely after ransomware or a virus goes deeper on the restore itself.

Where to get official help after a ransomware attack

If your device is locked and files are encrypted, you are dealing with ransomware in the strict sense: malicious software that blocks access to data or a computer system, usually by encrypting it, until the victim pays a ransom fee12. The attacker will usually ask you to contact them via an anonymous email address or follow instructions on an anonymous web page, to make a payment in a cryptocurrency1. You are not obliged to engage, and the NCSC's position is that paying brings no guarantee1.

The NCSC publishes guidance specifically for individuals and families caught up in an attack, and it is worth reading the recovery guidance in advance so you know what to do if you experience an incident13. Its advice for hacked accounts covers the same ground: update your apps and devices as soon as updates are available, and turn on automatic updates in your device's settings14.

For reporting, the NCSC advises forwarding suspicious emails to its reporting service, forwarding texts to 7726 and reporting scam websites5. Reporting has a practical payoff: it can reduce the amount of scam communications you receive, make you a harder target for scammers and protect others from cyber crime online15. If the attack arrived by text, our guide to reporting a scam text message covers the 7726 route; for email, see how to report a phishing email.

The wider picture is not reassuring, and it is worth knowing why the official advice is so insistent on backups. Parliament's Joint Committee on the National Security Strategy reports that ransomware can cause severe disruption to the delivery of core Government services, including healthcare and child protection, with many organisations taking months to recover and long recovery times of up to a year for some16. The government has consulted on counter ransomware measures including a targeted ban on ransomware payments for regulated critical national infrastructure and the public sector, a ransomware payment prevention regime and a mandatory incident reporting regime17. None of that changes what a household should do, but it explains why a clean, offline copy is treated as the baseline rather than the belt and braces.

For the broader picture of what ransomware is and how it affects households, start with Ransomware: What It Is and How It Affects Households, and for the general routine of backing up at home, see Backing Up Files and Photos at Home.

Sources (17)
  1. Responding to a ransomware attack, National Cyber Security Centre, 2026
  2. Backing up your data, National Cyber Security Centre, 2026
  3. Recovering an infected device, National Cyber Security Centre, 2026
  4. Scam 'missed parcel' SMS messages: advice on avoiding malware, National Cyber Security Centre, 2021
  5. Phishing: dealing with a suspicious message, National Cyber Security Centre, 2026
  6. Protecting devices from viruses and malware, National Cyber Security Centre, 2024
  7. Cyber crime, National Cyber Security Centre, 2022
  8. Password managers, National Cyber Security Centre, 2026
  9. Recovering hacked accounts, National Cyber Security Centre, 2026
  10. Hacked device: action to take, National Cyber Security Centre, 2021
  11. Community Risk Register 2025, North Yorkshire Council, 2025
  12. Ransomware, National Cyber Security Centre, 2026
  13. Recovering a hacked account or service, National Cyber Security Centre, 2024
  14. Hacked accounts, National Cyber Security Centre, 2026
  15. Phishing and scams, National Cyber Security Centre, 2026
  16. Ransomware and the National Security Strategy, UK Parliament, 2023
  17. UK Government Resilience Action Plan, GOV.UK, 2025

Common questions

Should I pay the ransom to get my files back?

The National Cyber Security Centre says there is no guarantee that you will get access to your data or computer if you pay [1]. Parliament's Joint Committee on the National Security Strategy goes further, noting that even if the ransom is paid the victim may not regain access to all their files, and that mass data loss can be irreversible [2]. A recent offline backup is the reliable route back, which is why it is worth setting one up before anything happens.

Are cloud backups safe from ransomware?

They can be, if you set them up well. The NCSC notes that cloud-based backups can be created automatically, so you are more likely to hold an up-to-date copy of your data [3]. But a cloud account is only as safe as its login: protect cloud accounts, and access to your backups, with strong passwords and two-factor authentication [3]. If a criminal gets into the account, the backup is reachable.

Does antivirus protect my backups?

Antivirus helps stop malware getting a foothold, and the NCSC advises running a full scan and letting the software clean up any problems it finds if you think a device has been compromised [4]. It is not a substitute for a backup. Keep antivirus and software updated, and treat the backup as your recovery route if the worst happens [5].

Should I turn on 2-step verification for my backup account?

Yes. The NCSC describes turning on two-step verification as the first and most important step to protect you if your password is phished or otherwise compromised [6]. It usually works by sending a PIN or code, often by SMS or email, to prove it is really you [7]. Set it up on your email and cloud storage accounts, because those are the keys to your backup.

How often should I back up?

Often enough that the gap between copies is a gap you can live with. The NCSC advises always keeping a recent offline backup of your most important files and data [8]. Automatic cloud backups help because they keep a copy up to date without you remembering [3]. Whatever the schedule, check the backup actually contains your recent photos and files [3].

How do I report a ransomware attack?

The NCSC advises forwarding suspicious emails to its reporting service, forwarding scam texts to 7726 and reporting scam websites [4]. Reporting helps reduce the scam communications you receive, makes you a harder target and protects others from cyber crime online [9]. The government has also consulted on a mandatory incident reporting regime as part of its counter ransomware measures [10].