Get Docker Installed (Your Container Engine)ΒΆ
Welcome to your very first hands-on Docker step! Before we can build or run anything, we need Docker itself on your computer.
Think of Docker as a kitchen appliance for software. Once it's installed and switched on, you can take any packaged "meal" (called an image) and heat it up into a running program (called a container) - and it will work the same on your machine as on anyone else's. π±
Right now we're just installing the appliance. We'll start cooking with it in the very next lesson.
This guide covers Windows πͺ, Mac π, and Linux π§. Just pick your tab at each step.
What we will do (in very simple steps)ΒΆ
- Install Docker for your operating system
- Start it up and check it's running
- Prove it works with one tiny command
There are no container concepts to learn today - this lesson is only about getting the appliance plugged in. π
Step 1: Install DockerΒΆ
The easiest way on Windows is Docker Desktop, which runs Docker using WSL 2 behind the scenes (the same WSL you're already using).
- Download Docker Desktop from the official site: docker.com/products/docker-desktop
- Run the installer. When prompted, keep "Use WSL 2 instead of Hyper-V" ticked.
- If it asks you to restart your computer, go ahead and restart.
On Mac, use Docker Desktop.
- Download it from docker.com/products/docker-desktop
- Pick the right chip: Apple Silicon (M1/M2/M3) or Intel. Not sure which you have? Click the Apple menu β About This Mac and look at the "Chip" line.
- Open the downloaded
.dmgfile and drag the Docker whale π³ into your Applications folder.
On Ubuntu/Debian, we install Docker Engine directly. Run these two commands in your terminal:
Then let your user run Docker without typing sudo every time:
Log out and back in (or just close and reopen your terminal) for that last change to take effect.
Step 2: Start Docker and check it's runningΒΆ
Open Docker Desktop from the Start menu. Wait for the whale icon π³ in your system tray (bottom-right of the screen) to stop animating - that means the engine is ready.
Then, in your WSL terminal, check the version:
Open Docker Desktop from Applications. Wait for the whale icon π³ in your menu bar (top-right) to go steady.
Then, in your terminal:
You should see something like this:
The exact numbers will be different for you - any version is fine. Seeing a version number means Docker is installed. β
Step 3: Prove it worksΒΆ
Run this one command:
Docker will download a tiny test image and run it. If everything is working, you'll see a friendly message that begins:
π That's it - Docker is installed and working!
Don't worry about what just happened - we'll pull that apart in the next lesson. Seeing "Hello from Docker!" is the only proof we need today.
β CheckpointΒΆ
Before moving on, make sure both of these worked:
docker --versionprinted a version numberdocker run hello-worldshowed the "Hello from Docker!" message
If both worked, you're ready for the next lesson. If either gave an error, check the common hiccups below.
π©Ή Common hiccupsΒΆ
docker: command not found(Windows/Mac): Docker Desktop probably isn't running, or - on Windows - WSL integration isn't switched on. Open Docker Desktop β Settings β Resources β WSL Integration and enable your Ubuntu distro.permission denied while trying to connect to the Docker daemon(Linux): you likely skipped logging out after theusermodstep. Fully close your terminal and reopen it.Cannot connect to the Docker daemon: the engine isn't started. On Windows/Mac, open Docker Desktop and wait for the whale π³ to settle before trying again.
Next up: Run Your First Container - where we'll run something real and finally explain what a container actually is.