MW

How-To · DevOps

'docker is not recognized as an internal or external command' — How to Fix on Windows (2026)

Windows can't find docker.exe because Docker Desktop isn't installed, isn't running, or isn't in PATH. Here's how to get all three sorted in 5 minutes.

Jan 24, 2025 5 min read Windows beginner
Advertisement

The “docker is not recognized as an internal or external command” error on Windows typically means Docker Desktop isn’t installed, isn’t running, or isn’t in your system PATH. Here’s exactly what it looks like:

Command Prompt
C:\> docker --version
'docker' is not recognized as an internal or external command, operable program or batch file.

This guide covers Docker installation, WSL2 setup, PATH configuration, and troubleshooting for Windows. By the end your terminal should look like this instead:

Command Prompt — success
C:\> docker --version
Docker version 24.0.6, build ed223bc
C:\> docker run hello-world
Hello from Docker! This message shows that your installation appears to be working correctly.

Understanding the Docker Error

This error occurs when:

  • Docker is not installed
  • Docker is installed but not in PATH
  • Docker Desktop is not running
  • WSL2 is not properly configured
  • Docker installation is incomplete

Docker on Windows Requirements:

  • Windows 10/11 64-bit (Pro, Enterprise, or Education)
  • WSL2 enabled
  • Virtualization enabled in BIOS
  • Docker Desktop application

Install Docker Desktop

Steps:

  1. Visit docker.com/products/docker-desktop
  2. Download Docker Desktop for Windows
  3. Run the installer
  4. Follow installation wizard
  5. Restart computer when prompted
  6. Launch Docker Desktop from Start Menu

Installation Options:

  • Use WSL 2 instead of Hyper-V (recommended)
  • Add shortcut to desktop
  • Start Docker Desktop when Windows starts

Method 2: Using winget

winget install Docker.DockerDesktop

Method 3: Using Chocolatey

choco install docker-desktop

Post-Installation

After installation:

  1. Launch Docker Desktop from Start Menu
  2. Wait for Docker to start (whale icon in system tray)
  3. Verify it’s running (icon should be steady, not animated)
  4. Test in Command Prompt: docker --version

Verify Docker Installation

Check Docker Version

docker --version

Should display: Docker version XX.XX.X, build xxxxx

Check Docker Info

docker info

Shows Docker system information and confirms it’s running.

Test Docker

docker run hello-world

This downloads and runs a test container. If successful, Docker is working correctly.

Check Docker Compose

docker-compose --version

Or with newer versions:

docker compose version

Add Docker to PATH

Docker Desktop usually adds itself to PATH automatically, but if it doesn’t:

Manual PATH Configuration

  1. Find Docker installation:

    • Default: C:\Program Files\Docker\Docker\resources\bin
    • Or: C:\ProgramData\DockerDesktop\version-bin
  2. Add to PATH:

    • Press Win + R , type sysdm.cpl
    • AdvancedEnvironment Variables
    • System VariablesPathEdit
    • New → Add Docker path
    • OK on all dialogs
    • Restart Command Prompt

Here’s what the Environment Variables dialog should look like — the highlighted row is the Docker path you’re adding:

Environment Variables
Variable
Value
ComSpec
C:\WINDOWS\system32\cmd.exe
OneDriveConsumer
C:\Users\mahesh\OneDrive
Path
C:\Windows\system32;C:\Program Files\Docker\Docker\resources\bin
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.JS
TEMP
C:\Users\mahesh\AppData\Local\Temp

Verify PATH

echo %PATH%

Look for Docker directory in the output.

Docker Compose Setup

Docker Compose is included with Docker Desktop, but verify it works:

Check Installation

docker-compose --version

New Docker Compose V2

Docker Desktop includes Compose V2 as a plugin:

docker compose version

Note: V2 uses docker compose (with space) instead of docker-compose (with hyphen).

Enable Compose V2

In Docker Desktop:

  1. Open Settings
  2. Go to General
  3. Check Use Docker Compose V2
  4. Click Apply & Restart

WSL2 Requirements

