SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. Caddy
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

Caddy cheatsheet

Service and config

CommandDescription
systemctl status caddyService status
systemctl reload caddyReload config (graceful)
caddy validate --config /etc/caddy/CaddyfileTest config syntax
caddy fmt --overwrite /etc/caddy/CaddyfileFormat Caddyfile
caddy run --config /etc/caddy/CaddyfileRun in foreground (debug)
caddy reload --config /etc/caddy/CaddyfileReload without systemd

Logs and inspection

CommandDescription
journalctl -u caddy -fFollow Caddy logs
journalctl -u caddy -n 100 --no-pagerLast 100 log lines
ss -tlnp | grep caddyCheck listening ports
curl -vI https://example.comTest HTTPS response
curl -v http://127.0.0.1:8080Test upstream directly

TLS and certificates

Command / pathDescription
ls /var/lib/caddy/.local/share/caddy/certificates/Stored ACME certs (default data dir)
openssl s_client -connect example.com:443Inspect TLS cert from client
dig +short example.comConfirm DNS points to server

Reverse proxy site block

api.example.com { reverse_proxy 127.0.0.1:8000 encode gzip }

Static files with path routing

example.com { root * /var/www/example route /api/* { reverse_proxy 127.0.0.1:8000 } file_server }

Disable automatic HTTPS (internal / dev)

http://internal.local { tls internal reverse_proxy 127.0.0.1:3000 }

Pro tips

  • Always caddy validate before reload — bad config can stop the server
  • Test upstreams directly with curl before blaming Caddy for 502 errors
  • Automatic HTTPS needs public DNS — use http:// or tls internal for local dev
  • Use caddy fmt to catch indentation and brace errors early

Practice scenarios

Hands-on Caddy scenarios on live Linux VMs: caddy

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a