---
title: "Deploy Dagu Workflows"
description: "Dagu YAML workflows on a cron scheduler with login and persistent history"
category: "Automation"
url: https://railway.com/deploy/dagu-workflows
---

# Deploy Dagu Workflows

Dagu YAML workflows on a cron scheduler with login and persistent history

**[Deploy Dagu Workflows on Railway](https://railway.com/template/dagu-workflows)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/dagu-workflows/manifest.json

- **Creator:** Anton Orel's Projects
- **Category:** Automation
- **Total deploys:** 6

## Template content

### Dagu

- **Image:** ghcr.io/dagucloud/dagu:2.27.0@sha256:399dda807f532df9e17bcea6fa836b79f5700c3c13ca2f62fc0c1e45cab8e286
- **Start command:** `/bin/sh -ec 'mode="${DAGU_AUTH_MODE:-builtin}"; case "$mode" in builtin) n=$(printf %s "$DAGU_AUTH_BUILTIN_INITIAL_ADMIN_PASSWORD" | LC_ALL=C.UTF-8 wc -m) || n=0; if ! [ "$n" -ge 16 ]; then echo "Dagu refused to start: DAGU_AUTH_BUILTIN_INITIAL_ADMIN_PASSWORD must stay set to 16 or more characters" >&2; exit 64; fi ;; basic) n=$(printf %s "$DAGU_AUTH_BASIC_PASSWORD" | LC_ALL=C.UTF-8 wc -m) || n=0; if ! [ "$n" -ge 16 ]; then echo "Dagu refused to start: DAGU_AUTH_MODE=basic needs DAGU_AUTH_BASIC_PASSWORD of 16 or more characters" >&2; exit 64; fi ;; *) echo "Dagu refused to start: DAGU_AUTH_MODE must be builtin or basic" >&2; exit 64 ;; esac; if [ -z "${DAGU_PUBLIC_URL:-}" ] && [ -n "${RAILWAY_PUBLIC_DOMAIN:-}" ]; then export DAGU_PUBLIC_URL="https://${RAILWAY_PUBLIC_DOMAIN}"; fi; chown "${PUID:-1000}:${PGID:-1000}" /var/lib/dagu; exec /usr/local/bin/tini -g -- /entrypoint.sh dagu start-all'`
- **Health check:** /api/v1/health
- **Public domain:** Yes

## Documentation

# Deploy and Host Dagu Workflows

Dagu is a workflow engine and cron scheduler with a web UI. You write workflows as YAML DAGs of shell steps, and one Dagu process serves the UI and REST API, runs the scheduler and executes the steps. This template runs the official Dagu 2.27.0 image with a generated admin login and a volume that keeps your DAGs and their run history.

## About Hosting Dagu Workflows

The template deploys one Dagu service with a 5,000 MB volume at `/var/lib/dagu`. Sign in as `admin` with the generated `DAGU_AUTH_BUILTIN_INITIAL_ADMIN_PASSWORD` from the service's Variables tab; Dagu creates that account on the first boot and closes its setup page; keep the variable set. Dagu's built-in login protects the UI, the API and the MCP endpoint. DAG definitions, run history, logs, step outputs, users and keys are written to the volume, so scheduled workflows and their history survive restarts and redeploys.

## Why Deploy Dagu Workflows on Railway

Railway gives the UI HTTPS on a public domain, generates the admin password and keeps `/var/lib/dagu` on a persistent volume. The start command makes Railway's root-owned volume writable for Dagu's unprivileged user, refuses to start without authentication or with a weak password, and runs the unchanged upstream entrypoint. The image is pinned by digest, so every deploy runs the same build.

## Common Use Cases

- Replace crontab entries with scheduled workflows that keep logs and history.
- Run data and ETL jobs as steps with dependencies, retries and timeouts.
- Trigger maintenance scripts from webhooks or the REST API.
- Give a small team a UI to start, retry and inspect batch jobs.

## Dependencies for Dagu Workflows Hosting

- Outbound internet access for steps that call APIs, clone repositories or download tools.
- Any databases or services your workflows connect to.

### Deployment Dependencies

- [Dagu](https://dagu.sh)
- [Dagu source](https://github.com/dagucloud/dagu)
- [Dagu documentation](https://docs.dagu.sh)


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/dagu-workflows
