Skip to main content
Free courses · 25 lessons

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.

By Matthews WongReviewed on

Key takeaway

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.

Start the course

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.
Where should I start?

Five questions to find your starting lesson

Already know some of this? Answer five questions from across the course and get a lesson to start at. It is only a suggestion: every lesson stays open.

  1. 1.A teammate SSHes into the VPS and changes a value in the server's .env by hand. What happens to that change at the next push to main?
  2. 2.To stop stale builds piling up, you put the whole workflow in one concurrency group with cancel-in-progress: true. What new risk did you add?
  3. 3.A team adds Cache-Control: no-cache to a page showing account data, expecting nothing to be stored. What is actually true?
  4. 4.Two Compose services, api and db, share the project network. db is published as 5433:5432. Which address should api use?
  5. 5.GitHub's reference says if: !cancelled() must be wrapped in ${{ }} or quoted. Why?
Lessons

DevOps from zero

  1. DevOps Pipeline Explained: From Git Push to ProductionA 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.10 min
  2. SSH for Beginners: Log In to a Linux Server With a KeySSH 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.12 min
  3. Docker Tutorial for Beginners: Image, Container, DockerfileLearn 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.11 min
  4. Docker Multi-Stage Build: Shrink a Real Next.js ImageLearn 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.12 min
  5. Docker Compose in Production: Limits, Health, RestartsRun 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.13 min
  6. GitHub Actions Deploy to VPS: Build, Push to GHCR, SSHDeploy 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.14 min
  7. Nginx Reverse Proxy With Docker Compose, Behind CloudflarePut 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.13 min
  8. Monitoring Docker Containers: Uptime, Rollback and BackupsLearn 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.12 min
  9. Speed Up Docker Builds in GitHub Actions: A Cache GuideSpeed 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.13 min
  10. Docker Env Vars and Secrets: Build Time vs RuntimeLearn 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.13 min
  11. HTTP Cache-Control Headers Explained on a Real Next.js SiteLearn 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 min
  12. Docker Container Hardening: Non-Root, Small Image, ScanningHarden a Docker container step by step: non-root user, minimal base image, loopback ports, resource caps and CVE scanning, checked against a real setup.12 min
  13. Docker Logs for Beginners: Read, Cap and Rotate LogsLearn 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.12 min
  14. GitHub Actions Quality Gates: Check Before You DeployLearn CI quality gates from a real workflow: typecheck, lint, tests and build, job dependencies with needs, fail-fast order, and branch protection.12 min
  15. Docker No Space Left on Device: Find What Fills the DiskFix 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.12 min
  16. Docker Networking Explained: Bridges, DNS, Ports and ufwDocker networking explained: user-defined bridges, container names via Docker's DNS, published ports, why ufw misses them, and localhost in a container.13 min
  17. DNS Records Explained: A, CNAME, MX, TXT, TTL and the ProxyDNS 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.13 min
  18. How SMTP Works: Ports, MX Lookup, SPF, DKIM and DMARCHow 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.15 min
  19. Docker Swarm Tutorial: Services, Routing Mesh, Rolling UpdatesA Docker Swarm tutorial for beginners: managers and Raft, services and replicas, the routing mesh, rolling updates, and a real Compose file as a stack.15 min
  20. Docker Volume vs Bind Mount: Where Container Data LivesDocker 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.14 min
  21. YAML Tutorial for Beginners: Maps, Lists, Quotes and TrapsYAML tutorial for beginners: maps, lists, indentation, multi-line strings and quoting, plus the traps that turn on, NO and 3.10 into other values.15 min
  22. Linux File Permissions Explained: ls -l, chmod, chown, umaskLinux 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.15 min
  23. Docker Healthcheck Tutorial: Health States and Restart PoliciesDocker healthcheck tutorial: write one, read starting, healthy and unhealthy, gate a deploy with --wait, and see why restart policies ignore health.14 min
  24. GitHub Actions Secrets Tutorial: Variables, Scopes and ForksGitHub Actions secrets tutorial: secrets vs variables, repository and environment scope, log masking and its limits, fork pull requests and GITHUB_TOKEN.14 min
  25. Nginx 502 Bad Gateway in Docker: Read the Log, Fix the CauseFix 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.14 min
Course check

10 questions from across the course

One question from each part of the course, in order. Get 8 of 10 right and you have its core. Every answer links to the lesson that teaches it, and nothing is locked either way.

  1. 1.A teammate SSHes into the VPS and changes a value in the server's .env by hand. What happens to that change at the next push to main?
  2. 2.There is no .dockerignore, and an .env file slipped into the project. The Dockerfile runs COPY . . and then RUN rm .env. Is the secret out of the image?
  3. 3.A GITHUB_TOKEN value ends up in an old job's log. Could someone use it next week to push images to ghcr.io?
  4. 4.Your server runs whatever :latest points at. A bad push goes out, and you want the previous release back. What is the problem?
  5. 5.Why does next.config.ts send the one-year immutable header for /_next/static only when NODE_ENV is production?
  6. 6.You edit daemon.json to make journald the default driver and restart Docker. What happens to a container that was running before?
  7. 7.Two Compose services, api and db, share the project network. db is published as 5433:5432. Which address should api use?
  8. 8.A contact form sends with From set to the visitor's yahoo.com address, through your own provider. What is the likely result?
  9. 9.This site's compose file has - "127.0.0.1:${APP_PORT:-3002}:3000". What turns ${APP_PORT:-3002} into 3002?
  10. 10.This site's check has interval: 30s and start_period: 20s, and no start_interval. When does the first check run after the container starts?