---
title: Deploy Kaeso on Hetzner Cloud
description: "Run Kaeso 0.7.0 on a Hetzner Cloud server using hcloud or the Hetzner Console. Plans and stock, Cloud Firewall rules, cloud-init, DNS, SMTP on port 587, backups and updates."
url: https://kaeso.app/articles/deploy-kaeso-on-hetzner-cloud
markdown: https://kaeso.app/articles/deploy-kaeso-on-hetzner-cloud.md
language: en
alternates:
  de: https://kaeso.app/de/articles/deploy-kaeso-on-hetzner-cloud.md
  zh-CN: https://kaeso.app/zh-CN/articles/deploy-kaeso-on-hetzner-cloud.md
published: 2026-11-22
authors:
  - Kaeso Team
tags:
  - self-hosting
  - hetzner
  - deployment
  - guide
image: https://kaeso.app/articles/deploy-kaeso-on-hetzner-cloud/cover.jpg
index: https://kaeso.app/llms.txt
---

# Deploy Kaeso on Hetzner Cloud

Run Kaeso 0.7.0 on a Hetzner Cloud server using hcloud or the Hetzner Console. Plans and stock, Cloud Firewall rules, cloud-init, DNS, SMTP on port 587, backups and updates.

> Every page, article and docs page of Kaeso is listed in https://kaeso.app/llms.txt.

- Published: 22 November 2026
- Reading time: 7 min
- Author: Kaeso Team

Hetzner Cloud runs standard Linux virtual servers in Germany, Finland, the United States and Singapore, with hourly billing up to a monthly cap and a stateful Cloud Firewall in front of the VM. That fits Kaeso's single-server Docker Compose package directly.

