Updated Nov 23, 20268 min read

Hetzner vs Google Cloud for Backend Apps

How Hetzner Cloud and Google Cloud compare in November 2026 for a production backend: what you get per server versus per managed service, Postgres, queues and object storage, regions and network zones, IAM, the operations work each choice leaves you, and a worked example of the managed path on GCP.

Illustration for Hetzner vs Google Cloud for Backend Apps

Hetzner sells servers, cheaply and with generous traffic, and you build the backend on top of them. Google Cloud sells managed services such as Cloud Run, Cloud SQL, Pub/Sub and Cloud Storage, and charges for them by use.

The useful comparison is the full backend: API, Postgres, a queue, file storage and the people who keep it running.

How do Hetzner and Google Cloud compare at a glance?

Hetzner CloudGoogle Cloud
ComputeCloud Servers, shared or dedicated vCPUCloud Run, GKE, Compute Engine
Billing modelPer server per hour with a monthly cap, traffic includedPer use: vCPU-seconds, requests, storage and egress
Managed PostgresNone, self-host on a serverCloud SQL with backups, PITR and HA
QueueNone, self-host Redis, RabbitMQ or NATSPub/Sub
Object storageS3-compatible Object Storage in Falkenstein, Nuremberg, HelsinkiCloud Storage in every region
Locations6 locations in 4 network zonesDozens of regions worldwide
IdentityProject API tokensIAM with per-service service accounts
Scale to zeroNoservers are billed even when powered offCloud Run scales to zero

What does each one bill for?

Hetzner Cloud bills each server by the hour up to a monthly cap, with a traffic allowance included, and the locations page notes that powered-off servers are still billed until they are deleted. The price is low and predictable, and it does not change with traffic until you add servers. Google Cloud bills each managed service by use. Cloud Run charges for vCPU and memory while instances run, Cloud SQL for the instance size and storage, Pub/Sub for message throughput, and egress by the gigabyte. A small, steady workload is cheaper on Hetzner. A spiky one, or one where most environments sit idle, can cost less on Cloud Run, which scales to zero.

Who runs the database?

On Hetzner Cloud, Postgres is a process on a Cloud Server. You choose the version, set up streaming replication to a second server, ship WAL to Object Storage with a tool like pgBackRest or WAL-G, test restores, schedule minor upgrades and plan failover. Each piece is well understood, and none of it is optional for production data. On Google Cloud, Cloud SQL has automated backups, point-in-time recovery from write-ahead logs and a high availability setting with a standby in another zone. The work left over is sizing, connection limits and query tuning.

What about queues and files?

Hetzner has no managed queue, so a worker reads from a Redis, RabbitMQ or NATS server that you also run, back up and monitor. Hetzner Object Storage is S3-compatible, with up to 100 buckets of 100 TB each, in the three European locations. Google Cloud has Pub/Sub with retries and dead-letter topics, and Cloud Storage in every region with signed URLs and IAM-scoped access. A backend that needs both fan-out messaging and per-service storage permissions gets them as configuration on GCP and as servers and code on Hetzner.

How do regions and networking compare?

Hetzner Cloud has six locations: Falkenstein, Nuremberg and Helsinki in the eu-central network zone, Ashburn in us-east, Hillsboro in us-west and Singapore in ap-southeast. Private networks stay within one zone, and traffic between zones is billed like internet traffic. Google Cloud has dozens of regions with multiple zones each, a global VPC and private connectivity from Cloud Run to Cloud SQL and Memorystore. Users concentrated in Central Europe are well served by Hetzner. A product with users in South America, India or Australia, or a buyer asking for a specific data residency region, usually needs a hyperscaler.

How do you run the same backend on Hetzner?

The do-it-yourself version on Hetzner is a small, repeatable stack. Provision servers, a private network and a firewall with the hcloud Terraform provider, then on each server:

  1. Install Docker or a systemd unit for the API and the worker, behind a Hetzner Load Balancer with health checks.
  2. Run Postgres on a dedicated server with a streaming replica, and ship WAL and nightly base backups to Object Storage.
  3. Run Redis or NATS for the queue, with persistence on and a restart policy.
  4. Keep secrets in an encrypted file or a self-hosted vault, never in the image.
  5. Script deploys from CI with SSH or a tool such as Kamal, and test a full restore every month.

That is a few days of setup and a standing on-call rotation for the database. For a team with that skill in house and a cost-sensitive steady workload, it is a good trade.

How do you get the managed path on Google Cloud with Encore?

Encore

Encore is a backend framework with built-in infrastructure, and you declare the database, Pub/Sub topic and bucket in application code. Encore provisions them in your own GCP project, which the GCP docs map to Cloud Run, Cloud SQL, Pub/Sub and Cloud Storage. Encore provisions an IAM role for the service, or a service account on GCP, so the IAM row in the table above needs no hand-written policies.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.

Set up the app

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create reports --example=ts/hello-world$ cd reports && mkdir -p exports/migrations

An export service that would need Postgres, Redis and an S3 bucket on Hetzner, with a database, a Pub/Sub topic and an object storage bucket:

