←All Notes
2026-09|DevOps · CI/CD · VPS

Production Infrastructure Deployment

How I set up a reproducible production environment with Caddy, PM2, and GitHub Actions.

Production Infrastructure Deployment

Deployed the production infrastructure for the current stack across VPS and managed services. The goal was a reproducible, observable environment with minimal manual intervention.

Stack

  • VPS: Ubuntu 22.04 LTS
  • Process manager: PM2
  • Reverse proxy: Caddy
  • CI/CD: GitHub Actions
  • Secrets: .env files on server + GitHub Environments

Steps

  1. Provisioned the VPS and hardened SSH access.
  2. Configured Caddy to terminate TLS and reverse-proxy to app ports.
  3. Set up PM2 process definitions with restart policies and log rotation.
  4. Wired GitHub Actions to deploy on push to production.
  5. Added health checks and uptime monitoring.

Outcome

Zero-downtime deploys and faster rollbacks. Deployment time dropped from manual steps to under two minutes.