Skip to content

Installing Docker

The quickest way on Ubuntu or Debian is Dockerโ€™s convenience script. Read it before you run it โ€” thatโ€™s a good habit for any script piped from the internet.

Terminal window
curl -fsSL https://get.docker.com -o get-docker.sh
less get-docker.sh # read what it does
sudo sh get-docker.sh
sudo usermod -aG docker "$USER" # run docker without sudo (log out and back in)

Install Docker Desktop from docker.com. It runs a small Linux VM behind the scenes, because containers need a Linux kernel.

Terminal window
docker run hello-world

You should see Hello from Docker!. Behind that message, Docker looked for the image locally, pulled it from Docker Hub, created a container and ran it.

Check your understanding

1. Which command checks that Docker can pull and run an image?