# DevOps From Scratch: Free Course Built on a Real Pipeline

> A free DevOps course for beginners, built on the real pipeline behind this website: Docker, GitHub Actions, a VPS, nginx, Cloudflare and monitoring.

URL: https://www.matthewswong.com/en/learn/devops-from-zero/

Reviewed on 13 October 2026 · By Matthews Wong (https://www.matthewswong.com/en/about/)

> DevOps is the practice of getting code from a laptop to production reliably, and keeping it running. This free course teaches it on one real system, the pipeline that deploys this website: a Docker image, a GitHub Actions workflow, a single VPS, nginx and Cloudflare in front, and the monitoring that tells you when it breaks.

Free, no sign-up, no certificate. Built from the setup that runs this website.

## What you will be able to do

- Explain every hop between git push and a page in a visitor's browser.
- Build small, cache-friendly Docker images and run them safely with Compose.
- Write a GitHub Actions pipeline that tests, builds, pushes and deploys to a VPS.
- Put nginx and Cloudflare in front, watch the service, and roll back a bad release.

## Who it is for

Web developers who can build an app locally but have never deployed one themselves, and anyone who wants to understand what a deploy pipeline actually does.

## Before you start

- Comfortable with a terminal and git (clone, commit, push).
- Docker Desktop or Docker Engine installed. Every exercise runs locally, with no paid service.

## Lessons

1. [DevOps Pipeline Explained: From Git Push to Production](https://www.matthewswong.com/en/learn/devops-from-zero/devops-pipeline-explained/): A DevOps pipeline explained on a real site: how one git push is checked, built into a Docker image, run on a VPS and served through nginx and Cloudflare.
2. [SSH for Beginners: Log In to a Linux Server With a Key](https://www.matthewswong.com/en/learn/devops-from-zero/linux-server-ssh-for-beginners/): SSH for beginners: make an Ed25519 key, log in to a Linux server without a password, open only ports 22, 80 and 443, and avoid the Cloudflare SSH trap.
3. [Docker Tutorial for Beginners: Image, Container, Dockerfile](https://www.matthewswong.com/en/learn/devops-from-zero/docker-tutorial-for-beginners/): Learn Docker from a real Dockerfile: what an image and a container are, how layers and the build cache work, and how to order instructions for fast builds.
4. [Docker Multi-Stage Build: Shrink a Real Next.js Image](https://www.matthewswong.com/en/learn/devops-from-zero/docker-multi-stage-build/): Learn the Docker multi-stage build from a real Dockerfile: named stages, COPY --from, a non-root user, --target, and why only the final stage ships.
5. [Docker Compose in Production: Limits, Health, Restarts](https://www.matthewswong.com/en/learn/devops-from-zero/docker-compose-production/): Run Docker Compose in production safely: a restart policy, a memory limit paired with Node's heap cap, a health check, and a port bound to localhost.
6. [GitHub Actions Deploy to VPS: Build, Push to GHCR, SSH](https://www.matthewswong.com/en/learn/devops-from-zero/github-actions-deploy-to-vps/): Deploy to a VPS with GitHub Actions the way this site does: a verify gate, an image pushed to GHCR, then SSH and Docker Compose, with secrets kept safe.
7. [Nginx Reverse Proxy With Docker Compose, Behind Cloudflare](https://www.matthewswong.com/en/learn/devops-from-zero/nginx-reverse-proxy-cloudflare/): Put nginx in front of a Docker Compose app and Cloudflare in front of nginx, then decide header by header what the edge may cache and what it never should.
8. [Monitoring Docker Containers: Uptime, Rollback and Backups](https://www.matthewswong.com/en/learn/devops-from-zero/monitoring-rollback-backups/): Learn what to watch on a Docker server and why: health checks, uptime checks and metrics. Then roll back a broken release by its tag and test a backup.
9. [Speed Up Docker Builds in GitHub Actions: A Cache Guide](https://www.matthewswong.com/en/learn/devops-from-zero/speed-up-docker-builds-github-actions/): Speed up Docker builds in GitHub Actions: export layers with cache-to type=gha, know when a cache mount fails, and restore tool caches with actions/cache.
10. [Docker Env Vars and Secrets: Build Time vs Runtime](https://www.matthewswong.com/en/learn/devops-from-zero/docker-env-vars-and-secrets/): Learn how env vars and secrets work in a Docker deploy: build time vs runtime, GitHub secrets, env_file, and why ENV and ARG must never hold a secret.
11. [HTTP Cache-Control Headers Explained on a Real Next.js Site](https://www.matthewswong.com/en/learn/devops-from-zero/http-cache-control-headers-explained/): Learn HTTP Cache-Control headers from a real next.config.ts: max-age, immutable, no-cache vs no-store, ETag and 304, and how Cloudflare reads them.
12. [Docker Container Hardening: Non-Root, Small Image, Scanning](https://www.matthewswong.com/en/learn/devops-from-zero/docker-container-hardening-basics/): Harden a Docker container step by step: non-root user, minimal base image, loopback ports, resource caps and CVE scanning, checked against a real setup.
13. [Docker Logs for Beginners: Read, Cap and Rotate Logs](https://www.matthewswong.com/en/learn/devops-from-zero/docker-logs-for-beginners/): Learn docker logs from a real Compose file: stdout and stderr, the json-file and journald drivers, max-size rotation, and reading logs when a deploy fails.
14. [GitHub Actions Quality Gates: Check Before You Deploy](https://www.matthewswong.com/en/learn/devops-from-zero/github-actions-quality-gates/): Learn CI quality gates from a real workflow: typecheck, lint, tests and build, job dependencies with needs, fail-fast order, and branch protection.
15. [Docker No Space Left on Device: Find What Fills the Disk](https://www.matthewswong.com/en/learn/devops-from-zero/docker-no-space-left-on-device/): Fix Docker's no space left on device: read docker system df, prune images and build cache by age, keep the newest N images, cap logs and the journal.
16. [Docker Networking Explained: Bridges, DNS, Ports and ufw](https://www.matthewswong.com/en/learn/devops-from-zero/docker-networking-explained/): Docker networking explained: user-defined bridges, container names via Docker's DNS, published ports, why ufw misses them, and localhost in a container.
17. [DNS Records Explained: A, CNAME, MX, TXT, TTL and the Proxy](https://www.matthewswong.com/en/learn/devops-from-zero/dns-records-explained/): DNS records explained: trace a lookup from resolver to authoritative server, learn A, CNAME, MX, TXT, NS and CAA, what TTL caches and what proxying does.
18. [How SMTP Works: Ports, MX Lookup, SPF, DKIM and DMARC](https://www.matthewswong.com/en/learn/devops-from-zero/how-smtp-works-spf-dkim-dmarc/): How SMTP works, step by step: the EHLO to DATA dialogue, ports 25, 587 and 465, the MX lookup, and how SPF, DKIM and DMARC decide if your email lands.
19. [Docker Swarm Tutorial: Services, Routing Mesh, Rolling Updates](https://www.matthewswong.com/en/learn/devops-from-zero/docker-swarm-tutorial/): A Docker Swarm tutorial for beginners: managers and Raft, services and replicas, the routing mesh, rolling updates, and a real Compose file as a stack.
20. [Docker Volume vs Bind Mount: Where Container Data Lives](https://www.matthewswong.com/en/learn/devops-from-zero/docker-volumes-vs-bind-mounts/): Docker volume vs bind mount explained: where container data lives, how a new volume is filled from the image, who owns the files, and what down -v deletes.
21. [YAML Tutorial for Beginners: Maps, Lists, Quotes and Traps](https://www.matthewswong.com/en/learn/devops-from-zero/yaml-tutorial-for-beginners/): YAML tutorial for beginners: maps, lists, indentation, multi-line strings and quoting, plus the traps that turn on, NO and 3.10 into other values.
22. [Linux File Permissions Explained: ls -l, chmod, chown, umask](https://www.matthewswong.com/en/learn/devops-from-zero/linux-file-permissions-explained/): Linux file permissions explained: read ls -l, r/w/x on files and folders, octal 600/644/755, chmod, chown, umask, and the uid a container writes as.
23. [Docker Healthcheck Tutorial: Health States and Restart Policies](https://www.matthewswong.com/en/learn/devops-from-zero/docker-healthcheck-restart-policy/): Docker healthcheck tutorial: write one, read starting, healthy and unhealthy, gate a deploy with --wait, and see why restart policies ignore health.
24. [GitHub Actions Secrets Tutorial: Variables, Scopes and Forks](https://www.matthewswong.com/en/learn/devops-from-zero/github-actions-secrets-and-variables/): GitHub Actions secrets tutorial: secrets vs variables, repository and environment scope, log masking and its limits, fork pull requests and GITHUB_TOKEN.
25. [Nginx 502 Bad Gateway in Docker: Read the Log, Fix the Cause](https://www.matthewswong.com/en/learn/devops-from-zero/nginx-502-bad-gateway-docker/): Fix nginx 502 Bad Gateway with Docker: read the error log, tell 502 from 503 and 504, check the causes in order of likelihood, and decode Cloudflare's 5xx.

---

- HTML version: https://www.matthewswong.com/en/learn/devops-from-zero/
- Bahasa Indonesia: https://www.matthewswong.com/id/learn/devops-from-zero/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
