docker: command not found
The “docker: command not found” error means the Docker CLI is not installed on your system. This happens when the docker binary is missing from your PATH. The fix is to install Docker using the official script or your system’s package manager.
What It Means
Your shell cannot locate the docker executable. Docker is either not installed, or the installation directory is not included in your PATH environment variable.
Why It Happens
- Docker is not installed on the machine.
- The Docker package was installed but the binary is in a non-standard location.
- The installation was incomplete or corrupted.
- You are running inside a minimal container image that does not include Docker.
How to Fix It
Install Docker
Choose the method that matches your operating system.
Option 1 — Official convenience script (Linux):
curl -fsSL https://get.docker.com | shThis downloads and runs Docker’s official installation script. It detects your distribution and installs all required dependencies.
Option 2 — Ubuntu / Debian:
sudo apt update
sudo apt install docker.io -yOption 3 — CentOS / RHEL / Fedora:
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io -yOption 4 — macOS (Homebrew):
brew install --cask dockerOption 5 — Windows:
Download Docker Desktop from docs.docker.com/get-docker and run the installer.
Verify installation
docker --versionYou should see output similar to Docker version 24.0.7, build afdd53b.
FAQs
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro