Skip to content

Server Configuration ​

These settings control the web server that dagu server and dagu start-all run: where it listens, how a reverse proxy reaches it, which requests it accepts, and the admin features of the Web UI.

How config.yaml, DAGU_* variables, and flags combine is explained in Configuration. Every key with its variable and default is in the Configuration Reference.

Each request passes these checks in order and stops at the first one it fails. The first three are described in Restrict Network Access:

Minimal Example ​

A server reachable from other machines at https://dagu.example.com through a reverse proxy that terminates TLS:

yaml
host: 0.0.0.0
port: 8080
public_url: https://dagu.example.com
tz: Europe/Berlin

auth:
  mode: builtin

ip_access:
  trusted_proxies: [10.0.0.5]   # the reverse proxy

Listen Address and Port ​

KeyVariableFlagDefault
hostDAGU_HOST--host, -s127.0.0.1
portDAGU_PORT--port, -p8080

The default accepts connections from the same machine only. Set host: 0.0.0.0 to accept them from other machines, as a container requires.

To serve HTTPS from Dagu itself, set tls.cert_file and tls.key_file. See TLS/HTTPS.

Public URL ​

public_url (DAGU_PUBLIC_URL) is the address users open in a browser, such as https://dagu.example.com. Dagu uses it to:

  • build links in notifications, incidents, and public webhook URLs
  • accept that host name in the host name check
  • treat requests from that origin as same-origin in the origin check

Set it whenever users reach Dagu through a different name or port than host and port.

Serve Under a Base Path ​

To serve Dagu at a path such as https://example.com/dagu/, set base_path:

yaml
base_path: /dagu
public_url: https://example.com/dagu

Every route moves under the base path: the UI at /dagu/, the REST API at /dagu/api/v1, and MCP at /dagu/mcp. The reverse proxy must forward the path unchanged, so proxy_pass has no trailing path:

nginx
location /dagu/ {
    proxy_pass http://127.0.0.1:8080;          # keeps the /dagu prefix
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;    # web terminal
    proxy_set_header Connection "upgrade";
}

Live updates use server-sent events. Dagu sends X-Accel-Buffering: no, so nginx does not buffer them.

api_base_path (default /api/v1) changes the API path inside the base path. Leave it at the default unless a client requires another path.

Restrict Network Access ​

Three checks run before sign-in. Use them together with authentication:

CheckKeyRejects with
Client IP addressip_access.allowed_ips403 access denied
Host headerallowed_hosts400 host "<name>" is not allowed; add it to allowed_hosts or set public_url
Browser Origin headercors_allowed_origins403 cross-origin request denied

IP Access Allowlist ​

Limit the whole HTTP server to known addresses or networks:

yaml
ip_access:
  allowed_ips:          # DAGU_IP_ACCESS_ALLOWED_IPS
    - 203.0.113.10
    - 10.0.0.0/8
    - 2001:db8:1234::/48
  trusted_proxies:      # DAGU_IP_ACCESS_TRUSTED_PROXIES
    - 10.42.0.0/16
  • An empty allowed_ips turns the check off. When set, it covers every route: UI, API, health, metrics, webhooks, SSE, terminal, and MCP.
  • Behind a proxy, list the proxy in trusted_proxies. Dagu reads X-Forwarded-For and X-Real-IP only from a trusted peer, and walks X-Forwarded-For from the right past every trusted address. List every proxy that appends to the header.
  • A malformed forwarding header from a trusted proxy is rejected. Configure the proxy to drop client-supplied forwarding headers.
  • Proxy authentication also reads trusted_proxies. With an empty list, it accepts identity headers from loopback only.

Allowed Host Names ​

The host name check blocks DNS rebinding, where a web page points its own domain at Dagu so the browser treats Dagu as the page's own site. It checks the Host header of:

  • every request when auth.mode: none
  • the first-admin setup endpoint, /api/v1/auth/setup, in every mode

These names always pass:

  • IP addresses and single-label names, such as localhost or dagu
  • names under localhost, local, internal, test, example, invalid, alt, home.arpa, and service.arpa, such as dagu.dagu.svc.cluster.local
  • the host setting, the public_url host, and the machine's hostname
  • the name of a connected Tailscale tunnel

List any other name in allowed_hosts (DAGU_ALLOWED_HOSTS):

yaml
allowed_hosts:
  - dagu.example.com
  - .corp.example.com   # the domain and all its subdomains

Matching ignores case and port. Behind a reverse proxy, Dagu checks the Host header the proxy sends; with proxy_set_header Host $host, that is the public name.

