Docker and Kubernetes course menu
How to Install Docker on Windows, Mac and Linux
Install Docker Desktop on Windows and macOS or Docker Engine on Ubuntu, run Docker without sudo, check the installation, and fix common setup problems.
On this page
Windows#
- Install WSL if you do not have it.
- Download Docker Desktop and install it, leaving the Use WSL 2 option on.
- Start Docker Desktop, and wait for it to say that the engine is running.
Run the commands in this course from Ubuntu (WSL), PowerShell or Git Bash.
macOS#
Download Docker Desktop for your chip (Apple silicon or Intel), drag it to Applications, and start it.
Linux#
On a server, install Docker Engine. On Ubuntu, Docker's convenience script is the quickest way for a test machine:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.shDocker's install guide shows the manual steps, which are better for production.
Run Docker without sudo#
On Linux, add your user to the docker group, then log out and in again:
sudo usermod -aG docker $USERCheck the installation#
docker --version
docker compose versionDocker version 28.0.4, build b8034c0
Docker Compose version v2.38.2Your versions may be newer. Everything in this course should work with any recent version.
Now run a test container:
docker run --rm hello-world | head -n 4Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
Digest: sha256:c567b231f65614688711a75f31518a064258a51d442117a3e771a3a8fdba78ef
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.If you see "Hello from Docker!", everything works. You will learn what happened in the next lesson.
How Docker works#
docker is a client. It sends your commands to the Docker daemon, a background service that does the work. This command shows both:
docker info --format 'Server version {{.ServerVersion}}, storage driver {{.Driver}}'Server version 28.0.4, storage driver overlay2Common errors#
Key takeaway#
Next: Running Your First Container.
Finished this lesson?
Related lessons
Recommended Docker and Kubernetes resources
- Docker Deep Dive by Nigel Poulton
A practical guide to how Docker works, for readers who have finished the basics.
Some links are affiliate links. If you buy through them, Laviyx Learn may earn a commission at no extra cost to you. As an Amazon Associate, we earn from qualifying purchases.