# Self-host Kestra

> Workflow orchestration platform where flows are declared in YAML and run on schedules or events, with a web UI, a server, workers and a database. Run your own Kestra on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

_Updated November 23, 2026_

Running your own Kestra usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Kestra behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

## Just ask your agent

Open a Plus workspace (Kestra runs in Docker, which Plus and Pro include), tap **Launch** to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

```text
Set up Kestra on this workspace and give me the link. Follow https://envhaven.com/self-host/kestra.md
```

Then open the link it sends and create your Kestra account straight away, before anyone else finds the address. That is the whole request: the address in it is this page's Markdown copy, and the agent follows the instructions for it further down, with every setting Kestra's docs require.

## Or keep it private with Tailscale

The preview URL puts Kestra on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Kestra an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace's **Vars** pane as `TS_AUTHKEY`, and ask the agent:

```text
Set up Kestra on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/kestra.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
```

- A Tailscale container runs beside Kestra, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
- Anything other services have to reach, such as a webhook, still needs a public address. [Keep self-hosted apps private with Tailscale](https://envhaven.com/guides/self-host-privately-with-tailscale) covers both, and what Tailscale's free plan includes.

| At a glance |  |
| --- | --- |
| What it is | Automation and workflows |
| License | Apache-2.0 |
| Runs as | Docker (`kestra/kestra`) |
| Memory | at least 4 GiB for a standalone server ([docs](https://kestra.io/docs/administrator-guide/requirements.md)) |
| Plan that fits | Plus or larger |
| Web port | 8080 |
| Documentation | [kestra.io/docs/installation/docker-compose](https://kestra.io/docs/installation/docker-compose) |

## What your agent takes care of

- **Installing it.** Kestra runs from the official image, `kestra/kestra`, with its data in folders under `~/apps/kestra`.
- **Putting it on an HTTPS address.** The workspace's preview URL serves it, and your own domain can too.
- **Locking it down first.** What Kestra's docs say to set before it faces the internet, below.
- **Telling you what to back up**: PostgreSQL database (postgres-data volume): the queue and repository, /app/storage (kestra-data volume): internal storage files and kestra_db Docker volume (H2 database of the single-container install, mounted at /app/data) ([docs](https://kestra.io/docs/administrator-guide/backup-and-restore.md)).

### The settings it needs behind a proxy

- `kestra.url`: Base URL of the webserver, used for links in notifications. It must be a full URI with a trailing slash and without /ui or /api, for example https://www.my-host.com/kestra/. ([docs](https://kestra.io/docs/administrator-guide/webserver-url.md))
- context-path: Under micronaut.server: serves Kestra under a URL path such as /kestra; the proxy then forwards that same path to Kestra. ([docs](https://kestra.io/docs/administrator-guide/webserver-url.md))
- host-resolution: Under micronaut.server: names the headers Kestra reads for host and protocol behind a reverse proxy (host-header: Host, protocol-header: X-Forwarded-Proto in the docs example). ([docs](https://kestra.io/docs/configuration/observability-and-networking.md))
- `proxy_buffering`: Real-time execution updates use server-sent events; the docs' nginx example turns buffering and caching off. ([docs](https://kestra.io/docs/administrator-guide/webserver-url.md))
- csrf: micronaut.security.csrf: CSRF protection is on by default in Kestra 2.0 and does not need TLS; the docs show disabling it only while debugging a reverse proxy setup and say to leave it on for reachable instances. ([docs](https://kestra.io/docs/administrator-guide/ssl-configuration.md))

### Before it faces the internet

- On a fresh install with no basic-auth credentials the Setup page is publicly reachable, so the first visitor can set the admin credentials; configure them before exposing the instance. ([docs](https://kestra.io/docs/security-hardening.md))
- The management port is unauthenticated by default and should stay inside the trusted network. ([docs](https://kestra.io/docs/security-hardening.md))
- Webhook trigger URLs are served without authentication, so the key in the URL is the only credential. ([docs](https://kestra.io/docs/security-hardening.md))
- Set kestra.encryption.secret-key; without it flows that use SECRET inputs or outputs fail. ([docs](https://kestra.io/docs/security-hardening.md))
- The Compose file ships the Postgres password k3str4 in plain text for both the database and Kestra's datasource. ([docs](https://github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml))

## Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

- "Build a workflow that posts each new GitHub issue in my repo to Slack."
- "Add the credentials it needs from my Vars pane, and test the workflow once."
- "Move Kestra to app.example.com." Add the domain on the dashboard's Domains page with a CNAME to `domains.envhaven.app`, and the agent changes Kestra's address settings to match.
- "Update Kestra to the latest release." It pulls the new image and recreates the container, data kept.

## Instructions for the agent

The agent reads these from the page's Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

```text
Set up Kestra on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, kestra/kestra, starting from the docs' compose file: https://github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: postgres (postgres:18).
- Keep the compose file in ~/apps/kestra and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Kestra's port 8080.
- The preview URL terminates HTTPS in front of Kestra: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/kestra.md for the preview URL, as Kestra's docs describe for running behind a proxy; skip any that apply only when Kestra serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/kestra.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Kestra up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.
```

## What to know

- In Docker, Kestra's containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
- The docs' Compose file mounts the Docker socket and runs as root; the base image itself runs without root. ([docs](https://github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml))
- Script tasks need a server that supports Docker-in-Docker, which rules out hosts such as AWS ECS Fargate. ([docs](https://kestra.io/docs/administrator-guide/requirements.md))
- The shipped default request and file upload limits are 10GB. ([docs](https://github.com/kestra-io/kestra/blob/v2.0.11/cli/src/main/resources/application.yml))
- The management port 8081 is not exposed in the Compose file and is unauthenticated by default. ([docs](https://github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml))
- The single-container quick start uses an embedded H2 database; the docs point to Compose with PostgreSQL for production persistence. ([docs](https://kestra.io/docs/installation/docker.md))
- A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

## Without a workspace

The manual route, on a server you run:

1. Rent a Linux VPS, secure SSH, and create a user for the app.
2. Install Docker and write a compose file from the official image.
3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Kestra's own [documentation](https://kestra.io/docs/installation/docker-compose) covers each step for its install methods.

## Sources

Facts about Kestra come from its own documentation, checked on 2026-11-23:

- [kestra.io/docs/installation/docker-compose](https://kestra.io/docs/installation/docker-compose)
- [kestra.io/docs/installation/docker-compose.md](https://kestra.io/docs/installation/docker-compose.md)
- [kestra.io/docs/administrator-guide/requirements.md](https://kestra.io/docs/administrator-guide/requirements.md)
- [kestra.io/docs/administrator-guide/webserver-url.md](https://kestra.io/docs/administrator-guide/webserver-url.md)
- [kestra.io/docs/configuration/observability-and-networking.md](https://kestra.io/docs/configuration/observability-and-networking.md)
- [kestra.io/docs/administrator-guide/ssl-configuration.md](https://kestra.io/docs/administrator-guide/ssl-configuration.md)
- [github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml](https://github.com/kestra-io/kestra/blob/v2.0.11/docker-compose.yml)
- [github.com/kestra-io/kestra/blob/v2.0.11/cli/src/main/resources/application.yml](https://github.com/kestra-io/kestra/blob/v2.0.11/cli/src/main/resources/application.yml)
- [kestra.io/docs/installation/docker.md](https://kestra.io/docs/installation/docker.md)
- [kestra.io/docs/administrator-guide/backup-and-restore.md](https://kestra.io/docs/administrator-guide/backup-and-restore.md)
- [kestra.io/docs/security-hardening.md](https://kestra.io/docs/security-hardening.md)

## Keep reading

- [Self-host any app with your agent](https://envhaven.com/self-host)
- [Self-host n8n](https://envhaven.com/self-host/n8n)
- [Self-host Node-RED](https://envhaven.com/self-host/node-red)
- [Self-host Activepieces](https://envhaven.com/self-host/activepieces)
- [Self-host Windmill](https://envhaven.com/self-host/windmill)
- [AI agent hosting](https://envhaven.com/guides/ai-agent-hosting)

Source: https://envhaven.com/self-host/kestra
