Skip to content
docker: command not found

docker: command not found

DodaTech 2 min read

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 | sh

This 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 -y

Option 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 -y

Option 4 — macOS (Homebrew):

brew install --cask docker

Option 5 — Windows:

Download Docker Desktop from docs.docker.com/get-docker and run the installer.

Verify installation

docker --version

You should see output similar to Docker version 24.0.7, build afdd53b.

FAQs

Do I need root access to install Docker?
Yes. Installing Docker requires sudo privileges on Linux. On macOS and Windows, Docker Desktop runs as a user application but still requires admin credentials during installation.
What if 'docker --version' still fails after install?
Log out and log back in, or restart your terminal session. The installer may have modified your PATH and you need a new shell session to pick it up.
Is the get.docker.com script safe?
Yes. It is maintained by Docker Inc. and is the recommended installation method for Linux. You can review the script at github.com/docker/docker-install before running it.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro