Start Kestra with a Postgres database backend using a Docker Compose file.

The quickest way to a production-ready lightweight Kestra installation is to leverage Docker and Docker Compose. This guide will help you get started with Kestra using Docker.

Before you begin

Make sure you have already installed:

Download the Docker Compose file

Download the Docker Compose file using the following command:

bash
curl -o docker-compose.yml \
https://raw.githubusercontent.com/kestra-io/kestra/develop/docker-compose.yml

If you don't have curl installed, you can download the Docker Compose file manually and save it as docker-compose.yml.

Launch Kestra

Use the following command to start the Kestra server:

bash
docker-compose up -d

Open the URL http://localhost:8080 in your browser to launch the UI.

Adjusting the Configuration

The command above starts a standalone server (all architecture components in one JVM).

The configuration will be done inside the KESTRA_CONFIGURATION environment variable of the Kestra container. You can update the environment variable inside the Docker compose file, or pass it via the Docker command line argument.

Networking in Docker Compose

The default docker-compose file doesn't configure networking for the Kestra containers. This means that you won't be able to access any services exposed via localhost on your local machine (e.g., another Docker container with a mapped port). Your machine and Docker container use a different network. To use a locally exposed service from Kestra container, you can use the host.docker.internal hostname or 172.17.0.1. The host.docker.internal address allows you to reach your host machine's services from Kestra's container.

Alternatively, you can leverage Docker network. By default, your Kestra container will be placed in a default network. You can add your custom services to the docker-compose.yml file provided by Kestra and use the services' alias (keys from services) to reach them. Even better would be if you create a new network e.g. network kestra_net and add your services to it. Then you can add this network to the networks section of the kestra service. With this, you will have access via localhost to all your exposed ports.

The example below shows how you can add iceberg-rest, minio and mc (i.e. Minio client) to your Kestra Docker Compose file.

Example

Finally, you can also use the host network mode for the kestra service. This will make your container use your host network and you will be able to reach all your exposed ports. This means you have to change the services.kestra.environment.KESTRA_CONFIGURATION.datasources.postgres.url to jdbc:postgresql://localhost:5432/kestra. This is the easiest way but it can be a security risk.

See the example below using network_mode: host.

Example