Running Docker commands returns Docker is not recognized as an internal or external command


Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and share containerized applications and microservices. Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper. Docker Desktop works with your choice of development tools and languages and gives you access to a vast library of certified images and templates in Docker Hub. This enables development teams to extend their environment to rapidly auto-build, continuously integrate, and collaborate using a secure repository. Kindly refer to these related guides: How to create and deploy a local Registry Server with Docker Image, how to Pull your first Nginx Container Image from Docker Hub and deploy it to your local machine, Azure DevOps and GitHub integration for Docker and Kubernetes deployment, how to create a static pod in Kubernetes, and how to install, register and start GitLab Runner on Windows.

This error is similar to the following error: The build job failed with the following error "Preparation failed: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect". You also want to see "how to install and uninstall Docker Desktop on Windows 10 and Windows Server".

This is because the executor is currently configured to use “Docker” and Docker isn’t installed on the PC. Therefore, all docker-related commands do not work and the following error is prompted “docker is not recognized as an internal or external command”. This error is because there is no environment variable or path defined where the docker executable programs are located. Here is a link to all contents relating to Docker.

Solution – Install Docker on Windows

To resolve this issue, we will have to install Docker on Windows. Kindly refer to this guide for the needed steps to install Docker on Windows. See this guide on “how to install and uninstall Docker Desktop on Windows 10 and Windows Server“.

Other Suggestions:

If you have docker already installed and this error is still prompted, you may have to see if there is an environment variable (system variable) defined for the Docker executable.

If the two recommendations above do not work, you may have to uninstall and reinstall Docker Desktop again.

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Kindly subscribe to TechDirectArchive
This is default text for notification bar