Originally published on CodingCush.

To install Docker, you download Docker Desktop on Windows or Mac and run the installer, or you install Docker Engine on Linux using your distribution's package commands, then you verify everything works by running docker --version and docker run hello-world in a terminal. The whole job takes about ten to twenty minutes. This guide walks through each system step by step, so you finish with Docker actually running, not just installed and sulking quietly in a corner.

What You Need Before You Start

Docker runs containers, which are small, isolated packages that hold an app and everything it needs. Your computer needs a few basics to run them well. On Windows, you need a 64-bit version of Windows 10 or Windows 11, at least 4 GB of RAM, and virtualisation enabled in your BIOS or UEFI settings. Docker Desktop on Windows also uses WSL 2, Microsoft's built-in Linux layer, and the installer can set that up for you.

On a Mac, you need macOS on a reasonably recent machine, with 4 GB of RAM or more. One important detail: Macs come with two kinds of chip. Older Macs use Intel chips, and newer ones use Apple silicon, the M1, M2, M3 and later chips. Docker offers a different download for each, so check which chip you have under the Apple menu, in About This Mac, before downloading.

On Linux, you need a 64-bit distribution such as Ubuntu, Debian or Fedora, a user account that can use sudo, and an internet connection. The steps below use Ubuntu. If containers are still new to you, start with our explainer on what Docker is and how it works, then come back here with the idea clear in your head.

The Docker Docs Get Started overview page on docs.docker.com explaining what Docker is

The Docker Docs Get Started overview (docs.docker.com) — the official starting point before you install Docker on any system.

How to Install Docker on Windows

Step 1: Go to the official Docker website and download Docker Desktop for Windows. Only download it from Docker itself, not from a random software site.

Step 2: Run the downloaded installer. When it asks about WSL 2, leave the option to use WSL 2 switched on. This is the setting beginners most often untick by accident, and Docker really wants it on.

Step 3: Follow the prompts, then restart your computer when the installer asks. The restart is not optional decoration; Windows needs it to finish setting up the Linux layer.

Step 4: Open Docker Desktop from the Start menu and wait until it says it is running. The first start can take a minute or two.

Step 5: Open PowerShell or Windows Terminal and run the verification commands shown later in this guide. If they work, your Windows install is done.

How to Install Docker on Mac

Step 1: Download Docker Desktop for Mac, choosing the version for your chip, Intel or Apple silicon, as explained above.

Step 2: Open the downloaded file and drag the Docker icon into your Applications folder, just like a normal Mac app.

Step 3: Launch Docker from Applications. macOS may ask for your password. Accept the prompts, because Docker needs permission to set up its background service.

Step 4: Wait for Docker Desktop to finish starting. When its menu bar icon settles and the dashboard says everything is running, open Terminal and run the verification commands below.

How to Install Docker on Linux (Ubuntu)

On Linux there is no Docker Desktop requirement for most beginners. You install Docker Engine directly, using the terminal. The official Get Docker page lists every supported system, and the Ubuntu commands below follow Docker's recommended repository method, which keeps Docker updated through your normal system updates.

# Remove any old Docker packages (safe if none are installed) sudo apt-get remove docker docker-engine docker.io containerd runc # Update packages and install tools needed for the download sudo apt-get update sudo apt-get install ca-certificates curl gnupg # Add Docker's official GPG key sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # Add the Docker repository echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker Engine and Compose sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Let your user run Docker without sudo every time sudo usermod -aG docker $USER 

After the last command, log out and back in once, so your new group permission applies. The commands look long, but take them one block at a time: each has a single clear job.

Install Routes Compared

System What you install How Good to know
Windows Docker Desktop Graphical installer Needs WSL 2 and a restart
Mac Docker Desktop Drag app to Applications Pick Intel or Apple silicon download
Linux (Ubuntu) Docker Engine Terminal commands No desktop app needed; add your user to the docker group

Whichever route you took, the result is the same: the docker command works in your terminal, and you can run containers. The friendly Docker Get Started guide is a good next read once your install passes the checks below.

Verify Your Install Works

Never trust an installer that simply says "finished". Test Docker with two quick commands. Open your terminal, PowerShell on Windows, Terminal on Mac, or your usual Linux terminal, and run:

docker --version docker run hello-world 

The first command should print a version line, something like Docker version 27.x. That proves the command line tool is installed. The second command does much more: Docker downloads a tiny test image called hello-world, creates a container from it, and the container prints a message saying your installation appears to be working correctly. If you see that message, congratulations, Docker is genuinely running on your machine. You can also try docker ps to list running containers; an empty list is perfectly healthy.

Common Problems and Simple Fixes

Windows says virtualisation is not enabled. Restart your computer, enter the BIOS or UEFI settings, and switch on the option named Virtualization, VT-x or SVM Mode. Save and exit, then start Docker Desktop again. On many laptops this one setting is the whole problem.

Windows complains about WSL 2. Open PowerShell as an administrator and run wsl --install, then restart. After that, run wsl --set-default-version 2 so new Linux setups use version 2, which Docker Desktop expects.

Docker Desktop stays on "starting" forever. Give it two full minutes first. If it still will not start, quit it completely, restart your computer, and open it again before opening other heavy apps. On Windows, also check that WSL is updated with wsl --update.

Linux says permission denied. If docker run hello-world fails with a permission message about the Docker socket, you probably skipped the usermod step or have not logged out since running it. Log out, log back in, and try again.

The hello-world download fails. That is almost always a network problem, a proxy, or a firewall blocking the download. Check your internet connection, disconnect from a VPN if you use one, and try again.

What to Do After Installing

With Docker working, learn a few everyday commands first: docker ps, docker images, docker stop and docker rm will carry you far. Our Docker commands cheat sheet for beginners keeps them all in one place for quick reference. Then run one real container, such as a local web server, and open it in your browser. That small success teaches more than an hour of reading.

Frequently Asked Questions

Is Docker free to install and use?

Docker Engine on Linux is free. Docker Desktop is free for personal use, education, and small businesses, while larger companies may need a paid subscription. Check Docker's current terms if you plan to use it at work.

Do I need Docker Desktop on Linux?

No. Most Linux users install Docker Engine directly, as this guide shows. Docker Desktop for Linux exists, but the Engine plus the terminal is the normal, lightweight setup and does everything beginners need.

Why does Docker need virtualisation or WSL 2 on Windows?

Containers share a Linux kernel, so on Windows and Mac Docker runs a small Linux environment behind the scenes. Virtualisation and WSL 2 provide that environment. On Linux, Docker uses the system kernel directly, so no extra layer is needed.

How do I uninstall Docker if something goes wrong?

On Windows and Mac, uninstall Docker Desktop like any other app, then reinstall a fresh copy. On Ubuntu, remove the packages with sudo apt-get purge docker-ce docker-ce-cli containerd.io and install again following the steps above.

Conclusion

Installing Docker is a one-time setup: Docker Desktop on Windows and Mac, Docker Engine on Linux, and two small commands to prove it works. Fix the usual suspects, WSL 2, virtualisation and permissions, and almost every install problem disappears. From here, run containers freely, break things safely, and learn by doing. That is exactly what Docker is for.