Skip to content
Back to Cloud Services

Hetzner Cloud

European VPS with exceptional price/performance (€4/mo for 2GB RAM, 20TB transfer), dedicated ARM and x86 servers, and a cloud API.

VPS & Self-HostedBeginner

Why

Hetzner offers the best price/performance in the VPS market — a CX22 (2 vCPU, 4GB RAM) is ~€4/mo with 20TB transfer. Data centers in Germany, Finland, and the US.

Ideal for self-hosted services, CI runners, and cost-sensitive workloads where EU data residency matters.

When

Use Hetzner for self-hosted apps, CI/CD runners, game servers, and EU-residency workloads. Avoid for workloads needing managed databases/K8s (Hetzner's managed offerings are limited) or global edge POPs — pair with a CDN for latency.

How

1. Create a Hetzner Cloud project and generate an API token. 2. hcloud context create to configure the CLI. 3. hcloud server create with a type (cx22), image (ubuntu-22.04), and location (nbg1). 4. Add a firewall via hcloud firewall create. 5. Attach a volume or use the local disk for data. 6. Use a Cloud Firewall (free) instead of iptables for simplicity. ```bash hcloud server create --name web --type cx22 --image ubuntu-22.04 --location nbg1 --ssh-key \${KEY} hcloud firewall create --name web-fw --rules-file rules.json hcloud server add-firewall web --firewall web-fw ```

Example

Terraform provisioning a Hetzner server with a cloud firewall: ```hcl provider "hcloud" { token = var.hcloud_token } resource "hcloud_firewall" "web" { name = "web-fw" rule { direction = "in"; protocol = "tcp"; port = "22"; source_ips = ["0.0.0.0/0"] } rule { direction = "in"; protocol = "tcp"; port = "80"; source_ips = ["0.0.0.0/0"] } } resource "hcloud_server" "web" { name = "web"; image = "ubuntu-22.04"; server_type = "cx22"; location = "nbg1"; ssh_keys = [hcloud_ssh_key.default.id]; firewall_ids = [hcloud_firewall.web.id] } ```

Common Problems

  • ⚠Server creation fails with 'resource limit exceeded' — new accounts have a low server quota; request a limit increase via support.
  • ⚠Cannot reach server from outside — the default cloud firewall blocks all inbound; add an inbound rule for the port you need.
  • ⚠US location has higher price — Hetzner's US locations (ash, hil) cost ~10% more than EU; choose nbg1/fsn1 for best price.

Best Practices

  • ✓Use the Cloud Firewall (free, managed) instead of host-level iptables — it filters before traffic reaches the server, reducing attack surface.
  • ✓Enable automated backups (20% of server price) or use hcloud volume with daily snapshots for data durability.
  • ✓Place servers in nbg1/fsn1 (Germany) for best price; use hel1 (Finland) or US locations only if latency requires it.

FAQ

What is Hetzner Cloud and what problem does it solve?

European VPS with exceptional price/performance (€4/mo for 2GB RAM, 20TB transfer), dedicated ARM and x86 servers, and a cloud API. It lets developers deploy, store, and scale without self-managing infrastructure — a core reference for cloud service selection.

How do I get started with Hetzner Cloud in 5 minutes?

Two steps to run it: (1) Create a Hetzner Cloud project and generate an API token.; (2) hcloud context create to configure the CLI.. Validate on the free tier first, then wire into production.

What is the #1 pitfall with Hetzner Cloud?

The most frequent issue is: Server creation fails with 'resource limit exceeded' — new accounts have a low server quota; request a limit increase via support.. Run a pre-launch checklist item by item, and add policy/config scanning in CI.

What are the best practices for Hetzner Cloud?

Best practices for Hetzner Cloud include: Use the Cloud Firewall (free, managed) instead of host-level iptables — it filters before traffic reaches the server, reducing attack surface.; Enable automated backups (20% of server price) or use hcloud volume with daily snapshots for data durability.; Place servers in nbg1/fsn1 (Germany) for best price; use hel1 (Finland) or US locations only if latency requires it.. The first one — "Use the Cloud Firewall (free, managed) instead of host-level iptables — it filters before traffic reaches the server, reducing attack surface." — should be a team default baked into your IaC templates.

How do I control cost and avoid bill surprises with Hetzner Cloud?

Three ways to prevent overspend: (1) tag every resource with env/team and enable billing alarms; (2) set budget thresholds to trigger Slack/email alerts; (3) review idle resources in Cost Explorer regularly and clean them up. Most Hetzner Cloud options offer a free tier — validate within free quota before scaling.