"*" accepts every name and turns the check off, with a warning at startup. Any website can then reach first-admin setup on a fresh install through a visitor's browser, and, with auth.mode: none, run workflows. Use it only when no browser can reach Dagu.

Cross-Origin Browser Access ​

Browser requests from another origin are refused. Same-origin UI requests, and clients that send no Origin header, such as the CLI and curl, are not affected.

To let another web application call Dagu with the user's credentials, list its origin:

yaml
cors_allowed_origins:         # DAGU_CORS_ALLOWED_ORIGINS
  - https://app.example.com
  - https://*.tools.example.com
  • An entry is scheme://host[:port]. * in the host matches subdomains.
  • "*" alone allows every origin without credentials and logs a warning. With auth.mode: none, any website can then run workflows through a visitor's browser.
  • The first-admin setup endpoint never accepts cross-origin requests.

Authentication ​

auth.mode (DAGU_AUTH_MODE) selects how users sign in. A server with no auth.mode uses builtin and shows the setup page, where the first visitor creates the admin account.

ModeUse it forPage
builtinUsers, roles, API keys, and SSOBuiltin Auth (RBAC)
builtin with auth.oidcSign-in through an OpenID Connect providerOIDC
builtin with auth.proxySign-in through an authenticating reverse proxyProxy Authentication
basicOne shared username and passwordBasic Auth
noneA local machine with no other usersAuthentication

To create the admin at startup instead of on the setup page, set auth.builtin.initial_admin.username and auth.builtin.initial_admin.password. Passwords and secrets can come from files; see Secrets From Files.

Permissions ​

Two server-wide switches turn off editing and running for everyone, whatever their role:

yaml
permissions:
  write_dags: false   # no creating, editing, renaming, or deleting DAGs
  run_dags: true      # starting, retrying, stopping, and approving runs

Both default to true and have no environment variable. When a switch is off, the Web UI hides the matching controls and the API answers 403 Permission denied. Notification channels that run a command need both switches on.

Roles from builtin auth apply on top of these switches. See Roles.

Timezone ​

tz (DAGU_TZ) sets the timezone for schedules and for times shown in the UI. Dagu also exports it to every step as TZ, replacing any TZ in its own environment, so programs that steps start, including services they restart, inherit it.

yaml
tz: Europe/Berlin

Without tz, Dagu uses the host's local time and adds no TZ to steps. A TZ already in Dagu's environment still reaches them. On Linux and macOS, the local time is UTC when TZ is unset and /etc/localtime is missing.

tz takes an IANA name. Dagu carries its own timezone database, so it accepts names the host cannot resolve; programs that use the host's C library then run in UTC. Check a host with TZ=Europe/Berlin date: output in UTC, or an abbreviation such as Europe instead of CET, means the host lacks the zone.

On such a host, remove tz, or clear TZ in the steps that need the host default:

yaml
steps:
  - id: restart_service
    run: env -u TZ /usr/local/bin/restart-service

TZ: "" in a DAG's env leaves TZ set but empty, which most programs treat as UTC. To set a zone for one schedule only, use CRON_TZ.

Web UI ​

KeyVariableDefaultEffect
ui.navbar_titleDAGU_UI_NAVBAR_TITLEDaguTitle in the navigation bar
ui.navbar_colorDAGU_UI_NAVBAR_COLORnoneNavigation bar color, such as #b91c1c for production
ui.dags.sort_fieldDAGU_UI_DAGS_SORT_FIELDnameDefault sort of the Workflows list: name, nextRun, status, or lastRun
ui.dags.sort_orderDAGU_UI_DAGS_SORT_ORDERascasc or desc
ui.max_dashboard_page_limitDAGU_UI_MAX_DASHBOARD_PAGE_LIMIT100Most items the dashboard requests per page
headlessDAGU_HEADLESSfalseServe the API without the Web UI

A distinct title and color per environment help users tell servers apart:

yaml
ui:
  navbar_title: Production
  navbar_color: "#b91c1c"

Log Encoding ​

ui.log_encoding_charset (DAGU_UI_LOG_ENCODING_CHARSET) is the charset the UI and API use for log lines that are not valid UTF-8, such as output from cmd.exe or Windows programs that write in the system code page.

yaml
ui:
  log_encoding_charset: shift_jis
  • Each line is decoded on its own: a valid UTF-8 line is shown as is, and only the other lines use the charset. A log that mixes both reads correctly.
  • utf-16, iso-2022-jp, and hz-gb-2312 are decoded for the whole log, because their lines cannot be judged one at a time.
  • Without the key, the default comes from the system: the ANSI code page on Windows, such as shift_jis on Japanese Windows, and the LC_ALL or LANG charset on Linux and macOS, falling back to utf-8.
  • Log downloads return the file unchanged.

