1) Choose your platform
Docker’s official documentation supports Windows, Mac, and Linux. Docker Desktop is the one-click install route for Windows, Mac, and Linux, while Docker Engine is the direct Linux engine route. 1
Windows path
Docker Desktop for Windows is the usual beginner choice, and Docker provides a dedicated Windows install page with download links, system requirements, and install steps. Docker also documents WSL 2 support and notes that mixed Docker installs directly inside WSL distributions can cause conflicts. 2
Mac path
Docker provides a dedicated Mac install page for Docker Desktop, including guidance for Apple silicon and Intel Macs. 3
Ubuntu path
On Ubuntu, you have two mainstream beginner choices: Docker Desktop for Ubuntu or Docker Engine from Docker’s apt repository. Docker’s docs describe both paths. 4
Which should I choose?
2) Install Docker
Docker’s official “Get Docker” docs point users to platform-specific installation routes. Docker Desktop is the easiest route for Windows, Mac, and Linux, while Docker Engine installation pages are the Linux engine route. 5
General beginner path: Docker Desktop
# Check Docker
docker --version
# Check Compose
docker compose version
Windows details
Docker’s Windows install page includes system requirements and step-by-step installation guidance. Docker’s WSL docs also say Docker Desktop should be installed on Windows itself, and that older Docker installations directly inside a WSL distribution can conflict. 6
docker --version
docker run hello-world
Mac details
Docker’s Mac page includes install guidance and distinguishes between Apple silicon and Intel chip downloads. 7
docker --version
docker run hello-world
Ubuntu Desktop details
Docker’s Ubuntu Desktop page recommends setting up Docker’s package repository, downloading the latest DEB package, and installing it with apt. 8
sudo apt-get update
sudo apt install ./docker-desktop-amd64.deb
docker --version
docker run hello-world
Ubuntu Engine details
Docker’s Ubuntu Engine page says Docker Engine is installed through supported methods such as Docker’s apt repository, and notes that conflicting old packages should be removed first. It also documents optional Linux post-install steps such as using Docker as a non-root user. 9
docker --version
sudo docker run hello-world
Do I need Docker Compose separately?
Docker Desktop includes Compose. On Linux Engine paths, Docker documents a Compose plugin installation route if needed. 10
Should I install Docker from random scripts?
For beginners, it is safer to follow the official Docker installation pages for your platform.
3) Run Docker for the first time
The goal of your first Docker session is simple: confirm that Docker is alive and can run a container. The classic test is docker run hello-world. 11
- Make sure Docker Desktop is open, or the Docker service is running.
- Open your terminal.
- Run docker --version.
- Run docker run hello-world.
- If that works, you are ready to learn real Docker usage.
It proves that the Docker engine is reachable.
It proves image download and container start worked.
It proves your install is basically healthy.
docker --version
docker run hello-world
4) Docker at ground zero
Docker helps you package an application together with what it needs to run. Instead of saying, “It works on my machine,” you create a standard package so it behaves more consistently elsewhere.
5) The mental model you must understand
Many beginners confuse Docker, image, container, Dockerfile, and Compose. These are not the same thing.
Docker
The overall platform and tooling for containers.
Click to flip
Remember it like this
Docker is the full system. It is bigger than one container.
Image
A blueprint or packaged template.
Click to flip
Remember it like this
You build an image once and can create multiple containers from it.
Container
A running instance created from an image.
Click to flip
Remember it like this
Image is the blueprint. Container is the running thing.
Dockerfile
A file containing instructions for building an image.
Click to flip
Remember it like this
You do not run a Dockerfile directly. You build from it.
Compose
A way to define and run multi-container applications.
Click to flip
Remember it like this
Use Compose when your app needs multiple connected services.
Registry
A place where images are stored, like Docker Hub.
Click to flip
Remember it like this
You pull images from registries and can push your own there too.
Quick summary:
Docker = the platform
Dockerfile = instructions to build an image
Image = packaged blueprint
Container = running instance from an image
Compose = tool for multi-container apps
6) Your first important Docker commands
Learn the command pattern first. It removes a lot of confusion.
docker --version
Checks Docker installation.
docker pull nginx
Downloads the nginx image.
docker run nginx
Creates and starts a container from nginx.
docker ps
Lists running containers.
docker ps -a
Lists all containers, including stopped ones.
docker stop CONTAINER_ID
Stops a running container.
docker start CONTAINER_ID
Starts an existing container again.
docker images
Lists local images.
7) Dockerfile — the recipe for your image
A Dockerfile is a plain text file that tells Docker how to build your image.
FROM python:3.13
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "app.py"]
FROM chooses a base image.
WORKDIR sets the working folder.
COPY copies files into the image.
RUN executes build-time commands.
CMD sets the default startup command.
Typical build command:
docker build -t myapp:1.0 .
Typical run command:
docker run -p 3000:3000 myapp:1.0
What does -t mean?
It tags the image with a readable name like myapp:1.0.
What does -p 3000:3000 mean?
It maps a host port to a container port.
8) Docker Compose — when one container is not enough
Real applications often need multiple services such as a web app and a database. Compose lets you define and run them together. Docker documents Compose as the way to define and run multi-container applications. 12
services:
web:
build: .
ports:
- "3000:3000"
depends_on:
- db
db:
image: postgres:16
environment:
POSTGRES_PASSWORD: secret
You start related services together.
You stop them together.
Your team gets a shared local environment.
Useful Compose commands:
docker compose up
docker compose up --build
docker compose down
docker compose ps
docker compose logs
9) A real beginner workflow
Here is a simple workflow that works for many small projects.
10) Common beginner mistakes
11) Quick quiz
Try this without looking back first.