This guide deploys Kaeso 0.7.0 on a Hetzner Cloud server with either the `hcloud` CLI or the [Hetzner Console](https://console.hetzner.com). At the end you have the full stack — gateway, console, PostgreSQL, ClickHouse, Valkey, Caddy and the updater — answering over HTTPS on your domain. For the shared Docker, backup and troubleshooting reference, see the [Linux server guide](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server).

## What you need

| | |
| --- | --- |
| Account | A Hetzner Cloud account and a project in the [Hetzner Console](https://console.hetzner.com) |
| CLI (optional) | [`hcloud`](https://github.com/hetznercloud/cli) with an API token for your project, or use the Console in a browser |
| SSH key | An SSH public key on your machine, such as `~/.ssh/id_ed25519.pub` |
| Domain | A domain or subdomain such as `kaeso.example.com` whose DNS you control (Hetzner's own DNS works too) |
| Email | An SMTP server that accepts submission on port 587 with STARTTLS (you can add it after the first login) |

## What it costs

Kaeso itself is open source under the MIT licence; you pay Hetzner for the server and any add-ons. As of November 2026, Hetzner Cloud list prices on [hetzner.com/cloud](https://www.hetzner.com/cloud/) are shown excluding VAT and including one Primary IPv4 address (€0.50 per month excl. VAT; IPv6 carries no charge). Plans that meet Kaeso's minimum of 2 vCPUs, 4 GB of memory and 20 GB of disk:

| Plan | Line and architecture | Resources | Monthly cap (excl. VAT, incl. IPv4) | Availability (Nov 2026) |
| --- | --- | --- | --- | --- |
| **CPX22** | [Regular Performance](https://www.hetzner.com/cloud/regular-performance/), shared AMD (`x86_64`) | 2 vCPU, 4 GB RAM, 80 GB disk | €16.99 (`hel1`), €19.99 (`nbg1`), €26.99 (`sin`) | Listed as orderable |
| **CPX21** | [Regular Performance](https://www.hetzner.com/cloud/regular-performance/), shared AMD (`x86_64`, US only) | 3 vCPU, 4 GB RAM, 80 GB disk | €32.49 (`ash`, `hil`) | Listed as orderable |
| **CX23** | [Cost-Optimized](https://www.hetzner.com/cloud/cost-optimized/), shared Intel/AMD (`x86_64`) | 2 vCPU, 4 GB RAM, 40 GB disk | €5.99 (`nbg1`, `hel1`) | Marked not available |
| **CAX11** | [Cost-Optimized](https://www.hetzner.com/cloud/cost-optimized/), shared Ampere (`arm64`) | 2 vCPU, 4 GB RAM, 40 GB disk | €6.49 (`nbg1`, `hel1`) | Marked not available |

Kaeso publishes both `linux/amd64` and `linux/arm64` images, so the Ampere `CAX` plans work when they are in stock. Locations in the EU include at least 20 TB of outgoing traffic per month, US locations 1 to 5 TB depending on the plan, and Singapore from 0.5 TB ([locations](https://docs.hetzner.com/cloud/general/locations/)). Helsinki (`hel1`) is currently lower priced than Nuremberg (`nbg1`) on CPX and CCX plans after Hetzner's [November 2026 price reduction](https://www.hetzner.com/pressroom/price-reduction-cloud-servers-in-helsinki-now-15-percent-cheaper/).

Cloud Firewalls and DNS zones carry no additional charge ([firewalls](https://docs.hetzner.com/cloud/firewalls/overview/), [DNS](https://docs.hetzner.com/networking/dns/overview/)). Servers are billed while powered off until you delete them. Prices and stock change; check the provider's page before you order.

## 1. Create a Cloud Firewall

Hetzner's [Cloud Firewall](https://docs.hetzner.com/cloud/firewalls/faq/) is stateful and filters routed packets in Hetzner's network before they reach the server. With no rules, it blocks all inbound traffic and allows all outbound traffic. Adding any outbound rule turns outbound filtering into deny-by-default as well, so leave outbound rules empty unless you plan to list every outgoing port Kaeso uses.

Create a firewall allowing SSH from your own address range, HTTP and HTTPS on TCP 80 and 443, HTTP/3 on UDP 443, and ICMP. With `hcloud` (run `hcloud context create kaeso` first to save your API token):

```bash
hcloud ssh-key create --name laptop --public-key-from-file ~/.ssh/id_ed25519.pub

hcloud firewall create --name kaeso
hcloud firewall add-rule kaeso --direction in --protocol tcp --port 22 --source-ips 203.0.113.0/24 --description ssh
hcloud firewall add-rule kaeso --direction in --protocol tcp --port 80 --source-ips 0.0.0.0/0,::/0 --description http
hcloud firewall add-rule kaeso --direction in --protocol tcp --port 443 --source-ips 0.0.0.0/0,::/0 --description https
hcloud firewall add-rule kaeso --direction in --protocol udp --port 443 --source-ips 0.0.0.0/0,::/0 --description http3
hcloud firewall add-rule kaeso --direction in --protocol icmp --source-ips 0.0.0.0/0,::/0 --description ping
```

Replace `203.0.113.0/24` with your own IP range (or `0.0.0.0/0,::/0` if your address changes). In the Console, create the same rules under **Firewalls**.

Note that private Cloud Networks are not filtered by a Cloud Firewall, and inside the VM Docker's own packet-filter rules bypass `ufw` ([Docker and firewalls](https://docs.docker.com/engine/network/packet-filtering-firewalls/)). Kaeso publishes only Caddy's ports 80 and 443; verify from outside with `nmap` after the install if you run anything else on the host.

## 2. Create the server

Create a server running `ubuntu-24.04` (or `ubuntu-26.04`) with the firewall attached at creation time, so it is active before first boot. Use `--location` — Hetzner removed `--datacenter` in 2026 ([API reference](https://docs.hetzner.cloud/reference/cloud)):

```bash
hcloud server create \
  --name kaeso \
  --type cpx22 \
  --image ubuntu-24.04 \
  --location hel1 \
  --ssh-key laptop \
  --firewall kaeso
```

Check `hcloud server ip kaeso` and `hcloud server ip --ipv6 kaeso` for the new addresses.

### Optional: install automatically with cloud-init

Hetzner's system images include cloud-init and run a shell script passed as user data on the first boot ([cloud-init FAQ](https://docs.hetzner.com/cloud/servers/faq/)). Because the DNS record does not exist yet when you create a server with a fresh IP, either allocate a [Primary IP](https://docs.hetzner.com/cloud/servers/primary-ips/overview/) first, point your domain at it, and pass `--primary-ipv4`, or let Caddy retry Let's Encrypt once you add the record.

Save a short script locally as `kaeso-init.sh` (do not put secrets in user data; it is readable from the instance metadata service on the host):

```bash
#!/bin/bash
set -euo pipefail
curl -fsSL https://kaeso.app/install.sh | sh -s -- --domain kaeso.example.com --dir /opt/kaeso --install-docker
```

Pass `--user-data-from-file kaeso-init.sh` to `hcloud server create`, or paste the script into the Console's **Cloud config** field. After boot, watch progress with `cloud-init status --wait` and check `/var/log/cloud-init-output.log`.

## 3. Point your domain at the server

Create an A record for `kaeso.example.com` pointing at the server's IPv4 address, and an AAAA record pointing at its IPv6 address.

If your zone is hosted in the Hetzner Console (Hetzner moved DNS into the Cloud Console and retired the old `dns.hetzner.com` service in May 2026), you can add both records with `hcloud zone`:

```bash
hcloud zone add-records --record 203.0.113.10 --ttl 300 example.com kaeso A
hcloud zone add-records --record 2001:db8::1 --ttl 300 example.com kaeso AAAA
```

Wait until `dig +short kaeso.example.com` returns your server's IP before starting the installer. Reverse DNS (PTR) can be edited under the server's **Networking** tab or with `hcloud server set-rdns`, though it is optional when Kaeso relays mail through an external SMTP service on port 587 ([reverse DNS](https://docs.hetzner.com/cloud/servers/cloud-server-rdns/)).

## 4. Install Kaeso

If you did not use cloud-init, sign in as `root`, download and read the installer, and run it:

```bash
ssh root@203.0.113.10
curl -fsSL https://kaeso.app/install.sh -o install.sh
less install.sh
sh install.sh --domain kaeso.example.com --dir /opt/kaeso --install-docker
```

The installer installs Docker Engine, writes `/opt/kaeso/compose.yaml`, `.env` and `master-keys`, starts every service with the updater enabled, waits for Caddy's Let's Encrypt certificate, and prints a one-time setup link. Add `--version 0.7.0` if you want to pin this release.

## 5. Create the first user and save the master key

Open the setup link from the installer output (or from `/var/log/cloud-init-output.log` if you used cloud-init) within 24 hours to create the first instance admin. To print a fresh link while no user exists:

```bash
cd /opt/kaeso
docker compose exec gateway kaeso setup-link
```

Copy `/opt/kaeso/master-keys` into your password manager, separate from your server backups:

```bash
cat /opt/kaeso/master-keys
```

## 6. Configure outgoing email

Hetzner blocks outgoing ports 25 and 465 by default on all Cloud servers; accounts that have been active for a month with a paid invoice can request an unblock ([mail FAQ](https://docs.hetzner.com/cloud/servers/faq/)). **Port 587 is not blocked** and works on day one.

Kaeso defaults to port 587 with STARTTLS, so point it at any external SMTP provider that accepts submission on 587. Edit `/opt/kaeso/.env` as shown in the [Linux server guide](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server#5-add-your-smtp-server), set `KAESO_MAIL_TRANSPORT=smtp` along with `KAESO_SMTP_HOST`, `KAESO_SMTP_USER`, `KAESO_SMTP_PASSWORD` and `KAESO_SMTP_FROM`, apply with `docker compose up -d --wait`, and test:

```bash
cd /opt/kaeso
docker compose exec gateway kaeso mail test owner@example.com
```

If your SMTP provider only listens on port 465, use a relay that supports port 587 until you can request a port unblock from Hetzner.

## Back up

Hetzner offers automated **Backups** (7 daily slots, billed at 20% of the server's monthly price excluding IPv4, deleted when the server is deleted) and manual **Snapshots** (€0.0143 per GB per month excl. VAT on compressed size, kept after server deletion) ([billing FAQ](https://docs.hetzner.com/cloud/billing/faq/)). Neither includes attached Volumes, and Hetzner's cloud SLA excludes backups and snapshots.

A server backup or snapshot is a useful safety net for quick recovery, but not a replacement for logical database dumps: a snapshot taken while PostgreSQL writes may not restore cleanly. Schedule daily `pg_dump` backups and copy them off the server as shown in the [Linux server guide](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server#back-up-the-volumes), and keep `/opt/kaeso/master-keys` somewhere else.

## Update to the next release

Because this install uses the Docker Compose package with the updater enabled, instance admins can update from **Instance** › **Updates** in the console, turn on automatic updates in a maintenance window, or run `sh install.sh --update` in `/opt/kaeso`. See [Update to the next release](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server#update-to-the-next-release) for details.

Before updating from 0.6 to 0.7, note that 0.7.0 refuses `KAESO_KPMR_INTERVAL` below `5m`, `KAESO_MCP_SERVERS_SYNC_INTERVAL` below `1m`, and `KAESO_SMTP_USER` without `KAESO_SMTP_PASSWORD`; the [Kaeso 0.7 article](https://kaeso.app/articles/kaeso-0-7) covers what else changed.

## Troubleshooting

| What you see | What to do |
| --- | --- |
| `CX23` or `CAX11` cannot be selected | Hetzner's Cost-Optimized plans are occasionally out of stock; choose `CPX22` (for example in `hel1`) or check stock in another location |
| `hcloud server create` rejects `--datacenter` | Hetzner removed `--datacenter` in 2026; use `--location` (`hel1`, `nbg1`, `ash`, `hil`, `sin`) |
| Outgoing SMTP times out | Check `KAESO_SMTP_PORT`: Hetzner blocks ports 25 and 465 by default, while port 587 is open. Verify with `docker compose exec gateway kaeso mail test owner@example.com` |
| Let's Encrypt fails after cloud-init boot | Confirm your A/AAAA records resolve to the server's IP and that the Cloud Firewall allows TCP 80 and 443; check `docker compose logs caddy` |
| Outbound connections stop working after editing firewall rules | Adding any outbound rule to a Hetzner Cloud Firewall makes outbound deny-by-default; remove outbound rules or explicitly allow DNS, HTTPS and SMTP 587 |

See [Troubleshooting](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server#troubleshooting) in the Linux server guide for Docker, memory and setup-link issues.

## What was tested

The Hetzner steps were checked against Hetzner Cloud's documentation and `hcloud` 1.70.2 help output on 22 November 2026; Kaeso hasn't been installed on Hetzner Cloud for this guide. For the shared Compose package, the 0.7.0 `compose.yaml`, `.env`, `kaeso config check` and first start against PostgreSQL, ClickHouse and Valkey were tested locally, and the 0.6-to-0.7 update path was tested on a Debian server during the 0.7.0 release. If you deploy it there, [tell us](https://kaeso.app/contact) how it went.

## Next steps

- [Deploy Kaeso on a Linux server](https://kaeso.app/articles/deploy-kaeso-on-a-linux-server): backups, `config check`, scaling and troubleshooting for Docker Compose installs.
- [Where to run Kaeso](https://kaeso.app/articles/where-to-run-kaeso): compare cloud servers, managed platforms and Kubernetes.
- [Configuration](https://docs.kaeso.app/self-hosting/configuration): every environment variable and config-file setting.

Product names in this guide belong to their owners and are used only to name the software and services involved. Kaeso is not affiliated with or endorsed by them.

By Kaeso Team

## More articles

- [How to benchmark an AI gateway without fooling yourself](https://kaeso.app/articles/benchmarking-ai-gateways-honestly.md): What we got wrong and fixed while running Kaeso against LiteLLM, Bifrost and Portkey on BerriAI’s benchmark, and the checks that make a gateway benchmark worth reading.
- [Deploy Kaeso on OVHcloud](https://kaeso.app/articles/deploy-kaeso-on-ovhcloud.md): Run Kaeso 0.7.0 on an OVHcloud VPS or Public Cloud instance. VPS 2027 plans and pricing, Edge Network Firewall, DNS, SMTP on port 587, backups and updates.

[See all articles](https://kaeso.app/articles.md)

## Own the gateway. Own the record

```bash
curl -fsSL https://kaeso.app/install.sh | sh
```

[Install Kaeso](https://docs.kaeso.app/self-hosting/installation) · [Open the live demo](https://demo.kaeso.app)