Docker Desktop on Windows requires WSL2 (Windows Subsystem for Linux 2).

Check WSL Status

wsl --status

Install WSL2

If not installed, run this in PowerShell as Administrator:

Windows PowerShell — Administrator
C:\> wsl --install
Installing: Virtual Machine Platform Installing: Windows Subsystem for Linux Installing: Ubuntu The requested operation is successful. Changes will not be effective until the system is rebooted.

This installs:

  • WSL2
  • Default Linux distribution (Ubuntu)
  • Required Windows features

Update to WSL2

If you have WSL1:

wsl --set-default-version 2
wsl --set-version Ubuntu 2

Verify WSL2

wsl -l -v

Should show version 2 for your distributions.

Enable Virtualization

Docker requires virtualization:

  1. BIOS Settings: Enable virtualization (Intel VT-x or AMD-V)
  2. Windows Features: Enable Hyper-V or Virtual Machine Platform
  3. Check: Task Manager → Performance → CPU → Virtualization should show “Enabled”

Troubleshooting

Issue: Docker Command Not Found

Solutions:

  1. Verify Docker Desktop is running (check system tray)
  2. Restart Docker Desktop
  3. Check PATH includes Docker directory
  4. Restart Command Prompt completely
  5. Reinstall Docker Desktop if needed

Issue: Docker Desktop Won’t Start

Common Causes:

  • WSL2 not installed or updated
  • Virtualization not enabled
  • Antivirus blocking Docker
  • Port conflicts

Solutions:

  1. Check WSL2: wsl --status
  2. Enable virtualization in BIOS
  3. Add Docker to antivirus exclusions
  4. Check for port conflicts: netstat -ano | findstr :2375

Issue: “WSL 2 installation is incomplete”

Fix:

wsl --update
wsl --set-default-version 2

Restart computer and try again.

Issue: Permission Denied

Solution: Run Command Prompt as Administrator, or ensure your user is in the “docker-users” group.

Issue: Docker Daemon Not Running

Symptoms: Cannot connect to the Docker daemon

Solutions:

  1. Start Docker Desktop
  2. Wait for it to fully start (whale icon steady)
  3. Check Docker Desktop logs
  4. Restart Docker Desktop
  5. Restart computer if needed

Alternative Installations

Docker Toolbox (Legacy)

For older Windows versions without WSL2 support:

  1. Download Docker Toolbox
  2. Install VirtualBox
  3. Install Docker Toolbox
  4. Use Docker Quickstart Terminal

Note: Docker Toolbox is deprecated. Use Docker Desktop if possible.

Colima (Alternative)

For users who prefer not to use Docker Desktop:

# Install via Homebrew (if on macOS, or use WSL)
brew install colima docker docker-compose
colima start

Podman (Docker Alternative)

Podman is a Docker-compatible alternative:

winget install RedHat.Podman

Quick Fix Checklist

  1. Install Docker Desktop from official website
  2. Enable WSL2 and update if needed
  3. Enable Virtualization in BIOS
  4. Launch Docker Desktop and wait for it to start
  5. Verify PATH includes Docker directory
  6. Test with docker --version and docker run hello-world
  7. Restart Command Prompt after PATH changes

Conclusion

Fixing “docker is not recognized” on Windows:

  1. Install Docker Desktop (recommended method)
  2. Configure WSL2 (required for Docker Desktop)
  3. Verify PATH (usually automatic)
  4. Start Docker Desktop (must be running)
  5. Test installation with docker --version

When everything is wired up correctly, you’ll see this:

Command Prompt — fixed
C:\> docker --version
Docker version 24.0.6, build ed223bc
C:\> docker compose version
Docker Compose version v2.21.0
C:\> docker run hello-world
Hello from Docker! This message shows that your installation appears to be working correctly.

Docker Desktop handles most PATH configuration automatically. If issues persist, check WSL2 status and ensure Docker Desktop is running.

Docker Windows Installation Troubleshooting Containers
Advertisement

Get weekly notes in your inbox

Practical tips, tutorials and resources. No spam.