The common core: everyone starts here
What is a VPS?
Hotel, empty flat or Airbnb? Shared hosting, VPS, PaaS: pick the right level of control, the right provider, the right size — and your first SSH login.
Hardening your VPS
Bots hit your IP from minute one. The 5 moves that lock the door: deploy user, SSH keys, ufw, fail2ban, automatic updates.
systemd, the caretaker
Your Messenger worker must survive a 3 a.m. crash and a reboot. One .service file, Restart=always, and journalctl to read what happened.
Then two paths, one destination
Both cover HTTPS, deploys, a way back and backups. At the end of lesson 3 you choose. Undecided? The by-hand path is shorter, and what you learn there stays true afterwards.
🐳 Docker path · 6 lessons · 63 min
Reproducible and automated: Compose, GitHub Actions CI, git push = live.
Docker Compose on a VPS
End "works on my machine": your Symfony app packaged with FrankenPHP, its database and its workers in a single compose.yml recipe.
Automatic HTTPS with Caddy
A domain on HTTPS with nothing more to install: FrankenPHP embeds Caddy. SERVER_NAME, a volume for the certificates, and the ACME mechanism explained.
The CI pipeline
On every push, GitHub tests (PHPUnit, composer audit) then builds your image and pushes it to GHCR, tagged by commit. Red blocks everything.
Deploying automatically
git push = live: the VPS pulls the finished image (pull, up -d --wait), runs the Doctrine migrations and restarts the workers. Dedicated SSH key, secrets.
Robustness and rollback
A broken deploy is fixed in 15 seconds: every commit has its sha-tagged image, rollback = re-point a tag. And the migrations trap.
Backups and monitoring
The minimum that saves you: database dump from the container + off-site rclone copy, volumes, an UptimeRobot alert. And step 2: FrankenPHP worker mode.
🧰 By-hand path · 4 lessons · 43 min
Simple and readable: apt, Caddy, a deploy script, cron.
Installing the stack by hand
No Docker: PHP-FPM, PostgreSQL and Composer installed with apt, your code cloned into /opt/app, the database created, migrations run. The Sunday you just want it to work.
HTTPS with Caddy and PHP-FPM
A domain, a 5-line Caddyfile and the Let's Encrypt certificate looks after itself. The public/ folder trap, and the ACME mechanism explained.
Deploying with a script
A deploy.sh that always does the same steps in the same order, run over SSH. And the way back: run the script again on the previous commit.
Backups and monitoring
pg_dump by cron, an off-site copy with rclone, a restore actually tested, and an external alert that tells you before your users do.
What you will learn
Harden a VPS in 5 moves: deploy user, SSH keys, firewall, fail2ban, auto-updates
Run an app that survives crashes and reboots (systemd, Docker Compose) with automatic HTTPS (Caddy)
Set up automated deployment: git push → tests → SSH → healthcheck, with secrets handled properly
Make the system robust: atomic switch, one-command rollback, off-site backups, downtime alerts
Prerequisites: being comfortable with the terminal and Git (see the Git & terminal course). The Testing your code course is the ideal companion: your tests are what will block a bad deploy. Every command is practiced here in a simulated terminal — no server to pay for to follow the course.