VPS Snaps

Hetzner Cloud snapshots: create, restore and automate with hcloud

A Hetzner Cloud snapshot is a manual copy of a server's disk that stays in your account until you delete it, even after the server is gone. Create one in the Console under Snapshots or with hcloud server create-image --type snapshot, shut the server down first for a consistent copy, and restore with hcloud server rebuild or by creating a new server from the image. Snapshots are billed per GB per month on their compressed size; automatic backups cost 20% of the server's price.

8 min readUpdated Checked against official documentation

Snapshots vs backups on Hetzner Cloud

SnapshotsBackups
Created byYou, manually or from a scriptHetzner, automatically every day
How manyUp to 30 across all projects by defaultSeven slots per server; the oldest is deleted when they are full
Kept untilYou delete itPushed out by newer backups
Server deletedSnapshot survivesBackups are deleted with the server
Delete protectionCan be enabledNot available
Attached VolumesNot includedNot included
BillingPer GB per month of the compressed imageFlat 20% of the server's price

Turn backups on in the Console: open Backups in the upper menu bar, click Enable Backups, choose the server and click Enable & Buy now. Or from the CLI:

Terminal
hcloud server enable-backup web-01

A backup you want to keep can be converted into a snapshot, which then survives server deletion and can be protected:

Terminal
hcloud image update --type snapshot 23456789

Create a snapshot in the Hetzner Console

  1. If the server runs a database or another write-heavy service, shut it down first (see below).
  2. Open your project in the Hetzner Console.
  3. Click Snapshots in the upper menu bar.
  4. Click Take Snapshot.
  5. Choose the server, add a description, and click Create & Buy now.

The description is worth the five seconds. Snapshot lists fill up with near-identical entries, and the description is what tells you which one was taken before the risky upgrade.

Create a snapshot with hcloud

hcloud is Hetzner's official CLI. Create a context first. It stores an API token, and a Hetzner token belongs to one project.

Terminal
hcloud context create my-project
Terminal
hcloud server create-image --type snapshot --description "before php upgrade" --label server=web-01 --label reason=manual web-01
  • --type snapshot makes an independent image that survives server deletion. --type backup writes into one of the server's backup slots instead, and only works when backups are enabled.
  • --description is free text shown in lists.
  • --label key=value adds a label. Repeat the flag for more. Scripts use labels to find their own snapshots later.
  • The last argument is the server's name or ID.

hcloud waits for the action to finish and prints the new image ID, so the next line of a script can rely on the snapshot existing. To change the description or add a label afterwards:

Terminal
hcloud image update --description "known good after migration" 12345678
Terminal
hcloud image add-label 12345678 keep=forever

Protect a snapshot you can't afford to lose. A protected image can't be deleted until you run hcloud image disable-protection 12345678 delete.

Terminal
hcloud image enable-protection 12345678 delete

Shut down first for a consistent snapshot

Hetzner recommends powering off the server before creating a backup or snapshot, and says it can't promise data consistency from a running system. Its API reference goes further: if the disk content isn't consistent, the image may not be readable.

Terminal
hcloud server shutdown --wait web-01
  • shutdown sends an ACPI shutdown request, so the operating system stops its services cleanly. The OS must support ACPI and react to it.
  • --wait waits until the server is off, for up to 30 seconds by default. Raise that with --wait-timeout 2m.
Terminal
hcloud server create-image --type snapshot --description "nightly" web-01
Terminal
hcloud server poweron web-01

If you can't take downtime, at least stop the database or dump it to a file before the snapshot, so a clean copy is inside the image.

List and delete snapshots

Terminal
hcloud image list --type snapshot --output columns=id,description,created,image_size,labels
  • --type snapshot hides system images and backups.
  • image_size is the compressed size in GB that Hetzner bills for. disk_size is the size of the disk the image came from.
  • Add --selector server=web-01 to filter by label, and --sort created:desc to list the newest first.
Terminal
hcloud image delete 12345678

hcloud image delete takes one or more image IDs or names. Deletion can't be undone.

Restore: rebuild a server or create a new one

Rebuilding overwrites the server's disk with the image and destroys everything on it. Hetzner powers the server off automatically before the rebuild. The server itself stays; only its disk changes.

Terminal
hcloud server rebuild --image 12345678 web-01
  • --image takes the snapshot's ID or name.
  • The last argument is the server to overwrite.

A new server leaves the original alone. That makes it the safer choice for testing a snapshot or copying out a few files:

