How to start Docker daemon (windows service) at startup without the need to log-in?

The best solution for windows server is to use Task Scheduler to create task that run "Docker Desktop" app in case of system startup.

to do that search "Task Scheduler", click on "create task...".

on the new tab specify a name for the task and choose "Run whether user is logged on or not" radio button and "Run with highest privilege" checkbox. at the end of page select appropriate windows type.

Create Task

now click trigger tab and add new trigger. on the new trigger page select "At startup" and click OK.

enter image description here

finally, click on the actions tab and add a new Action that run "Docker windows" shortcut that run docker daemon on windows.

Create Action

As docker starting, pass 1 minute and container starting may take a few time (in my case 4 minute) wait a few minutes and then test whether your docker is running.


Here's a PowerShell script that creates the scheduled task and is verified to work on Windows 10:

$trigger = New-ScheduledTaskTrigger -AtStartup
$trigger.Delay = 'PT1M'

$action = New-ScheduledTaskAction -Execute 'C:\Program Files\Docker\Docker\Docker Desktop.exe'

$settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable -RestartCount 999
$settings.ExecutionTimeLimit = 'PT0S'
$settings.RestartInterval = 'PT1M'

Register-ScheduledTask -Action $action -Trigger $trigger -TaskName Docker -Settings $settings -User $env:UserName -Password (ConvertFrom-SecureString (Read-Host -Prompt 'Password' -AsSecureString) -AsPlainText)