Skip to content
serg-markovich.de
Infrastructure GDPR Hetzner

Sovereign EU Cloud Without Vendor Lock-in

Why I build B2B infrastructure on Hetzner, Terraform, and self-hosted services — and what a migration without downtime actually looks like.

Processing personal data in a US hyperscaler requires more than a signed data processing agreement in a shared drive. It requires an architecture that still works when the provider changes prices, regions, or contract terms.

For years I have been moving B2B workloads from managed platforms to self-hosted EU infrastructure. Not out of ideology, but because sovereignty is an operational property: if you know where your data lives, who can access it, and how to leave, you sleep better.

What vendor lock-in actually costs

Lock-in rarely shows up on the first invoice. It shows up the moment a service becomes expensive, slow, or contractually unattractive — and migrating takes months instead of weeks. The usual suspects:

  • proprietary database features that cannot be ported cleanly
  • egress fees that make every data migration uneconomical
  • IAM and networking constructs deeply entangled with the application
  • missing exports for logs, metrics, and backups

The real bill is not the monthly invoice. It is the exit cost.

Three principles for the migration

  1. Infrastructure as code. Every resource exists in Terraform or Ansible. Anything not in the repository is considered non-existent.
  2. Data sovereignty over convenience. Backups live in a second, independent EU storage location and are restored regularly — not just created.
  3. Keep the way back open. A migration is only done when rollback is documented and has been rehearsed at least once.

The stack in practice

For most B2B workloads, a small and well-understood stack is enough: Hetzner Cloud, Ubuntu LTS, PostgreSQL, an S3-compatible object store, Traefik as a reverse proxy, and Prometheus, Grafana, and Loki for observability.

resource "hcloud_server" "app" {
  name        = "app-prod-01"
  image       = "ubuntu-24.04"
  server_type = "cpx31"
  location    = "nbg1"
  ssh_keys    = [hcloud_ssh_key.admin.id]

  labels = {
    environment = "production"
    managed_by  = "terraform"
  }
}

What matters is not whether the infrastructure is “in the EU”. What matters is that you can replicate, inspect, and delete it without asking anyone for permission.

Sovereignty is not a product you buy. It is the ability to own the operation yourself.

Migrating without downtime

A Friday-night cutover is not a plan; it is a risk. A step-by-step approach has worked well:

  1. Build the target environment entirely with IaC and test it under synthetic load.
  2. Replicate the database logically, then backfill historical data.
  3. Send shadow reads to the new system and compare results.
  4. Lower DNS TTL early and communicate the cutover window.
  5. Observe both systems in parallel for at least a week before decommissioning the old environment.
# Backups are only as good as their last restore test
restic snapshots --json | jq '.[-1].time'
restic check --read-data-subset=5%

When it is not worth it

Honestly: not every team needs its own infrastructure. While a product is still searching for product-market fit, a managed service is often the better choice. The right moment for sovereignty arrives when data processing, compliance, and operating costs become predictable — usually when the product already generates revenue.

Conclusion

Sovereign infrastructure does not mean building everything yourself. It means making deliberate decisions and keeping the exit open. With Terraform, clear data paths, and tested backups, that path does not require heroics.