Deploying to DigitalOcean Droplet
Linux VPS on DigitalOcean with full root access, deploy via SSH, Docker, or 1-Click apps.
PlatformsIntermediate
Why
Droplets are predictable-cost Linux VMs with full root access — no vendor lock-in, transparent pricing, and 14 global regions. 1-Click apps (Docker, LAMP, Node) pre-install the stack. Platform-as-a-Service adoption grew 24% in 2024 as teams shift from VM management to git-push deploys. the cloud infrastructure market reached $330B in 2024, growing 22% year-over-year (Synergy Research), and PaaS layers capture the majority of new workloads.
When
Use Droplets for self-hosted apps, custom stacks, and teams comfortable with Linux admin. Prefer App Platform for managed PaaS.
How
1. Create — doctl compute droplet create myapp --image docker-20-04 --size s-2vcpu-4gb
2. SSH — ssh root@droplet_ip, install app
3. Docker — docker run -d -p 80:3000 myapp
4. Nginx — reverse proxy + Let's Encrypt for TLS
5. Firewall — doctl compute firewall create, open 80/443/22
6. Floating IP — static IP for production
7. Snapshots — backup before deploys
Example
# Create Docker Droplet
doctl compute droplet create myapp --image docker-20-04 --size s-2vcpu-4gb --region nyc1 --ssh-keys ssh-key-id
# SSH and deploy
ssh root@droplet_ip
docker run -d --name app -p 3000:3000 myapp:latest
# Nginx + Let's Encrypt
apt install nginx certbot python3-certbot-nginx
certbot --nginx -d myapp.com
# Caddy (simpler TLS)
# Caddyfile
myapp.com
reverse_proxy localhost:3000
Common Problems
- ⚠No firewall — all ports open, configure DO firewall or ufw
- ⚠Manual TLS setup — use Caddy instead of Nginx for automatic Let's Encrypt
- ⚠Configuration drift between environments — use infrastructure-as-code (Terraform/Pulumi) to keep dev/staging/prod identical
Best Practices
- ✓Use Caddy for reverse proxy — automatic HTTPS with Let's Encrypt, zero config TLS
- ✓Take snapshots before deploys — instant rollback to working state
- ✓Set up health checks and graceful shutdown — handle SIGTERM to drain in-flight requests before exit