---
title: "Deploy Kestra on StackBlaze"
description: "Write flows in YAML, run them on a schedule, a webhook or an event, and follow every execution, log and output in Kestra’s web UI. Flows can call an AI model on any OpenAI-compatible endpoint, including a model you host yourself. The admin account is ready when the app starts."
category: "development, productivity, work"
url: https://www.stackblaze.com/templates/kestra
---

# Deploy Kestra

Write flows in YAML, run them on a schedule, a webhook or an event, and follow every execution, log and output in Kestra’s web UI. Flows can call an AI model on any OpenAI-compatible endpoint, including a model you host yourself. The admin account is ready when the app starts.

**[Deploy Kestra on StackBlaze](https://dashboard.stackblaze.com/new/template/kestra)**

## This stack

- **Kestra**: Web service
- **PostgreSQL**: managed database · TCP:5432
- **Email**: platform add-on

## What you get

- **Flows in YAML**: Each flow is a YAML file with inputs, tasks and outputs. Edit it in the browser editor, with the plugin docs open beside it.
- **Schedules, webhooks and events**: Start a flow on a cron schedule, from a webhook call, from another flow, or by hand from the UI.
- **Every run on record**: Executions, logs, outputs and metrics for each run are kept in PostgreSQL and shown in the UI.
- **AI models in flows**: Flows can call any OpenAI-compatible model, including one you host yourself. The built-in AI Copilot runs on Google Gemini.
- **Admin account at deploy**: The admin email and a generated password are set in the configuration, so the setup page never opens and nobody else can claim the instance.
- **HTTPS web access**: Open Kestra on a public HTTPS hostname. Attach your own domain when you want a branded URL.

## After you deploy

1. **Sign in**: Open the public URL and sign in with `ADMIN_EMAIL` and `ADMIN_PASSWORD` from the app’s Variables. The first start can take a few minutes.
2. **Create a flow**: Go to Flows, then Create. Start from a blueprint or write the YAML yourself, then Save and Execute.
3. **Connect a model for flows (optional)**: Under Variables, set:
4. **Turn on the AI Copilot (optional)**: Under Variables, set:

## How it is wired

- **PostgreSQL holds the state**: Flows, executions, logs, the key-value store and the queue live in the attached database. A restart keeps them.
- **Task files on a volume**: Files written by tasks go to /app/storage on a shared volume, so they survive a redeploy.
- **Scripts run in the container**: Script tasks use the Process task runner. There is no Docker inside the container, so Docker-based task runners do not apply.
- **Email from flows**: With the Email add-on, the MailSend task sends mail using {{ envs.smtp_host }} and the other envs.smtp_* values.

## Common questions

### How do I sign in after deploy?

Use ADMIN_EMAIL and ADMIN_PASSWORD from the app’s Variables. The account is created from the configuration before the app is reachable, so there is no setup page to claim.

### How does a flow call an AI model?

Set MODEL_URL, MODEL_API_KEY and MODEL_NAME to any OpenAI-compatible endpoint: a hosted API or your own model server. A flow reads them as {{ envs.model_url }}, {{ envs.model_api_key }} and {{ envs.model_name }}, for example in an HTTP request to /chat/completions.

### Can I use a model I host myself?

Yes. Under Variables, set:

### Which variables set up AI?

Six, all optional. The first three connect a model for flows, the last three turn on the AI Copilot:

### Can the AI Copilot use my own model?

No. In Kestra’s community edition the Copilot works only with Google Gemini, set by GEMINI_API_KEY and GEMINI_MODEL. It also sends Kestra’s whole plugin catalog with each request, which a small self-hosted model cannot take. Your own model (MODEL_URL, MODEL_API_KEY, MODEL_NAME) is for flows.

### Where is my data stored?

Flows, runs and logs are in the attached PostgreSQL. Files from tasks are on the app’s volume at /app/storage.

### Can I use my own domain?

Yes. Attach a custom domain from the dashboard.

### What does it cost?

You pay for the compute, memory and storage Kestra and its database use, not per flow, run or user.


Source: https://github.com/kestra-io/kestra
