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.
Snapshots vs backups on Hetzner Cloud
| Snapshots | Backups | |
|---|---|---|
| Created by | You, manually or from a script | Hetzner, automatically every day |
| How many | Up to 30 across all projects by default | Seven slots per server; the oldest is deleted when they are full |
| Kept until | You delete it | Pushed out by newer backups |
| Server deleted | Snapshot survives | Backups are deleted with the server |
| Delete protection | Can be enabled | Not available |
| Attached Volumes | Not included | Not included |
| Billing | Per GB per month of the compressed image | Flat 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:
hcloud server enable-backup web-01A backup you want to keep can be converted into a snapshot, which then survives server deletion and can be protected:
hcloud image update --type snapshot 23456789Create a snapshot in the Hetzner Console
- If the server runs a database or another write-heavy service, shut it down first (see below).
- Open your project in the Hetzner Console.
- Click Snapshots in the upper menu bar.
- Click Take Snapshot.
- 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.
hcloud context create my-projecthcloud server create-image --type snapshot --description "before php upgrade" --label server=web-01 --label reason=manual web-01--type snapshotmakes an independent image that survives server deletion.--type backupwrites into one of the server's backup slots instead, and only works when backups are enabled.--descriptionis free text shown in lists.--label key=valueadds 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:
hcloud image update --description "known good after migration" 12345678hcloud image add-label 12345678 keep=foreverProtect a snapshot you can't afford to lose. A protected image can't be deleted until you run hcloud image disable-protection 12345678 delete.
hcloud image enable-protection 12345678 deleteShut 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.
hcloud server shutdown --wait web-01shutdownsends an ACPI shutdown request, so the operating system stops its services cleanly. The OS must support ACPI and react to it.--waitwaits until the server is off, for up to 30 seconds by default. Raise that with--wait-timeout 2m.
hcloud server create-image --type snapshot --description "nightly" web-01hcloud server poweron web-01If 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
hcloud image list --type snapshot --output columns=id,description,created,image_size,labels--type snapshothides system images and backups.image_sizeis the compressed size in GB that Hetzner bills for.disk_sizeis the size of the disk the image came from.- Add
--selector server=web-01to filter by label, and--sort created:descto list the newest first.
hcloud image delete 12345678hcloud 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.
hcloud server rebuild --image 12345678 web-01--imagetakes 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:
hcloud server create --name web-01-restore --type cpx22 --image 12345678 --location fsn1 --ssh-key my-key--typeis the server type. List them withhcloud server-type list. The type's architecture (x86 or Arm64) must match the snapshot's.--locationcan be any location. A server built from a snapshot doesn't have to be in the original server's location.--ssh-keyinjects 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/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
--selectormeans both labels must match. --sort created:descputs the newest first.tail -n +8skips the seven newest and passes the rest tohcloud image delete.--output noheader --output columns=idprints bare IDs.
15 2 * * * root /usr/local/bin/hcloud-snapshot.sh >> /var/log/hcloud-snapshot.log 2>&1Run 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_sizecolumn 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:
- Hetzner Docs: Backups and Snapshots overview
- Hetzner Docs: Backups and Snapshots FAQ
- Hetzner Docs: Taking Snapshots
- Hetzner Docs: Enabling Backups
- Hetzner Docs: Billing FAQ
- Hetzner Cloud API reference (create_image, rebuild, enable_backup, images, label selectors)
- hcloud CLI manual: server create-image, rebuild, create, shutdown, poweron, enable-backup
- hcloud CLI manual: image list, update, add-label, delete, enable-protection
- hcloud CLI guide: Using output options