Docker
Learn Docker from scratch: containers and images, the everyday docker commands, writing Dockerfiles, ports and networks, volumes, configuration, Docker Compose, multi-stage builds, debugging, registries and production best practices — in 14 hands-on lessons.
Start Learning →What Is Docker?
Docker packages an application together with everything it needs — runtime, libraries, tools and settings — into an image, and runs that image as an isolated container. The same image runs identically on your laptop, a test server and the cloud, which ends the “it works on my machine” problem for good.
Containers are much lighter than virtual machines: they share the host’s kernel, start in under a second and are measured in megabytes. That is why Docker has become a standard part of development, testing and deployment, and the foundation of Kubernetes.
The commands in this course were run with Docker Engine 29.9, and the output boxes show what the terminal printed. You follow Priya as she containerises her own Python API, runs it with Redis and PostgreSQL, and makes it production-ready.
Where Is Docker Used?
Development
Start databases, caches and other services with one command instead of installing them on your computer.
CI/CD
Build and test every change in a clean, identical environment, then ship the exact image that passed.
Cloud & Servers
Every major cloud runs containers, from a single server with Compose to managed container platforms.
Microservices & Kubernetes
Each service lives in its own container image — the same images Kubernetes runs at scale.
Why Learn Docker?
Career
- Expected in DevOps, cloud and backend roles
- A common topic in technical interviews
- The first step towards Kubernetes
- Useful in every programming language
Productivity
- Set up a full development environment in minutes
- Run several versions of a tool side by side
- Remove anything cleanly when you are done
- Share a working setup with your team in one file
Reliability
- The same image in development, testing and production
- Versioned images make rollbacks instant
- Restart policies and health checks keep services up
- Configuration kept separate from code
Universal
- Runs on Windows, macOS and Linux
- Thousands of ready-made official images
- Works with any language or framework
- Free and open source at its core
Code Example
One command downloads the Nginx web server and runs it in the background, reachable on port 8080 of your computer:
docker run -d --name web -p 8080:80 nginx:alpinedocker psClick Run to see what this code prints.
-d runs the container in the background, --name gives it a name, and -p 8080:80 forwards port 8080 on your computer to port 80 inside the container. docker ps lists it as Up. Lesson 3 explains every part.
Essential Docker Commands
| Command | What it does |
|---|---|
| docker run -d -p 8080:80 --name web nginx | Create and start a container in the background |
| docker ps / docker ps -a | List running / all containers |
| docker logs -f web | Follow a container’s output |
| docker exec -it web sh | Open a shell inside a running container |
| docker stop web / docker rm -f web | Stop / remove a container |
| docker images / docker pull nginx:alpine | List / download images |
| docker build -t myapp:1.0 . | Build an image from a Dockerfile |
| docker volume create data / -v data:/path | Create / mount a volume that keeps data |
| docker network create appnet | Create a network so containers find each other by name |
| docker compose up -d / down | Start / stop a multi-container app |
| docker push user/myapp:1.0 | Publish an image to a registry |
| docker system prune | Clean up unused containers, networks and images |
Course Curriculum
Follow these 14 lessons in order. Lessons 1–4 cover the basics and everyday commands, lessons 5–6 building your own images, lessons 7–10 networking, data, configuration and Compose, and lessons 11–14 smaller images, debugging, registries and production.
You should be comfortable typing commands in a terminal. If you are new to the command line, take the Linux & Command Line course first — most containers are Linux inside.
Projects You'll Build
Put your Docker skills to work with these hands-on projects — each one is a complete, step-by-step tutorial:
Production-Ready Static Website with Nginx
Package a portfolio site into a small Nginx image with clean URLs, a custom 404, compression, caching, a health check, and painless updates and rollbacks.
Multi-Service Deployment with a Caddy Reverse Proxy
Run a website and an API behind one Caddy reverse proxy with Docker Compose, update services independently, and go live with automatic HTTPS.
Frequently Asked Questions
Yes. Every lesson and project is free, with no sign-up. Docker Engine is free and open source, and Docker Desktop is free for personal use, education and small businesses.
No. Docker Desktop runs on Windows and macOS. Basic Linux command-line skills help, because you will use Linux commands inside containers.
None in particular. The examples use a small Python app and a tiny Go program, but the code is provided and explained — the focus is on Docker.
Yes. Lesson 10 covers Compose in depth, and the reverse-proxy project uses it for a realistic multi-service deployment.
CI/CD to build and publish images automatically, a cloud platform to run them, and Kubernetes to run containers across many servers.
Key Takeaways & Summary
- Docker packages apps into images and runs them as lightweight, isolated containers.
- You will master the everyday commands: run, ps, logs, exec, stop, images, build and more.
- You will write Dockerfiles, connect containers with networks and keep data in volumes.
- You will run multi-container apps with Docker Compose and build small multi-stage images.
- You will debug containers, publish images to registries and make them production-ready.
Begin with Lesson 1, then install Docker and type along — running the commands yourself is the fastest way to make containers feel natural.