Deploy Kaeso on a Linux server with Docker Compose
Run Kaeso on any Linux server you rent or own, with the installer or by hand. Every step from the DNS record to the first user, email, backups of the volumes and updates, for Kaeso 0.7.0.
- Published
- Reading time
- 7 min
- Author
- Kaeso Team

Most Kaeso installs are one Linux server with Docker. It is the path the project tests most, the one where Update in the console works, and the one every provider guide on this site builds on. This guide works for any server with a public address: a virtual server from a hosting provider, a dedicated machine, or a computer in your own rack.
At the end you have the gateway, the console, PostgreSQL, ClickHouse for request logs, Valkey, Caddy for TLS and the updater, all on one server, answering on your domain.
What you need01
| A server | Linux on amd64 or arm64, with at least 2 vCPUs, 4 GB of memory and 20 GB of disk (requirements (opens in a new tab)). Ubuntu 24.04 and Debian 13 are common choices |
| Docker | Docker Engine with Compose 2.24 or newer, and Engine 25 or newer for the updater. The installer can install Docker for you |
| A domain | A name such as kaeso.example.com whose A or AAAA record points at the server |
| Open ports | TCP 80 and 443 from the internet for the certificate and HTTPS, UDP 443 for HTTP/3, and SSH from your own address |
| An SMTP server for sign-in links, invitations and alerts. Kaeso uses port 587 with STARTTLS by default. You can start without one and add it later |
What it costs depends on where the server runs: a small virtual server with 2 vCPUs and 4 GB costs a few euros or dollars a month at many providers. The guides for Hetzner Cloud, OVHcloud, Scaleway and Oracle Cloud list dated prices with links to each provider's pricing page. Kaeso itself is open source under the MIT licence.
1. Point the domain at the server02
Create an A record for your domain with the server's IPv4 address, and an AAAA record with its IPv6 address if it has one. Check that it resolves before you go on:
dig +short kaeso.example.comCaddy asks Let's Encrypt for a certificate as soon as Kaeso starts, so the record should resolve first. If it doesn't yet, the installer asks whether to go on, and Caddy keeps trying until it does.
2. Open the ports03
Allow TCP 22 from your own address range, TCP 80 and 443, and UDP 443. Use your provider's firewall where it has one: it filters before traffic reaches the server.
On the server itself, note that Docker writes its own packet-filter rules for the ports a container publishes, and those bypass ufw and firewalld (Docker and firewalls (opens in a new tab)). Kaeso publishes only Caddy's ports 80 and 443. PostgreSQL, ClickHouse, Valkey, the gateway and the updater sit on internal Docker networks and publish nothing.
3. Run the installer04
Sign in to the server as root, or as a user that may use sudo, and download the installer. It is a plain shell script, so read it before you run it:
curl -fsSL https://kaeso.app/install.sh -o install.shless install.shsh install.sh --domain kaeso.example.com --dir /opt/kaeso --install-dockerWhat the installer does, in order:
- 01Without Docker, it installs Docker Engine with Docker's own script from
get.docker.com(--install-dockerskips the question). As a user other than root, it adds you to thedockergroup and asks you to sign in again and run it once more. - 02It checks the domain's DNS record, downloads the newest stable release's
compose.yamlinto/opt/kaeso, and writes.envwith random passwords. Only you can read the folder. - 03It generates the master key into
master-keys, readable only by the gateway's user. - 04It turns on the updater, so Update in the console works, and starts every service with
docker compose up -d --wait. The first start downloads about 2 GB of images and takes a minute or two. - 05It waits for Caddy's certificate and prints the one-time setup link.
To install a particular release instead of the newest one, add --version 0.7.0. sh install.sh --help lists every option.
4. Create the first user05
Open the link the installer printed, and create the first user. It becomes the instance admin. The link works once, for 24 hours. To print a new one while no user exists:
cd /opt/kaesodocker compose exec gateway kaeso setup-linkThen add a provider key and create an API key in the console, as the quick start (opens in a new tab) shows. Apps reach Kaeso at https://kaeso.example.com/v1.
5. Add your SMTP server06
The installer starts Kaeso with KAESO_MAIL_TRANSPORT=log: emails are only written to the gateway's log, and password sign-in and the setup link still work. To send them, switch to SMTP in /opt/kaeso/.env and add your server:
cd /opt/kaesosed -i 's/^KAESO_MAIL_TRANSPORT=log$/KAESO_MAIL_TRANSPORT=smtp/' .envcat >> .env <<'EOF'KAESO_SMTP_HOST=smtp.example.comKAESO_SMTP_USER=kaesoKAESO_SMTP_PASSWORD=your-passwordKAESO_SMTP_FROM="Kaeso <kaeso@example.com>"EOFdocker compose up -d --waitdocker compose exec gateway kaeso mail test you@example.comThe last command sends a test email and prints what the SMTP server answered. Set KAESO_SMTP_USER and KAESO_SMTP_PASSWORD together, or neither for a server without authentication: since 0.7.0, a user without a password stops the gateway at startup. Some hosting providers block outgoing mail ports on new servers; the provider guides say which.
6. Keep the master key07
Kaeso encrypts the provider keys it stores with the master key in /opt/kaeso/master-keys. A database backup can't be read without it. Copy it into a password manager, apart from your backups:
sudo cat /opt/kaeso/master-keysCheck the settings08
Every change to .env or compose.override.yaml takes effect with docker compose up -d --wait. Before you apply one, the gateway can check it without starting and without a database:
docker compose run --rm --no-deps gateway config checkIt prints The configuration is valid., or the error the gateway would stop with and how to fix it, and names any KAESO_ variable that names no setting, such as a misspelled one. Configuration (opens in a new tab) lists every setting; put your own changes to the services in compose.override.yaml, which updates never replace.
Back up the volumes09
Kaeso keeps its data in Docker volumes of the Compose project kaeso:
kaeso_postgres- Holds
- Users, organizations, projects, keys, encrypted provider keys, usage, audit logs
- Back up
- Yes, with
pg_dump
kaeso_clickhouse- Holds
- Request logs
- Back up
- If you want to keep the log history
kaeso_valkey- Holds
- Counters and caches, rebuilt from PostgreSQL
- Back up
- No
kaeso_caddy_data- Holds
- The certificate and Caddy's account
- Back up
- Optional; Caddy gets a new one
| Volume | Holds | Back up |
|---|---|---|
kaeso_postgres | Users, organizations, projects, keys, encrypted provider keys, usage, audit logs | Yes, with pg_dump |
kaeso_clickhouse | Request logs | If you want to keep the log history |
kaeso_valkey | Counters and caches, rebuilt from PostgreSQL | No |
kaeso_caddy_data | The certificate and Caddy's account | Optional; Caddy gets a new one |
Dump PostgreSQL while Kaeso runs, for example from a daily cron job, and copy the dumps off the server:
cd /opt/kaesodocker compose exec -T postgres pg_dump -U kaeso -Fc kaeso > kaeso-$(date +%F).dumpKeep compose.yaml, .env and compose.override.yaml with the dumps, and master-keys somewhere else. Backups and master keys (opens in a new tab) shows how to restore a dump, how to back up ClickHouse and how to rotate the master key. A snapshot of the whole server from your provider is a good second copy, but not a replacement for dumps: a snapshot taken while PostgreSQL writes may not restore cleanly.
Update to the next release10
The gateway looks for new releases every 5 minutes, and instance admins see them under Instance › Updates. Three ways to update:
- From the console: Update to … checks the release's signatures, downloads the images, checks that the new gateway accepts your settings, and switches over in about a minute. If anything fails before the switch, nothing changes; if the new version doesn't start, the updater rolls back.
- Automatically: choose Automatically and an update window, daily or weekly.
- With the installer:
sh install.sh --update --version 0.7.0in/opt/kaesochecks the newcompose.yamlagainst the release's manifest, checks your settings with the new gateway before it stops the old one, and starts the release.
Back up PostgreSQL first. Database migrations only move forward, so going back means restoring the dump (upgrades (opens in a new tab)).
From 0.6 to 0.7
0.7.0 refuses three settings that 0.6.0 accepted. Look for them in .env and compose.override.yaml before you update:
KAESO_KPMR_INTERVALbelow5m: set5mor longer, or remove it.KAESO_MCP_SERVERS_SYNC_INTERVALbelow1m: set1mor longer, or remove it.KAESO_SMTP_USERwithoutKAESO_SMTP_PASSWORD: add the password, or remove the user.
An update from the console or the installer that still finds one stops before it switches anything, says which setting and how to fix it, and 0.6.0 keeps running. See How Kaeso updates itself and checks your settings and the Kaeso 0.7 article for what else changed.
What 0.7 adds for a server11
- Outgoing connections. Guardrails and webhooks call the addresses your organizations add, over HTTPS. A private address only works when
guardrails.allowed_networksorwebhooks.allowed_networkslists its network, so a guardrail service on the same server or LAN needs that setting (configuration (opens in a new tab)). - Amazon Bedrock and Azure keys are stored like any other provider key in weighted key pools; the server only needs to reach the provider's endpoint.
- OpenTelemetry traces go to the collector in
KAESO_OTEL_ENDPOINTwhen you set it, and/metricsstays on the gateway's loopback address. - Several gateways on one server:
GATEWAY_REPLICAS=2in.envruns two behind Caddy, which share hard budgets, rate limits and route cooldowns through Valkey (scaling (opens in a new tab)).
Troubleshooting12
| What you see | What to do |
|---|---|
| The browser shows no certificate | docker compose logs caddy shows Let's Encrypt's answer. Check that the DNS record points at this server and that ports 80 and 443 are open from the internet |
| The gateway keeps restarting | docker compose run --rm --no-deps gateway config check prints the reason |
| No email arrives | docker compose exec gateway kaeso mail test you@example.com prints the SMTP server's answer. A timeout often means the provider blocks the port |
| ClickHouse is killed for memory | Give the server 4 GB or more, or turn request logs off (opens in a new tab); usage, limits and budgets work the same |
| The setup link has expired | docker compose exec gateway kaeso setup-link prints a new one while no user exists |
| "Kaeso is already installed on this machine" | Kaeso runs once per Docker host. Run the installer in the folder it names |
Troubleshooting (opens in a new tab) in the docs covers more.
What was tested13
For this guide, the 0.7.0 compose.yaml was resolved with Docker Compose 2.24 and 5 with the .env the installer writes, with SMTP added, with request logs off and with the updater on. The 0.7.0 gateway checked every setting above with kaeso config check, refused the three settings 0.7.0 no longer takes, and started against PostgreSQL, ClickHouse and Valkey with /readyz ready and a setup link. During the 0.7.0 release, a fresh Debian server was installed with the 0.6.0 installer and updated to 0.7.0 from the console, with its data intact, and an install with KAESO_KPMR_INTERVAL=1m stopped that update before anything changed, as described above.
Next steps14
- Where to run Kaeso: every other path, from platforms to Kubernetes.
- Domains and TLS (opens in a new tab): your own certificate, or Kaeso behind a proxy you already run.
- Health and metrics (opens in a new tab): watch the install.
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


