'Windows doesn't recognize Docker command

I already installed Docker for windows. when I type docker --version command in Command prompt, it doesn't recognize it at all.

The message will be this:

'docker' is not recognized as an internal or external command,
operable program or batch file.

docker --version command in cmd

Did I miss something ?



Solution 1:[1]

I had installed Docker 18.06.1-ce version on my Windows 10 machine and faced the similar issue, even though the docker was added the Windows %PATH%.

I moved the docker path to the bottom and that solved my problem.

enter image description here

enter image description here

Solution 2:[2]

You need to start the docker first if you have not and then open powershell.

In the powershell, try to run docker commands.

Solution 3:[3]

I installed docker Docker version 19.03.13 build 4484c46d9d, in Windows 10 pro 1903. I was facing the same issue, then I just renamed 'com.docker.cli' to 'docker' and set the environment variable to 'C:\Program Files\Docker\Docker\resources\bin'

Problem Resolved.

Refer the image:

https://drive.google.com/file/d/1sZwx4udOzJeITV2RDGQKlsOt_TF4Wq2N/view?usp=sharing

https://drive.google.com/file/d/1DpW2DR2n_jCGezwrXuhNtXpSTBWmEDJk/view?usp=sharing

Solution 4:[4]

Renaming 'com.docker.cli' to 'docker' helped me finally get windows powershell and cmd terminals to recognize the docker command.

Solution 5:[5]

Add docker to PATH variable & refreshenv to keep using the same command prompt


If you've installed using docker toolbox the install path "C:\Program Files\Docker Toolbox"

Manually using Environmental Variable > Path (add docker path here)


Using Command Line

For temporary use set PATH=%PATH%;C:\Program Files\Docker Toolbox

  • Make sure to take a back up of PATH by echo %PATH% before doing this

For permanent change setx PATH=%PATH%;C:\Program Files\Docker Toolbox

Solution 6:[6]

docker: command not found

Windows 7: Just set the path of docker in system variable

Step:1 [Click on path -> edit-> paste the docker location]

enter image description here

Step:2 [Paste the docker location] In my case C:\Program Files\Docker Toolbox.

enter image description here

now check $ docker version

Solution 7:[7]

Make sure the docker.exe path (C:\Program Files\Docker\Docker\resources\bin) is added to the PATH variable.

You can check it as follows:

ECHO %PATH%

The docker path had to be appended at the end of the PATH in my case. After that docker cmd was recognized.

Solution 8:[8]

Run as administrator worked for me, both powershell and bash on windows. I did not need to restart.

Solution 9:[9]

Just Restart the system, it is always good practice to restart the system when you install or uninstall any application. Hope this works :)

Solution 10:[10]

You need to restart the system after installation. It worked for me.

Solution 11:[11]

I checked environment variables and noticed that docker path is as the following path in which "R" in resources uppercase. I fixed the case and everything worked as expected Path: "C:\Program Files\Docker\Docker\Resources\bin"

Solution 12:[12]

Try to install GIT bash and then run this command on it for Windows:

base=https://github.com/docker/machine/releases/download/v0.16.0 &&
mkdir -p "$HOME/bin" &&
curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" &&
chmod +x "$HOME/bin/docker-machine.exe"

Click Here.

there is some issues with PowerShell or new version of docker due to which I was facing the same issue but then I went to this page and got way to run it.

PS: GIT bash is required.

Solution 13:[13]

If you have installed Docker Toolbox in your windows, go and add the environment variable.

PATH = "location of folder that contains docker-machine"

Solution 14:[14]

I also face a problem with the installation and running docker. I'm not sure you how did you install docker. I tried this way. I've downloaded the docker toolbox (https://github.com/docker/toolbox/releases) which comes up with docker,docker-machine. Oracle Virtual box which is pretty much enough to start docker locally.Please make sure you have git bash installed in your local. Once the toolbox installation is done click the icon generated on the desktop . Make sure this icon target to your Git bash.exe (you can verify this by right click on icon and find target). and verify docker version

Solution 15:[15]

For me, I had to ensure the check box Enable Hyper-V Windows Features is checked as I was installing.

I just wanted to have client installed, without the engine. So earlier, as I was installing, I unchecked that option. And after successful installation, I get the error - windows does not recognize docker.

But now that reinstalled with the checkbox checked, things are working fine now.

Enable Hyper-V Windows Features

Solution 16:[16]

I noticed that running docker commands before startup causes this issue, but ensuring that docker is running and executing the commands after, they are then recognised. enter image description here

Solution 17:[17]

For those who are facing docker issue on VS Code

I was trying on VS Code Terminal after installation. Restarted and was still facing issue.

enter image description here

Then I tried with fresh terminal of Command Prompt -- it worked!

enter image description here

After that it also working fine on vs code.

In VS Code - close all terminals and open fresh terminal and try test command:

docker --version

enter image description here

Solution 18:[18]

Unfortunately, After many tries and restarts, I uninstalled docker and Re-installed it again, and I had to build all things again.

Solution 19:[19]

I faced the same problem, them I tried in Powershell which works someHo

Solution 20:[20]

  1. Download "docker-machine-Windows-x86_64.exe" from: https://github.com/docker/machine/releases
  2. Rename "docker-machine-Windows-x86_64.exe" to "docker-machine.exe".
  3. Copy "docker-machine.exe" to path C:\Program Files\Docker\Docker\resources\bin.

image

Solution 21:[21]

I facing the same issue when I try to run docker -v in Vscode Terminal after install it. I try to use cmd and git bash it work fine. Restart your vscode will solve it

Solution 22:[22]

For windows server

Use Install-windowsFeature Containers

Solution 23:[23]

In my case, I switched to the windows command prompt instead of the VScode terminal.