docker command not found

In this troubleshooting guide we learn how to fix docker command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

docker: command not found

or when using sudo you get the following error message

sudo: docker: command not found

Solutions to docker: command not found

How To Fix docker: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu docker is provided by podman-docker package.

podman-docker is:

Podman is an engine for running OCI-based containers in Pods. Podman provides a CLI interface for managing Pods, Containers, and Container Images.

At a high level, the scope of libpod and podman is the following:

  • Support multiple image formats including the OCI and Docker image formats.
  • Support for multiple means to download images including trust & image verification.
  • Container image management (managing image layers, overlay filesystems, etc).
  • Full management of container lifecycle.
  • Support for pods to manage groups of containers together.
  • Resource isolation of containers and pods.
  • Support for a Docker-compatible CLI interface through Podman.

Podman is a daemon-less alternative to Docker.

This package installs a wrapper script that acts like the original docker implementation

To fix this problem, we can install more using the command below.

sudo apt-get -y install podman-docker

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install podman-docker.

sudo apt -y install podman-docker

Or if you have aptitude installed you can use the following command.

sudo aptitude install podman-docker

Summary

In this tutorial we learn how to fix docker command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.