Hands-on guide series
Deploying an App on a VPS: A Hands-On Guide
A four-part, hands-on guide to getting an app onto a server the right way: behind nginx, running under systemd, served over HTTPS, and deployed with zero downtime. Every command tested on a live server.
What you will build
Security is layers, not a switch. Each part closes a different category of attack, from the automated sweep that finds a brand-new server, to the day one gets in anyway. Read them in order, or jump to what you need.
- 1
An App Behind nginxNever put your app on the public internet directly. Bind it to localhost and run nginx as a reverse proxy in front, so only nginx faces the world.8 min - 2
Keep It Running with systemdAn app started in a terminal dies when you close it. Write a systemd service so your Node app starts on boot, restarts on crash, and logs to the journal.8 min - 3
HTTPS and CertificatesPlain HTTP exposes passwords and sessions. Put a certbot certificate from letsencrypt.org in front of nginx, force HTTPS, and use only modern TLS.8 min - 4
Deploys Without DowntimeRestarting your app to ship code drops in-flight requests. Run two app instances behind nginx and restart them one at a time for a zero downtime deploy.8 min