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:
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 proxyListen Address and Port
| Key | Variable | Flag | Default |
|---|---|---|---|
host | DAGU_HOST | --host, -s | 127.0.0.1 |
port | DAGU_PORT | --port, -p | 8080 |
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:
base_path: /dagu
public_url: https://example.com/daguEvery 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:
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:
| Check | Key | Rejects with |
|---|---|---|
| Client IP address | ip_access.allowed_ips | 403 access denied |
Host header | allowed_hosts | 400 host "<name>" is not allowed; add it to allowed_hosts or set public_url |
Browser Origin header | cors_allowed_origins | 403 cross-origin request denied |
IP Access Allowlist
Limit the whole HTTP server to known addresses or networks:
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_ipsturns 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 readsX-Forwarded-ForandX-Real-IPonly from a trusted peer, and walksX-Forwarded-Forfrom 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
localhostordagu - names under
localhost,local,internal,test,example,invalid,alt,home.arpa, andservice.arpa, such asdagu.dagu.svc.cluster.local - the
hostsetting, thepublic_urlhost, and the machine's hostname - the name of a connected Tailscale tunnel
List any other name in allowed_hosts (DAGU_ALLOWED_HOSTS):
allowed_hosts:
- dagu.example.com
- .corp.example.com # the domain and all its subdomainsMatching 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:
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. Withauth.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.
| Mode | Use it for | Page |
|---|---|---|
builtin | Users, roles, API keys, and SSO | Builtin Auth (RBAC) |
builtin with auth.oidc | Sign-in through an OpenID Connect provider | OIDC |
builtin with auth.proxy | Sign-in through an authenticating reverse proxy | Proxy Authentication |
basic | One shared username and password | Basic Auth |
none | A local machine with no other users | Authentication |
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:
permissions:
write_dags: false # no creating, editing, renaming, or deleting DAGs
run_dags: true # starting, retrying, stopping, and approving runsBoth 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.
tz: Europe/BerlinWithout 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:
steps:
- id: restart_service
run: env -u TZ /usr/local/bin/restart-serviceTZ: "" 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
| Key | Variable | Default | Effect |
|---|---|---|---|
ui.navbar_title | DAGU_UI_NAVBAR_TITLE | Dagu | Title in the navigation bar |
ui.navbar_color | DAGU_UI_NAVBAR_COLOR | none | Navigation bar color, such as #b91c1c for production |
ui.dags.sort_field | DAGU_UI_DAGS_SORT_FIELD | name | Default sort of the Workflows list: name, nextRun, status, or lastRun |
ui.dags.sort_order | DAGU_UI_DAGS_SORT_ORDER | asc | asc or desc |
ui.max_dashboard_page_limit | DAGU_UI_MAX_DASHBOARD_PAGE_LIMIT | 100 | Most items the dashboard requests per page |
headless | DAGU_HEADLESS | false | Serve the API without the Web UI |
A distinct title and color per environment help users tell servers apart:
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.
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, andhz-gb-2312are 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_jison Japanese Windows, and theLC_ALLorLANGcharset on Linux and macOS, falling back toutf-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.
terminal:
enabled: true # DAGU_TERMINAL_ENABLED
max_sessions: 5 # DAGU_TERMINAL_MAX_SESSIONS- It requires
auth.mode: builtinand 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_sessionsis refused with429, and a session requested during shutdown with503. - 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.
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_daysprevious days, by UTC date.0keeps 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.
event_store:
enabled: true # DAGU_EVENT_STORE_ENABLED
retention_days: 3 # DAGU_EVENT_STORE_RETENTION_DAYS, default 1; 0 keeps allFiles 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).
webhooks:
max_payload_size: 2097152The 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:
| Preset | DAGs (12 h) | Run statuses (1 h) | Users, API keys, webhooks (15 min) | Event store |
|---|---|---|---|---|
low | 500 | 1,000 | 100 each | 8 MiB |
normal (default) | 1,000 | 2,000 | 500 each | 16 MiB |
high | 5,000 | 5,000 | 1,000 each | 32 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, andaccess_log_modecontrol application and HTTP access logs. See Operations - Logging.metrics(DAGU_SERVER_METRICS) isprivateby default, so/api/v1/metricsrequires 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_fileandtls.key_file. - Network checks. Set
public_url, list extra names inallowed_hosts, and limitip_access.allowed_ipswhere clients are known. - Metrics. Keep
metrics: private. - Write access. Set
permissions.write_dags: falseon servers where DAGs change only through Git Sync or deployment. - Terminal. Keep
terminal.enabled: falseunless 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.
Related
- Configuration: config files, variables, and paths
- Configuration Reference: every key and variable
- Authentication: sign-in modes and roles
- Operations: service setup, shutdown, logging, and monitoring
- Remote Nodes: manage several servers from one UI