See Supported Log Encodings for every accepted name.

Terminal ​

The web terminal opens a shell on the server host in the browser. It is off by default.

yaml
terminal:
  enabled: true      # DAGU_TERMINAL_ENABLED
  max_sessions: 5    # DAGU_TERMINAL_MAX_SESSIONS
  • It requires auth.mode: builtin and is open to the admin role only.
  • The shell runs as the Dagu process user, so terminal access equals shell access to the host.
  • The shell is default_shell, else $SHELL, else /bin/sh.
  • A session beyond max_sessions is refused with 429, and a session requested during shutdown with 503.
  • Sessions are recorded in the audit log.

Behind nginx, forward the WebSocket upgrade headers, as in the base path example.

Audit Logging ​

The audit log records who did what: sign-ins, changes to users, API keys, webhooks, DAGs, secrets, workspaces, remote nodes, Git Sync, Wiki pages, notifications and incidents, MCP and agent actions, and terminal commands. Managers and admins read it at Audit Logs in the Web UI. It requires a self-host license that includes audit logs.

yaml
audit:
  enabled: true        # DAGU_AUDIT_ENABLED, default true
  retention_days: 90   # DAGU_AUDIT_RETENTION_DAYS, default 7
  • Entries are daily JSON Lines files at {paths.admin_logs_dir}/audit/YYYY-MM-DD.jsonl. Keep that directory on persistent storage.
  • A cleaner runs at startup and every 24 hours. It keeps today plus retention_days previous days, by UTC date. 0 keeps every file.
  • Secret values from Dagu's own store, and GitHub, AWS, and Slack token formats, are masked in every entry when it is written. Values from external providers such as Vault are not.
  • To forward entries to a SIEM, tail the files with a log shipper such as Fluent Bit.

To keep a copy off the server, set cloud.audit to send entries to Dagu Console. See Audit Logs in Dagu Console.

Event Store ​

The event store keeps operational events, such as run outcomes and LLM usage, for the Events page and /api/v1/event-logs. It is on by default.

yaml
event_store:
  enabled: true        # DAGU_EVENT_STORE_ENABLED
  retention_days: 3    # DAGU_EVENT_STORE_RETENTION_DAYS, default 1; 0 keeps all

Files live in paths.event_store_dir. Put it on persistent storage to keep the history across restarts.

Webhook Payload Limits ​

webhooks.max_payload_size (DAGU_WEBHOOKS_MAX_PAYLOAD_SIZE) caps the body of a webhook trigger request, checked before authentication. The default is 1048576 bytes (1 MiB).

yaml
webhooks:
  max_payload_size: 2097152

The same limit applies to the payload passed to the run. Steps get it as WEBHOOK_PAYLOAD and as a file named by WEBHOOK_PAYLOAD_FILE; a payload too large for one variable comes only as the file. See Payload Handling.

Cache ​

cache (DAGU_CACHE) sets how many parsed DAGs, run statuses, and credentials the server keeps in memory:

PresetDAGs (12 h)Run statuses (1 h)Users, API keys, webhooks (15 min)Event store
low5001,000100 each8 MiB
normal (default)1,0002,000500 each16 MiB
high5,0005,0001,000 each32 MiB

Times in parentheses are how long an entry stays cached. An unknown value uses normal and logs a warning. Watch dagu_cache_entries_total to size it; see Cache Metrics.

Logs and Metrics ​

  • debug, log_format, and access_log_mode control application and HTTP access logs. See Operations - Logging.
  • metrics (DAGU_SERVER_METRICS) is private by default, so /api/v1/metrics requires credentials. See Prometheus Metrics.

Hardening Checklist ​

Before other people or networks can reach the server:

  • Sign-in. Use auth.mode: builtin, with OIDC or proxy authentication for SSO.
  • HTTPS. Terminate TLS at a reverse proxy, or set tls.cert_file and tls.key_file.
  • Network checks. Set public_url, list extra names in allowed_hosts, and limit ip_access.allowed_ips where clients are known.
  • Metrics. Keep metrics: private.
  • Write access. Set permissions.write_dags: false on servers where DAGs change only through Git Sync or deployment.
  • Terminal. Keep terminal.enabled: false unless admins need a shell.
  • Workers. Secure coordinator and worker traffic with TLS. See Transport Security.
  • Step privileges. Treat a mounted Docker socket, a root container, or a host bind mount as administrative access to the host.

Dagu is open source under the GNU General Public License v3.0.