wingetsilent-installdockercontainerswsltutorial
Docker Desktop

How to Install Docker Desktop Silently with winget on Windows

Install Docker Desktop silently with winget — single-line command, WSL2 setup, accept-license flag, and the gotchas every dev deployer needs to know.

· 5 min read · updated May 29, 2026

Docker Desktop is the single most painful "silent install" on Windows because of all its system-level dependencies — WSL2, Hyper-V, virtualisation. Here's the complete recipe that actually works on a fresh machine.

TL;DR

Open Terminal as Administrator:

# 1. Enable WSL2 (if not already)
wsl --install --no-launch --no-distribution

# 2. Reboot
shutdown /r /t 0

After reboot:

# 3. Install Docker Desktop
winget install --id Docker.DockerDesktop -e --silent --accept-package-agreements --accept-source-agreements

Docker Desktop installs to C:\Program Files\Docker. ~2 minutes including config. Admin required. Plan for one reboot after WSL2 setup, possibly another after Docker install.

What gets installed

Field Value
Package ID Docker.DockerDesktop
Publisher Docker Inc.
Installer type EXE (custom Docker installer)
License Proprietary (free for small orgs)
Homepage docker.com/products/docker-desktop
Default install path C:\Program Files\Docker
Required Windows 10 22H2+ / Windows 11, WSL2 OR Hyper-V

The install includes: Docker Engine, Docker CLI, Docker Compose v2, Docker Buildx, the Docker Desktop UI, and dependencies for Kubernetes (optional).

Step 1: Enable WSL2 first

Docker Desktop requires either WSL2 (recommended) or Hyper-V as the backend. WSL2 is the default and works on Windows 10 Home + Pro + Enterprise. Hyper-V only on Pro/Enterprise.

Install WSL2:

wsl --install --no-launch --no-distribution

Flags:

  • --no-launch: don't pop up the new shell
  • --no-distribution: don't install Ubuntu (Docker doesn't need a distro, just the WSL2 kernel)

Reboot mandatory after this for the Windows features to activate.

Step 2: Install Docker Desktop

After reboot:

winget install --id Docker.DockerDesktop -e --silent --accept-package-agreements --accept-source-agreements

The --silent flag accepts Docker's Subscription Service Agreement on your behalf. By installing silently you're agreeing to:

⚠️ Licence note: Docker Desktop is free for personal use and small organisations (fewer than 250 employees AND under $10M annual revenue). Larger orgs need a paid subscription (Pro, Team, or Business). The silent install doesn't differentiate — your org is responsible for licence compliance.

Install with admin-config flags

Docker's installer accepts deployment flags via --override:

winget install --id Docker.DockerDesktop -e --override "install --quiet --accept-license --backend=wsl-2 --installation-dir=C:\Apps\Docker"

Common flags:

Flag Effect
--accept-license Auto-accept the Docker Subscription Service Agreement
--backend=wsl-2 Force WSL2 backend (vs Hyper-V)
--backend=windows-containers Use Windows containers backend
--installation-dir=<path> Custom install location
--always-run-service Start Docker on Windows boot
--no-windows-containers Skip Windows container support

Full reference: Docker Desktop install with admin flags.

Suppress first-launch onboarding

By default Docker Desktop shows a welcome tour and requests Docker Hub sign-in on first launch. To skip:

# Drop a pre-configured settings file
$settingsPath = "$env:APPDATA\Docker\settings.json"
New-Item -ItemType Directory -Path (Split-Path $settingsPath) -Force | Out-Null
@'
{
  "wslEngineEnabled": true,
  "displayedOnboarding": true,
  "displayedTutorial": true,
  "analyticsEnabled": false,
  "autoStart": false
}
'@ | Out-File -Encoding utf8 $settingsPath

This skips onboarding, opts out of analytics, and doesn't auto-start with Windows.

Specify version

winget install --id Docker.DockerDesktop -e --version 4.42.0 --silent

List versions:

winget show --id Docker.DockerDesktop --versions

For organisations, pin Docker Desktop to a tested version:

winget pin add --id Docker.DockerDesktop --version "4.42.*"

Docker Desktop's auto-updater is separate from winget — disable it in Settings → Software updates if you want winget-only management.

Configure WSL distros to use Docker

Once Docker Desktop is running, enable Docker access from any WSL2 distros you have installed (e.g. Ubuntu):

Docker Desktop → Settings → Resources → WSL Integration → enable for the distros you want.

Or programmatically via the same settings.json:

{
  "integratedWslDistros": ["Ubuntu", "Debian"]
}

Now docker ps works inside those WSL2 shells.

Verify

After install + reboot, Docker Desktop runs in the system tray. Verify CLI works:

docker --version
# Docker version 28.5.0, build c25f1ec

docker run hello-world
# (pulls and runs the hello-world image)

If the second command works, Docker is fully operational.

Upgrade silently

winget upgrade --id Docker.DockerDesktop -e --silent --accept-package-agreements --accept-source-agreements

Docker Desktop also prompts in-app for updates. winget upgrade catches it if you've ignored the prompt.

Note: Docker Desktop upgrades sometimes require a Docker Engine restart, which interrupts running containers. Schedule upgrades when no critical workloads are running.

Uninstall silently

winget uninstall --id Docker.DockerDesktop --silent --disable-interactivity

To also remove all containers, images, and volumes (frees lots of disk):

# Run BEFORE uninstall — Docker CLI gone after uninstall
docker system prune --all --volumes --force

winget uninstall --id Docker.DockerDesktop --silent

# Wipe Docker config
Remove-Item "$env:APPDATA\Docker" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:APPDATA\Docker Desktop" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:LOCALAPPDATA\Docker" -Recurse -Force -ErrorAction SilentlyContinue

⚠️ If you used docker-desktop-data WSL distro for storage, also:

wsl --unregister docker-desktop
wsl --unregister docker-desktop-data

In a dev-machine script

# 1. WSL2 + reboot
wsl --install --no-launch --no-distribution
Read-Host "Reboot now. Re-run this script after restart"
exit

# 2. After reboot, install Docker + dev tools
$apps = @(
  "Docker.DockerDesktop",
  "Microsoft.VisualStudioCode",
  "Git.Git",
  "Microsoft.WindowsTerminal"
)

foreach ($id in $apps) {
  winget install --id $id -e --silent `
    --accept-package-agreements --accept-source-agreements
}

See Fresh Windows 11 setup for the full dev-machine workflow.

Common errors

"WSL 2 installation is incomplete"

You haven't rebooted after wsl --install, or WSL kernel update is missing. Manual fix:

wsl --update
shutdown /r /t 0

"Hyper-V is not enabled"

If you chose Hyper-V backend (instead of WSL2):

# Enable Hyper-V (Pro/Enterprise only)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
shutdown /r /t 0

"Docker Desktop requires the Server service to start"

Windows Server service is disabled. Re-enable:

Set-Service -Name LanmanServer -StartupType Automatic
Start-Service -Name LanmanServer

Docker installed but won't start (engine error)

Usually WSL2 kernel needs updating:

wsl --update

Then restart Docker Desktop from the Start menu.

1603 / 1638 errors during install

MSI engine issues. See MSI exit codes.

"Hash mismatch"

Docker pushed an update before winget manifest refreshed. Wait 24h or --force. See hash mismatch fix.

See also

Continue reading