---
title: "Protect cloud server data: encryption, backups and retention · CloudSat"
description: "A data protection plan for cloud servers: classify what you hold, encrypt in transit and at rest, keep tested off-site backups, and enforce retention."
url: https://cloudsat.io/learn/protect-data-on-cloud-servers
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

[Security](https://cloudsat.io/learn/topic/server-security)

# Protect cloud server data: encryption, backups and retention

A data protection plan for cloud servers: classify what you hold, encrypt in transit and at rest, keep tested off-site backups, and enforce retention.

CloudSat team November 18, 2026 6 min read

On a rented server, the provider protects the building, the hardware and the network edge. Everything that touches your data is yours: who can read it, whether it is encrypted, whether a copy survives a deleted volume or a ransomware attack, and how long you keep it. Four controls cover most of the risk: know what you hold, encrypt it, back it up somewhere else, and delete what you no longer need. This guide turns each into concrete steps for a team running its own cloud servers, then maps them to the compliance questions customers and regulators ask.

## Know what you hold

You cannot protect data you have not found. Start with a short inventory: every database, bucket, file share, log store, backup set and laptop export that holds business data, with an owner and a retention period for each. Then sort it into a few classes:

| Class | Examples | Minimum controls |
| --- | --- | --- |
| Public | Marketing site, published docs | Integrity: backups, change control |
| Internal | Wikis, tickets, source code | Access control, encrypted backups |
| Confidential | Customer records, contracts, credentials | Encryption in transit and at rest, audited access |
| Regulated | Personal data under GDPR, health records, payment card data | All of the above, plus documented retention and breach procedures |

Logs deserve a line of their own. They quietly collect IP addresses, email addresses and sometimes tokens, and they are often kept longer and protected less than the database they describe.

## Encrypt data in transit

Every connection that carries data should use TLS, including the ones between your own servers. Public sites get free certificates from Let's Encrypt through certbot, Caddy or your reverse proxy. Let's Encrypt ended its expiry reminder emails in June 2025, so monitor certificate dates yourself:

```bash
echo | openssl s_client -connect app.example.com:443 -servername app.example.com 2>/dev/null | openssl x509 -noout -enddate
```

Inside your infrastructure, require verified TLS on database connections (`sslmode=verify-full` for PostgreSQL clients, `--ssl-mode=VERIFY_IDENTITY` for MySQL), or carry private traffic through an encrypted tunnel such as WireGuard. Disable TLS 1.0 and 1.1 wherever they still linger.

## Encrypt data at rest, knowing what it covers

Encryption at rest protects data that leaves your control while switched off: a copied disk image, a leaked snapshot, a backup in someone else's storage. It does not protect data on a running system, where the volume is open and readable by anyone with root. Decide which threat you are addressing, then pick the layer:

- **Encrypted volumes.** LUKS on Linux encrypts a disk, a partition or a container file. The hard part is the key: someone has to enter a passphrase at boot through the console, or the server fetches it from a key server, for example with Clevis and Tang. The commands below create a container file; `luksFormat` erases whatever is at the target, so check the path twice.

```bash
sudo fallocate -l 20G /srv/secure.img
sudo cryptsetup luksFormat /srv/secure.img
sudo cryptsetup open /srv/secure.img securedata
sudo mkfs.ext4 /dev/mapper/securedata
sudo mount /dev/mapper/securedata /mnt/secure
```

- **Application-level encryption.** For the most sensitive fields, such as identity documents or API secrets, encrypt in the application before writing to the database, with keys held in a secret manager rather than on the same server. A stolen database dump is then useless on its own.
- **Encrypted backups.** restic, BorgBackup and Kopia all encrypt on the client before data leaves the server. Use them, and store the repository password somewhere that does not depend on the server being alive.

## Backups that survive a bad day

The 3-2-1 rule still holds: three copies of the data, on two different systems, with one copy off-site. Two refinements matter in 2026. Make at least one copy immutable or append-only, so an attacker with your server's credentials cannot delete history. And give backups their own credentials, ideally with the backup server pulling data rather than the production server pushing it.

Snapshots and backups do different jobs:

|  | Snapshot | Backup |
| --- | --- | --- |
| Captures | The whole server disk at one moment | Chosen files and database dumps |
| Restores | Everything, quickly | Exactly what you need, to any server |
| Lives | With the provider, next to the server | Off-site, versioned, encrypted |
| Best for | Rollback before upgrades and risky changes | Disasters, deletions, ransomware, audits |

CloudSat [snapshots](https://cloudsat.io/docs/take-a-snapshot) make good rollback points before an upgrade; pair them with an off-site copy as described in [Back up your data off the server](https://cloudsat.io/docs/backup-your-data).

A minimal nightly job for a server with PostgreSQL, using restic over SFTP:

```bash
sudo -u postgres pg_dump -Fc appdb > /var/backups/appdb.dump
restic -r sftp:backup@198.51.100.20:/srv/restic/web-01 backup /var/backups /etc /srv/app
restic -r sftp:backup@198.51.100.20:/srv/restic/web-01 forget --keep-daily 7 --keep-weekly 5 --keep-monthly 12 --prune
restic -r sftp:backup@198.51.100.20:/srv/restic/web-01 check
```

A backup is only real once it has been restored. Once a month, restore the latest snapshot to a scratch directory or a spare server with `restic restore latest --target /tmp/restore-test`, start the application against it, and write down how long it took.

## Keep less, for less time

Data you no longer hold cannot leak. Give each class a retention period and enforce it with automation, not good intentions: log rotation that really deletes, database jobs that purge closed accounts after a grace period, and backup retention that lets old copies expire. When someone asks you to delete their personal data, you can then answer honestly that backups containing it expire on a known schedule.

Keep secrets and full payment card numbers out of logs altogether, and mask email addresses and IPs where you do not need them in clear text.

## Compliance basics

Regulations ask for the same things in different words. Under the GDPR, the controls above map to a handful of articles:

- **Article 5:** collect only what you need (data minimization) and keep it no longer than necessary (storage limitation).
- **Article 28:** have a data processing agreement with every processor that handles personal data for you, including hosting and backup providers.
- **Article 30:** keep a record of processing activities; your data inventory is most of it.
- **Article 32:** apply security suited to the risk, naming encryption, resilience, the ability to restore access in a timely manner, and regular testing of these measures.

Where the data physically sits also matters for transfer rules, so choose server regions on purpose: CloudSat runs 13 regions, including Frankfurt (FRA1), Amsterdam (AMS1), London (LON1) and Bern (BRN1) in Europe. For payment card data, the simplest way to shrink your PCI DSS scope is to never touch it: let your payment processor's hosted fields collect it. Health data in the US brings HIPAA obligations. None of this is legal advice, but a written inventory, encryption, tested backups and enforced retention answer most of what an auditor or enterprise customer will ask.

## FAQ

### Does disk encryption protect my data from the hosting provider?

Only partly. It protects disks and images that leave the running server. While the server runs, the data is decrypted in memory, which the virtualization layer can in principle reach. For data that must stay unreadable to any operator, encrypt it in the application with keys held elsewhere.

### Are snapshots enough as backups?

No. A snapshot lives with the same provider as the server and usually covers only the latest states. Keep at least one encrypted, versioned copy somewhere else.

### How long should backups be kept?

Long enough to cover the time it takes to notice a problem. Intrusions and silent data corruption are often discovered weeks later, so keep daily copies for a week or two, weekly for a month or more, and monthly copies for a year unless retention rules require less.

**Run it on CloudSat.** Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. [See plans](https://cloudsat.io/plans) or [deploy a server](https://dash.cloudsat.io/console/deploy).

## Keep reading

[All guides in Security](https://cloudsat.io/learn/topic/server-security)

- [Incident response for cloud servers: the first 24 hours](https://cloudsat.io/learn/cloud-incident-response-plan): Security Incident response for cloud servers: the first 24 hours 6 min read
- [Cloud security architecture: a layered design for VPS apps](https://cloudsat.io/learn/layered-security-for-cloud-servers): Security Cloud security architecture: a layered design for VPS apps 6 min read
- [Cloud IAM for small teams: least privilege, MFA and tokens](https://cloudsat.io/learn/cloud-iam-least-privilege-checklist): Security Cloud IAM for small teams: least privilege, MFA and tokens 6 min read
- [Deploy AI-built apps without leaking company data](https://cloudsat.io/learn/deploy-ai-built-apps-without-leaking-data): Security Deploy AI-built apps without leaking company data 7 min read