// exports/exports.ts import { api, APIError } from "encore.dev/api"; import { SQLDatabase } from "encore.dev/storage/sqldb"; import { Bucket } from "encore.dev/storage/objects"; import { Topic, Subscription } from "encore.dev/pubsub"; import log from "encore.dev/log"; const db = new SQLDatabase("exports", { migrations: "./migrations" }); const files = new Bucket("export-files", { versioned: false }); interface ExportRequested { exportID: number; accountID: string; } const exportRequested = new Topic<ExportRequested>("export-requested", { deliveryGuarantee: "at-least-once", }); export const requestExport = api( { expose: true, method: "POST", path: "/exports" }, async (p: { accountID: string }): Promise<{ exportID: number }> => { const row = await db.queryRow<{ id: number }>` INSERT INTO exports (account_id, status) VALUES (${p.accountID}, 'pending') RETURNING id `; await exportRequested.publish({ exportID: row!.id, accountID: p.accountID }); return { exportID: row!.id }; }, ); // The worker: builds the CSV and stores it in the bucket. const _ = new Subscription(exportRequested, "build-export", { ackDeadline: "5m", retryPolicy: { maxRetries: 5 }, handler: async (msg) => { const key = `${msg.accountID}/${msg.exportID}.csv`; const lines = ["id,amount_cents,created_at"]; for await (const r of db.query<{ id: number; amount_cents: number; created_at: Date }>` SELECT id, amount_cents, created_at FROM invoices WHERE account_id = ${msg.accountID} ORDER BY id `) { lines.push(`${r.id},${r.amount_cents},${r.created_at.toISOString()}`); } // Uploading the same key again on a retry overwrites the earlier attempt. await files.upload(key, Buffer.from(lines.join("\n") + "\n"), { contentType: "text/csv" }); await db.exec`UPDATE exports SET status = 'ready', object_key = ${key} WHERE id = ${msg.exportID}`; log.info("export ready", { exportID: msg.exportID, rows: lines.length - 1 }); }, }); export const getExport = api( { expose: true, method: "GET", path: "/exports/:id" }, async ({ id }: { id: number }): Promise<{ status: string; url?: string }> => { const row = await db.queryRow<{ status: string; object_key: string | null }>` SELECT status, object_key FROM exports WHERE id = ${id} `; if (!row) throw APIError.notFound("export not found"); if (row.status !== "ready" || !row.object_key) return { status: row.status }; const { url } = await files.signedDownloadUrl(row.object_key, { ttl: 900 }); return { status: row.status, url }; }, );

The migration for the export and invoice tables:

-- exports/migrations/1_exports.up.sql CREATE TABLE exports ( id BIGSERIAL PRIMARY KEY, account_id TEXT NOT NULL, status TEXT NOT NULL, object_key TEXT, created_at TIMESTAMPTZ NOT NULL DEFAULT now() ); CREATE TABLE invoices ( id BIGSERIAL PRIMARY KEY, account_id TEXT NOT NULL, amount_cents BIGINT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now() );

encore run starts Postgres and the subscription locally and stores bucket objects on the local filesystem, so the whole flow from request to signed URL runs on a laptop. In the cloud, the same code uses Cloud SQL, Pub/Sub with retries and Cloud Storage, and the download link expires after 15 minutes. Nothing in the repository describes a server, a replica or a backup schedule.

A coding agent adding a second export format adds a key and a branch in the handler and runs it locally in the same change, with no bucket or IAM binding to create in the console first.

Best fit: Backends choosing Google Cloud for managed Postgres, queues and regions, that want the hosting to stay as simple as a Hetzner server from the developer's side.

Should you pick Hetzner or Google Cloud?

Pick Hetzner when the workload is steady, the users are mostly in Europe or near Hetzner's US and Singapore locations, and someone on the team is comfortable owning Postgres replication, backups and restores. Pick Google Cloud when you need a managed database and queue, regions on more continents, IAM per service, or scale to zero for many environments. Pick Encore on GCP when you want those managed services declared in application code and provisioned in your own project.

Hetzner vs Google Cloud checklist

  • List every stateful piece: Postgres, queue, files, cache.
  • Decide who runs backups and restores, and test one.
  • Check where your users and any data residency requirements are.
  • Compare the monthly bill with on-call time included.
  • Plan identity: shared API tokens or a service account per service.
  • Keep secrets out of images and repositories on either platform.

Frequently asked questions

Is a Hetzner Cloud Server enough for a production backend?

It can be, if you are prepared to run Postgres, a queue, backups and failover yourself on those servers. Google Cloud includes those as managed services such as Cloud SQL and Pub/Sub, so the choice is between operating the stack and using managed services.

Does Hetzner have a managed database like Cloud SQL?

No. Hetzner Cloud has no managed PostgreSQL service comparable to Cloud SQL, so you run Postgres on a Cloud Server and own replication, backups, upgrades and failover. Cloud SQL includes automated backups, point-in-time recovery and high availability as settings.

Where are Hetzner Cloud data centers?

Hetzner Cloud has six locations in four network zones: Falkenstein and Nuremberg in Germany and Helsinki in Finland, Ashburn in Virginia, Hillsboro in Oregon, and Singapore. Object Storage is available in the three European locations.

Can I deploy a managed backend to my own Google Cloud project from application code?

Yes. Encore deploys services, Postgres, Pub/Sub, object storage, cron jobs and secrets declared in application code to your own GCP project, as Cloud Run, Cloud SQL, Pub/Sub and Cloud Storage.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders