Setting Up Your First VPS: A Complete Guide
Getting your own virtual private server feels like a rite of passage for any developer. No more shared hosting limitations — you have full control over your stack, your config, and your deployment pipeline.
Choosing a Provider
I went with DigitalOcean for its simplicity and developer-friendly interface. Their $6/month droplet (1 vCPU, 1GB RAM) is more than enough for a personal website and several side projects. Other solid options include Linode, Vultr, and Hetzner.
Initial Server Setup
Once your droplet is live, the first thing you want to do is secure it:
- Set up SSH key-based authentication and disable password login
- Configure a firewall (UFW) to only allow ports 22, 80, and 443
- Enable automatic security updates
- Create a non-root user for day-to-day operations
Why Caddy?
I chose Caddy as my web server for one killer feature: automatic HTTPS. Caddy obtains and renews TLS certificates from Let's Encrypt with zero configuration. Your Caddyfile can be as simple as:
danieljmerritt.com {
root * /var/www/danieljmerritt.com
file_server
}
That's it. Caddy handles the rest — certificate provisioning, renewal, HTTP-to-HTTPS redirection, and OCSP stapling.
DNS Configuration
Point your domain's A record to your droplet's IP address. If you're using Cloudflare, set the record to "DNS only" (grey cloud) mode so Caddy can handle TLS directly. This gives you true end-to-end encryption.
Deploying Your Site
For a static site, deployment is as simple as copying files to your web root. You can use rsync or scp to push files from your local machine, or set up a simple Git-based deployment workflow.
The best infrastructure is the one you understand completely. Start simple, add complexity only when you need it.
What's Next
From here, you could containerize your setup with Docker, add a CI/CD pipeline with GitHub Actions, or start hosting more ambitious projects. The foundation is solid — build on it.