Windows Service
The Windows installers can register Dagu as a Windows service that starts with the computer and restarts after a failure. The service is a version-pinned WinSW wrapper around dagu start-all.
Install the Service
Run the graphical installer and choose As a Windows service, or start PowerShell as Administrator and run:
$daguInstaller = [scriptblock]::Create(
(irm https://raw.githubusercontent.com/dagucloud/dagu/main/scripts/installer.ps1)
)
& $daguInstaller -Service yes -AdminUsername admin -AdminPassword "change-me-now"Without -AdminUsername and -AdminPassword, create the first admin account at http://127.0.0.1:8080/setup. Add -Port <port> to serve on another port. See Install on Windows for the other installer parameters.
Where Things Are
| Path | Contents |
|---|---|
C:\Program Files\Dagu\dagu.exe | The Dagu binary |
C:\Program Files\Dagu\dagu-service.xml | The service definition, which sets DAGU_HOME, DAGU_HOST, and DAGU_PORT |
C:\ProgramData\Dagu\ | DAGU_HOME: workflows in dags\, config.yaml, and run data |
C:\ProgramData\Dagu\logs\ | Run logs and the service wrapper's logs |
C:\ProgramData\Dagu\data\run-binaries\ | The copy of dagu.exe that runs execute, so an upgrade can replace dagu.exe while runs continue |
Environment variables take precedence over config.yaml, so change the address or port in dagu-service.xml, then restart the service.
Manage the Service
Run these in PowerShell as Administrator:
Get-Service Dagu # Check status
Restart-Service Dagu # Apply changes to config.yaml or dagu-service.xml
Stop-Service Dagu
Start-Service DaguRuns in progress keep going when the service restarts, including the restart after an upgrade.
What the Service Can Reach
The service runs as the LocalSystem account in session 0, not as the signed-in user:
- Commands see the machine
PATHand LocalSystem's profile. Tools installed only for your user, and the sign-ins they keep, such as a coding agent CLI's login, are not available. Install tools for all users or call them by absolute path, and pass credentials as secrets. - Session 0 has no desktop, so computer steps fail. For them, run Dagu in the user's signed-in session instead, for example from Task Scheduler with Run only when user is logged on.
Uninstall
$daguInstaller = [scriptblock]::Create(
(irm https://raw.githubusercontent.com/dagucloud/dagu/main/scripts/installer.ps1)
)
& $daguInstaller -UninstallThis removes the binary, the service, and the PATH entry, and keeps C:\ProgramData\Dagu. Add -PurgeData to delete that as well. If you used the graphical installer, uninstall Dagu from Settings > Apps instead. See Uninstall.
Access
Open http://127.0.0.1:8080 in your browser.

