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.
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.
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.