Docker command not found on Mac - 2023 solution

Docker command not found on Mac - 2023 solution

If you are getting a "docker command not found" error on a Mac, it means that the Docker command is not available in your current shell. This can happen if Docker has not been installed on your computer or if the Docker command is not in your shell's PATH environment variable.

To fix this issue, you have a few options:

  1. Install Docker on your Mac if it is not already installed. You can download Docker from the Docker website and follow the instructions to install it on your computer.

  2. If Docker is already installed on your Mac, but you are still getting the "docker command not found" error, the Docker command is likely not in your shell's PATH environment variable. To fix this, you can add the path to the Docker binary to your PATH environment variable. On a Mac, the Docker binary is typically located at /usr/local/bin/docker. To add this to your PATH environment variable, you can use the following command:

export PATH=$PATH:/usr/local/bin/docker
  1. This will add the /usr/local/bin/docker directory to your PATH environment variable, allowing the docker command to be found in your shell.

  2. If you are still having trouble running the docker command after trying the above steps, you can try running the docker command with the full path to the Docker binary. On a Mac, the full path to the Docker binary is typical/usr/local/bin/docker. So you can try running the docker command like this:

/usr/local/bin/docker [options] [command] [arguments]

This will tell your shell to use the Docker binary at the specified path, allowing you to run the docker command even if it is not in your PATH environment variable.

Related articles

Ruslan Osipov
Written by author: Ruslan Osipov