Kestra Server CLI Reference: All Commands and Options

For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append .md to any kestra.io/docs/* URL for plain Markdown.

Available on: Open Source EditionEnterprise Edition

Use kestra to interact with the Kestra server and database

Use the Kestra server CLI effectively

This page includes CLI commands and options for both Open Source and Enterprise editions. Enterprise-only operations are marked with (EE) where relevant.

Installation

The Kestra Server CLI (kestra) is not a separate tool to install. It is the same executable used to run Kestra server components, so you get it through your Kestra installation method.

  • Docker / Docker Compose / Kubernetes: the CLI is already included in the kestra/kestra image.
  • Standalone JAR: the downloaded executable (./kestra-VERSION) is the CLI.
  • Managed environments (e.g. Kestra Cloud): host-level server commands are typically not available. Use kestractl for API-level operations.

To install Kestra first, follow one of these guides:

Examples of the same CLI in each mode:

# Docker container
docker exec -it kestra /app/kestra plugins list
# Standalone binary
./kestra-VERSION plugins list

Global options

These options can be used with any Kestra CLI command.

  • -v, --verbose: Increase log verbosity (use -vv for more).
  • -l, --log-level: Set a specific level: TRACE, DEBUG, INFO, WARN, ERROR.
  • --internal-log: Also change the level for internal logs.
  • -c, --config: Path to a configuration file (default: ~/.kestra/config.yml).
  • -p, --plugins: Path to the plugins directory.

Examples

kestra plugins list -vv
kestra plugins install --log-level DEBUG

API options

Available for the server commands that call the Kestra API, such as kestra flow export and kestra namespace kv update. For API operations from CI/CD or your workstation, use kestractl instead; it covers these commands and many more.

  • --server: Kestra server URL (default: http://localhost:8080).
  • --headers: Add custom headers (<name=value>).
  • --user: Basic auth (user:password).
  • --tenant: Tenant identifier (EE and Cloud only).
  • --api-token: API token (EE and Cloud only).

Examples

kestra flow export --namespace company.team /tmp/export --server http://my-kestra:8080
kestra flow export --namespace company.team /tmp/export --user admin:secret

kestra (top-level)

Usage: kestra [-hV] [COMMAND]
Options:
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
plugins handle plugins
server handle servers
flow handle flows
sys handle systems maintenance
configs handle configs
namespace handle namespaces
auths handle auths
tenants handle tenants
migrate handle migrations
backups (EE) handle metadata backups and restore

Preload flows at startup

Use the --flow-path (or -f) flag to load all flows from a directory when starting Kestra so they’re available immediately:

kestra server standalone --flow-path /path/to/flows

Point this to a folder of YAML flow definitions; Kestra will load them at startup into the namespaces declared in each file.


Configuration commands

kestra configs properties

Display the effective configuration properties.

kestra configs properties

Flow commands

To validate, create, or update flows on a Kestra instance, use kestractl. The server commands for those tasks were removed in 2.0; see Server CLI flow commands removed.

kestra flow test

Run a flow locally with specific inputs, helping you test its logic without deploying it to the server.

Inputs: file (path), inputs (key value pairs; absolute path for file inputs)

kestra flow test /path/to/my-flow.yml myInput1 value1

kestra flow dot

Generate a DOT graph from a flow file, which you can use with a visualization tool to create a visual diagram of your flow’s structure.

kestra flow dot /path/to/my-flow.yml

kestra flow export

To export flows through the API, you can also use kestractl flows export.

Export flows to a ZIP file.

Inputs: --namespace (required), directory (path to export into)

kestra flow export --namespace my-namespace /path/to/export-directory

kestra flow delete

Delete a flow. kestractl flows delete does the same through the API.

Inputs: namespace, id

kestra flow delete my-namespace my-flow-id

Migration commands

kestra migrate plan

Lists all pending database migrations without applying them. Read-only: acquires no lock, writes nothing.

Options: --sql (print the raw SQL for each SQL-based migration)

kestra migrate plan
kestra migrate plan --sql

kestra migrate run

Applies all pending migrations in lexicographic order. Acquires a distributed lock so only one process migrates at a time. Makes a single non-blocking lock attempt; if the lock is already held, exits immediately with code 1.

kestra migrate run

kestra migrate unlock

Force-releases the migration lock. Use only when kestra migrate run exited abnormally and left the lock held.

kestra migrate unlock

kestra migrate repair

Updates the stored checksum of an already-applied migration script to match the script shipped with the current version. Use it when Kestra stops with Checksum mismatch for migration [<script-id>] after an intentional change to that script. Pass the script ID as the only argument.

kestra migrate repair 2.0.01-schema

The command exits with code 1 if another process holds the migration lock, the script ID is unknown, or the script hasn’t been applied yet.


Namespace commands

To upload namespace files, use kestractl nsfiles upload.

kestra namespace kv update

To set a key from CI/CD or your workstation, use kestractl kv set instead.

Set/update a key in the namespace KV store. Set an expiration time, specify the data type, and even read the value from a file.

Inputs: namespace, key, value Options: -e, --expiration, -t, --type, -f, --file-value

kestra namespace kv update my-ns my-key "my-value" -e 1d

Plugin commands

kestra plugins install

Install one or more plugins by Maven coordinates.

Options: --locally (default true), --all, --repositories

kestra plugins install io.kestra.plugin.jdbc:mysql:1.2.3

To download plugins outside a Kestra installation, for example before building a custom Docker image, use kestractl plugins instead.

kestra plugins uninstall

Uninstall one or more plugins.

kestra plugins uninstall io.kestra.plugin.jdbc:mysql:1.2.3

kestra plugins list

List installed plugins.

Option: --core to include core task plugins

kestra plugins list --core

kestra plugins doc

Generate documentation for installed plugins.

Inputs: output (default: ./docs) Options: --core, --icons, --schema

kestra plugins doc ./docs --core

Search for available plugins.

kestra plugins search jdbc

Server commands

Every server command accepts --port to set the port to bind.

kestra server controller

Start a Worker Controller, the gRPC endpoint that Workers connect to (port 50051 by default). The webserver and standalone server start an embedded Worker Controller unless you pass --no-controller.

Options: --ignore-queue-records (list)

kestra server controller

kestra server executor

Start the executor.

Options: -f, --flow-path and --tenant to load flows from a path, and the troubleshooting lists --ignore-executions, --ignore-flows, --ignore-namespaces, --ignore-tenants, and --ignore-queue-records. Each list is comma-separated.

kestra server executor

kestra server indexer

Start the indexer. The webserver and standalone server start an embedded indexer unless you pass --no-indexer.

Options: --ignore-indexer-records and --ignore-queue-records (lists)

kestra server indexer

kestra server scheduler

Start the scheduler.

Options: -t, --max-threads (maximum threads used to evaluate triggers; defaults to the number of allocated CPU cores, with a minimum of 4)

kestra server scheduler --max-threads 8

kestra server standalone

Start a standalone server (all core services).

Options:

  • --worker-thread: number of worker threads. Defaults to eight times the number of available processors. Set it to 0 to start no worker.
  • --no-tutorials, --no-indexer, --no-controller: don’t load tutorial flows, start the embedded indexer, or start the embedded Worker Controller.
  • -f, --flow-path and --tenant: load flows from a path.
  • --ignore-executions, --ignore-flows, --ignore-namespaces, --ignore-tenants, --ignore-indexer-records, --ignore-queue-records: comma-separated lists to ignore, for troubleshooting only.
kestra server standalone --worker-thread 16

kestra server webserver

Start the webserver. By default, it also starts an embedded indexer and an embedded Worker Controller.

Options:

  • --no-tutorials: don’t load tutorial flows.
  • --no-indexer: don’t start the embedded indexer.
  • --no-controller: don’t start the embedded Worker Controller.
  • --ignore-indexer-records, --ignore-queue-records: comma-separated lists to ignore, for troubleshooting only.
kestra server webserver --no-tutorials

kestra server worker

Start a worker.

Options: -t, --thread (maximum worker threads; defaults to eight times the number of available processors)

kestra server worker --thread 16

kestra server local

Start a local dev server.

kestra server local

Kestra with server components in different services

Server components run independently from each other. Most communicate through the queue layer; Workers communicate with the Worker Controller over a bidirectional gRPC stream and never connect to the database directly. In the example below, the webserver runs the embedded Worker Controller, so the workers point to it on port 50051.

Below is an example Docker Compose configuration file running Kestra services with replicas on the PostgreSQL database backend.

Docker Compose Example
volumes:
postgres-data:
driver: local
kestra-data:
driver: local
services:
postgres:
image: postgres
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: kestra
POSTGRES_USER: kestra
POSTGRES_PASSWORD: k3str4
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 30s
timeout: 10s
retries: 10
kestra-scheduler:
image: kestra/kestra:latest
deploy:
replicas: 2
pull_policy: if_not_present
user: "root"
command: server scheduler
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: &common_configuration |
datasources:
postgres:
url: jdbc:postgresql://postgres:5432/kestra
driver-class-name: org.postgresql.Driver
username: kestra
password: k3str4
kestra:
server:
basic-auth:
enabled: false
username: "admin@kestra.io"
password: Admin1234!
repository:
type: postgres
storage:
type: local
local:
base-path: "/app/storage"
queue:
type: postgres
tasks:
tmp-dir:
path: /tmp/kestra-wd/tmp
worker:
controllers:
static:
endpoints:
# Workers connect to the Worker Controller embedded in the webserver
- host: kestra-webserver
port: 50051
ports:
- "8082-8083:8081"
depends_on:
postgres:
condition: service_started
kestra-worker:
image: kestra/kestra:latest
deploy:
replicas: 2
pull_policy: if_not_present
user: "root"
command: server worker
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: *common_configuration
ports:
- "8084-8085:8081"
depends_on:
postgres:
condition: service_started
kestra-executor:
image: kestra/kestra:latest
deploy:
replicas: 2
pull_policy: if_not_present
user: "root"
command: server executor
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: *common_configuration
ports:
- "8086-8087:8081"
depends_on:
postgres:
condition: service_started
kestra-webserver:
image: kestra/kestra:latest
deploy:
replicas: 1
pull_policy: if_not_present
user: "root"
command: server webserver
volumes:
- kestra-data:/app/storage
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/kestra-wd:/tmp/kestra-wd
environment:
KESTRA_CONFIGURATION: *common_configuration
KESTRA_URL: http://localhost:8080/
ports:
- "8080:8080"
- "8081:8081"
depends_on:
postgres:
condition: service_started

In production you might run a similar pattern either by:

  1. Running Kestra services on dedicated machines. For examples, running the webserver, the scheduler, and the executor on one VM and running one or more workers on other instances.
  2. Using Kubernetes and Helm charts. Read more about how to set these up in the Kubernetes installation documentation.

System commands

kestra sys reindex

Reindex records (currently only flow).

Option: --type

kestra sys reindex --type flow

kestra sys submit-queued-execution

Submit all queued executions to the executor.

kestra sys submit-queued-execution

Auths (EE)

kestra auths users create

Create a user.

Inputs: username (required), password (optional) Options: --groups, --tenant, --admin, --instance-owner, --if-not-exists

kestra auths users create --instance-owner --tenant=default admin Admin_password@123

kestra auths users create-basic-auth

Create or replace a basic auth password for a user.

kestra auths users create-basic-auth alice

kestra auths users refresh

Refresh users to update their properties.

kestra auths users refresh

kestra auths users set-instance-owner

Set or remove Instance Owner status.

Inputs: user, instanceOwner (true|false)

kestra auths users set-instance-owner alice true

kestra auths users email-replace-username

Set the username as the email for every user.

kestra auths users email-replace-username

kestra auths users sync-access

Sync users’ access with the fallback tenant (for enabling multi-tenancy).

kestra auths users sync-access

Backups (EE)

kestra backups create

Create a metadata backup.

Inputs: type (FULL | TENANT) Options: --tenant, --encryption-key, --no-encryption, --include-data, --resources

kestra backups create FULL --no-encryption

kestra backups restore

Restore a metadata backup.

Input: uri (Kestra internal storage URI) Options: --encryption-key, --to-tenant, --resources

kestra backups restore kestra:///backups/full/backup-20240917163312.kestra

Tenants (EE)

kestra tenants create

Create a tenant and assign admin roles to an existing admin user.

Inputs: tenantId, tenantName Option: --admin-username

kestra tenants create tenantA "Tenant A" --admin-username alice

Was this page helpful?