Start Kestra with a Postgres database backend using Podman Compose.

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 in Root Mode

Use the following command to create a Podman machine, start it up and launch Kestra on it:

bash
podman machine init --cpus 2 --rootful -v /tmp:/tmp -v $PWD:$PWD
podman machine start
podman 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.

Use a configuration file

If you want to use a configuration file instead of the KESTRA_CONFIGURATION environment variable to configure Kestra you can update the default docker-compose.yml.

First, create a configuration file, for example named application.yaml and put inside the content of the KESTRA_CONFIGURATION environment variable defined in the docker-compose.yml file.

Then update kestra service in the docker-compose.yml file to mount this file into the container and make Kestra using it via the --config option:

yaml
# [...]
  kestra:
    image: kestra/kestra:latest-full
    pull_policy: always
    # Note that this is meant for development only. Refer to the documentation for production deployments of Kestra which runs without a root user.
    user: "root"
    command: server standalone --worker-thread=128 --config /etc/config/application.yaml
    volumes:
      - kestra-data:/app/storage
      - /var/run/docker.sock:/var/run/docker.sock
      - /tmp/kestra-wd:/tmp/kestra-wd
      - $PWD/application.yaml:/etc/config/application.yaml
    ports:
      - "8080:8080"
      - "8081:8081"
    depends_on:
      postgres:
        condition: service_started

Launch Kestra in Rootless Mode

Use the following command to create a Podman machine in rootless mode.

bash
podman machine init --cpus 2
podman machine start

podman_rootless

Use a configuration file and start Kestra

Update kestra service in the docker-compose.yml file to remove the user: "root" configuration.

yaml
# [...]
  kestra:
    image: kestra/kestra:latest-full
    pull_policy: always
    # Note that this is meant for development only. Refer to the documentation for production deployments of Kestra which runs without a root user.
    #user: "root"  <--- 👀 Comment this line
    command: server standalone --worker-thread=128 --config /etc/config/application.yaml
    volumes:
      - kestra-data:/app/storage
      - /var/run/docker.sock:/var/run/docker.sock
      - /tmp/kestra-wd:/tmp/kestra-wd
      - $PWD/application.yaml:/etc/config/application.yaml
    ports:
      - "8080:8080"
      - "8081:8081"
    depends_on:
      postgres:
        condition: service_started

You can now run Kestra in rootless mode and use it for production purposes. From the same directory where the docker-compose.yml file is present, run the following command to launch Kestra in rootless mode:

bash
podman compose up -d

Was this page helpful?