docker.recipes

Kestra

intermediate

Event-driven orchestration platform.

Overview

Kestra is a modern event-driven orchestration platform designed to simplify complex workflow automation across diverse environments. Created to address the limitations of traditional workflow schedulers, Kestra combines the power of event-driven architecture with declarative YAML-based workflow definitions, supporting over 400 plugins for integrating with databases, cloud services, APIs, and messaging systems. Unlike legacy orchestrators that rely primarily on time-based scheduling, Kestra enables workflows to respond to real-world events like file changes, database updates, webhook calls, and Kafka messages. PostgreSQL serves as Kestra's robust metadata store, handling workflow definitions, execution history, task states, and audit logs with full ACID compliance. The database's advanced JSON support proves essential for storing Kestra's complex workflow metadata and execution artifacts, while its reliability ensures workflow state consistency even during high-concurrency scenarios. This combination delivers a production-grade orchestration platform capable of handling enterprise-scale automation while maintaining the flexibility needed for rapid workflow development. This stack appeals to DevOps teams transitioning from legacy schedulers like Airflow or Jenkins, data engineers building modern ELT pipelines, and platform teams implementing event-driven microservice orchestration. The PostgreSQL backend provides the reliability and performance characteristics required for mission-critical workflow automation, while Kestra's plugin ecosystem and event-driven capabilities enable sophisticated integration patterns that traditional cron-based schedulers cannot achieve.

Key Features

  • Event-driven workflow triggers supporting schedules, webhooks, file watchers, Kafka consumers, and database change streams
  • Visual workflow topology with real-time execution monitoring and interactive dependency graphs
  • Built-in secrets management with variable templating and environment-specific configuration inheritance
  • PostgreSQL-backed execution history with queryable logs, metrics, and audit trails for compliance reporting
  • Plugin ecosystem with 400+ pre-built connectors for databases, cloud platforms, APIs, and data processing tools
  • Multi-tenant namespace isolation with role-based access control and team-based workflow organization
  • Advanced workflow patterns including parallel execution, conditional branching, error handling, and retry policies
  • RESTful API on port 8081 enabling programmatic workflow management and integration with external systems

Common Use Cases

  • 1Data pipeline orchestration replacing Airflow with event-driven ETL processes triggered by file uploads or database changes
  • 2Microservice workflow coordination responding to Kafka events for order processing, user onboarding, or payment workflows
  • 3Infrastructure automation triggered by monitoring alerts, combining Terraform deployments with notification workflows
  • 4CI/CD pipeline orchestration beyond traditional build tools, handling complex deployment workflows across multiple environments
  • 5Business process automation connecting CRM webhooks to email campaigns, invoice generation, and customer notification sequences
  • 6IoT data processing workflows triggered by sensor data streams, combining real-time analytics with automated responses
  • 7Multi-cloud resource management coordinating deployments, backups, and cost optimization across AWS, GCP, and Azure

Prerequisites

  • Docker Engine 20.10+ with Docker Compose v2 for container orchestration support
  • Minimum 2GB RAM allocated to Docker (1GB+ for PostgreSQL, additional overhead for Kestra workflows)
  • Available ports 8080 (Kestra Web UI) and 8081 (Kestra API) on the Docker host
  • Environment variables DB_USER and DB_PASSWORD configured for PostgreSQL authentication
  • Basic understanding of YAML syntax for workflow definition and event-driven architecture concepts
  • Familiarity with PostgreSQL administration for backup strategies and performance tuning in production environments

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 kestra:
3 image: kestra/kestra:latest
4 container_name: kestra
5 restart: unless-stopped
6 command: server standalone
7 environment:
8 KESTRA_CONFIGURATION: |
9 datasources:
10 postgres:
11 url: jdbc:postgresql://postgres:5432/kestra
12 driverClassName: org.postgresql.Driver
13 username: ${DB_USER}
14 password: ${DB_PASSWORD}
15 ports:
16 - "8080:8080"
17 - "8081:8081"
18 depends_on:
19 - postgres
20 networks:
21 - kestra
22
23 postgres:
24 image: postgres:16-alpine
25 container_name: kestra-postgres
26 environment:
27 POSTGRES_DB: kestra
28 POSTGRES_USER: ${DB_USER}
29 POSTGRES_PASSWORD: ${DB_PASSWORD}
30 volumes:
31 - postgres_data:/var/lib/postgresql/data
32 networks:
33 - kestra
34
35volumes:
36 postgres_data:
37
38networks:
39 kestra:
40 driver: bridge

.env Template

.env
1DB_USER=kestra
2DB_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://kestra.io/docs/
  2. 2Web UI at http://localhost:8080, API on 8081
  3. 3Define workflows in YAML with 400+ plugins
  4. 4Event triggers: schedule, webhook, file, Kafka, database
  5. 5Built-in secrets management and variable templating
  6. 6Real-time execution logs and topology visualization

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

kestra
kestra:
  image: kestra/kestra:latest
  container_name: kestra
  restart: unless-stopped
  command: server standalone
  environment:
    KESTRA_CONFIGURATION: |
      datasources:
        postgres:
          url: jdbc:postgresql://postgres:5432/kestra
          driverClassName: org.postgresql.Driver
          username: ${DB_USER}
          password: ${DB_PASSWORD}
  ports:
    - "8080:8080"
    - "8081:8081"
  depends_on:
    - postgres
  networks:
    - kestra
postgres
postgres:
  image: postgres:16-alpine
  container_name: kestra-postgres
  environment:
    POSTGRES_DB: kestra
    POSTGRES_USER: ${DB_USER}
    POSTGRES_PASSWORD: ${DB_PASSWORD}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - kestra

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 kestra:
5 image: kestra/kestra:latest
6 container_name: kestra
7 restart: unless-stopped
8 command: server standalone
9 environment:
10 KESTRA_CONFIGURATION: |
11 datasources:
12 postgres:
13 url: jdbc:postgresql://postgres:5432/kestra
14 driverClassName: org.postgresql.Driver
15 username: ${DB_USER}
16 password: ${DB_PASSWORD}
17 ports:
18 - "8080:8080"
19 - "8081:8081"
20 depends_on:
21 - postgres
22 networks:
23 - kestra
24
25 postgres:
26 image: postgres:16-alpine
27 container_name: kestra-postgres
28 environment:
29 POSTGRES_DB: kestra
30 POSTGRES_USER: ${DB_USER}
31 POSTGRES_PASSWORD: ${DB_PASSWORD}
32 volumes:
33 - postgres_data:/var/lib/postgresql/data
34 networks:
35 - kestra
36
37volumes:
38 postgres_data:
39
40networks:
41 kestra:
42 driver: bridge
43EOF
44
45# 2. Create the .env file
46cat > .env << 'EOF'
47DB_USER=kestra
48DB_PASSWORD=changeme
49EOF
50
51# 3. Start the services
52docker compose up -d
53
54# 4. View logs
55docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/kestra/run | bash

Troubleshooting

  • Kestra fails to connect to PostgreSQL with 'Connection refused': Verify postgres container is healthy and DB_USER/DB_PASSWORD environment variables match between services
  • Web UI shows 'Database migration failed' error: Check PostgreSQL logs for schema creation issues and ensure POSTGRES_DB=kestra matches Kestra's datasource URL
  • Workflows fail with 'Plugin not found' errors: Update to specific Kestra image tags rather than 'latest' to ensure plugin compatibility, or check plugin documentation for version requirements
  • High memory usage during workflow execution: Increase Docker memory limits and consider PostgreSQL connection pooling settings, monitor postgres_data volume disk usage
  • API calls to port 8081 return connection timeouts: Verify both ports 8080 and 8081 are properly exposed and no firewall rules block internal container communication
  • Workflow executions appear stuck in 'RUNNING' state: Check Kestra logs for task executor issues and verify PostgreSQL lock tables aren't showing long-running transactions blocking workflow state updates

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space