Terminal
hcloud server create --name web-01-restore --type cpx22 --image 12345678 --location fsn1 --ssh-key my-key
  • --type is the server type. List them with hcloud server-type list. The type's architecture (x86 or Arm64) must match the snapshot's.
  • --location can be any location. A server built from a snapshot doesn't have to be in the original server's location.
  • --ssh-key injects a key already uploaded to the project. Repeat it for more keys.

In the Console you can rebuild an existing server with the snapshot as its source image, create a new server and pick the snapshot as its image, or open the snapshot's menu and choose Create new Server.

Automate snapshots with a retention count

Daily backups cover the simple case: seven rolling copies, no script. For a different schedule, a longer history or images that survive server deletion, rotate snapshots yourself with labels.

/usr/local/bin/hcloud-snapshot.sh
#!/usr/bin/env bash
set -euo pipefail

SERVER="web-01"
KEEP=7

hcloud server create-image --type snapshot \
  --description "$SERVER auto $(date -u +%Y-%m-%dT%H:%MZ)" \
  --label server="$SERVER" --label schedule=nightly \
  "$SERVER"

hcloud image list --type snapshot \
  --selector "server=$SERVER,schedule=nightly" \
  --sort created:desc \
  --output noheader --output columns=id \
  | tail -n +$((KEEP + 1)) \
  | xargs -r hcloud image delete
  • The labels mark the snapshots this script owns, so it never deletes one you took by hand. A comma in --selector means both labels must match.
  • --sort created:desc puts the newest first. tail -n +8 skips the seven newest and passes the rest to hcloud image delete.
  • --output noheader --output columns=id prints bare IDs.
/etc/cron.d/hcloud-snapshot
15 2 * * * root /usr/local/bin/hcloud-snapshot.sh >> /var/log/hcloud-snapshot.log 2>&1

Run it from a machine other than the server it snapshots, and give cron a token: a context created with hcloud context create for the user cron runs as, or the HCLOUD_TOKEN environment variable. Add hcloud server shutdown --wait and hcloud server poweron around the snapshot if the server can take the downtime.

The default limit is 30 snapshots across all projects. Seven nightly snapshots for five servers is 35. Count every server before you set KEEP.

What it costs

As of October 2026, Hetzner's documentation describes the billing model but leaves the rate to its pricing page and the Console, so check the current per-GB price there.

  • Snapshots: billed per GB per month on the compressed size of the snapshot, prorated when it exists for part of a month. The image_size column shows the billed size.
  • Backups: a flat monthly price of 20% of the server's price, for seven slots.

You pay for the compressed image, not the size of the server's disk. Each snapshot is billed on its own image_size, so the number you keep is what drives the bill.

Limits

  • 30 snapshots by default, counted across all projects.
  • Seven backup slots per server. Backups are deleted when the server is deleted.
  • Neither backups nor snapshots include attached Volumes.
  • A server created from a backup or snapshot must have the same architecture (x86 or Arm64) as the image.
  • Snapshots can be protected against deletion; backups can't.
  • Snapshots can be moved to another project. Backups can't; convert them to snapshots first.
  • Backups are stored in the server's location. Snapshots are stored in a different location within the same network zone, except where a zone has a single location, such as Ashburn.

What a snapshot does not protect against

Moving a snapshot to another project, or relying on it being stored in another location, still leaves it in the same Hetzner account.

  • Account problems. A suspended or closed account takes every project's servers, backups and snapshots with it.
  • A leaked API token. A token with write access to the project can delete servers and unprotected snapshots alike.
  • Deleting the server. Its backups go with it. Only snapshots stay.
  • Volumes and bad data. Volumes aren't included at all, and a snapshot taken after data went bad preserves the bad data.

Keep at least one copy outside Hetzner: database dumps and file archives in storage at another provider, or on a machine you control. That is the off-site leg of the 3-2-1 rule. Restore from it now and then to prove it works.

A snapshot is the whole disk, but not a deleted account or a change you notice too late. For what else to keep, see what to back up on a Linux server, and for how often, RPO and RTO explained.

Frequently asked questions

Are Hetzner snapshots deleted when I delete the server?
No. Snapshots are independent of the server and stay until you delete them. Backups are deleted with the server, so convert any backup you need into a snapshot first.
Do Hetzner snapshots include Volumes?
No. Backups and snapshots cover the server's own disk only. Back up Volume data separately, for example with file-level backups.
Can I create a server from a snapshot in another location?
Yes. A backup or snapshot can create a server in any location, as long as the server type's architecture matches the image.
How many snapshots can I keep on Hetzner Cloud?
30 by default, counted across all projects in the account.
Should I shut the server down before a snapshot?
Hetzner recommends it for a consistent disk. If you can't, stop or dump the database before the snapshot.

How this was checked

Commands, limits and prices were checked against these official pages, on October 3, 2026: