nginx vs Caddy vs Traefik: VPS Production 12 Bulan
Tiga reverse proxy populer untuk VPS production. Saya pakai nginx 36 bulan, Caddy 18 bulan, Traefik 12 bulan. Verdict tergantung use case dan stack.
TL;DR
- nginx: Matang, performance terbaik, config verbose. Conditional Recommend untuk legacy + high-performance.
- Caddy: Auto-HTTPS bawaan, config simple. Conditional Recommend untuk solo dev / monolith.
- Traefik: Docker-native, service discovery. Conditional Recommend untuk container stack.
- Verdict: pilih berdasarkan stack (monolith → Caddy, Docker → Traefik, performance → nginx).
Konteks
Saya pakai ketiga reverse proxy di 15 VPS production SMB Indonesia 2022-2026:
- nginx (8 VPS): klien legacy WordPress + Laravel, klien performance-critical
- Caddy (5 VPS): klien monolith Laravel + Filament admin, Node/Bun app simple
- Traefik (2 VPS): klien Docker Compose stack microservice, klien dev/staging multi-app per VPS
Plus Cloudflare layer di depan VPS untuk DDoS + caching (semua project).
Pricing
Ketiga gratis dan open-source. Cost = waktu setup + maintenance + cert (free via Let’s Encrypt).
Hidden cost
| Tool | Setup time (clean VPS) | Cert renewal setup | Maintenance/bulan |
|---|---|---|---|
| nginx + certbot | 45-90 menit | Manual cron + 15 menit | 30-60 menit |
| Caddy | 15-30 menit | Auto (zero touch) | 5-15 menit |
| Traefik | 60-120 menit (first time) | Auto | 15-30 menit |
Untuk dev junior baru setup VPS: Caddy menang time-to-production.
Performance benchmark
Test: VPS Biznet 4GB RAM, 4 vCPU, Jakarta region. Backend: Hono on Bun (port 3000).
Static file serving (10MB file, 100 concurrent)
| Tool | Throughput | Latency p50 | Latency p99 |
|---|---|---|---|
| nginx | 1.2 GB/s | 8ms | 35ms |
| Caddy | 1.05 GB/s | 12ms | 48ms |
| Traefik | 0.95 GB/s | 14ms | 55ms |
nginx menang static serving by 10-25%.
Reverse proxy (backend RPS)
| Tool | Max RPS | Latency p99 |
|---|---|---|
| nginx | 28,000 | 18ms |
| Caddy | 25,500 | 22ms |
| Traefik | 22,000 | 28ms |
nginx menang reverse proxy by 10-30%. Caddy close second.
Memory usage (idle, 5 sites)
| Tool | RAM |
|---|---|
| nginx | 12-25 MB |
| Caddy | 40-80 MB |
| Traefik | 60-120 MB |
nginx paling efisien memory.
Startup time
| Tool | Cold start |
|---|---|
| nginx | 50-150ms |
| Caddy | 200-400ms |
| Traefik | 400-800ms |
nginx fastest restart. Caddy + Traefik acceptable.
Feature comparison
| Feature | nginx | Caddy | Traefik |
|---|---|---|---|
| Auto-HTTPS (Let’s Encrypt) | Manual (certbot) | Built-in | Built-in |
| HTTP/3 (QUIC) | Yes (1.25+) | Yes (default) | Yes |
| HTTP/2 | Yes | Yes | Yes |
| WebSocket | Yes | Yes | Yes |
| Load balancing | Yes (multiple algo) | Yes | Yes (rich algo) |
| Service discovery | No (manual config) | No | Yes (Docker, K8s, Consul) |
| Config reload | Graceful (no downtime) | Graceful | Graceful (file watch) |
| Config language | nginx.conf (verbose) | Caddyfile (simple) | YAML / TOML / labels |
| Dashboard | No (3rd party) | No (API only) | Built-in |
| Rate limiting | Yes | Yes | Yes |
| Plugin ecosystem | Large (3rd party) | Modules (Go) | Medium |
| TCP/UDP proxy | Yes | Yes | Yes |
| Wildcard certs | Yes (manual) | Yes (auto) | Yes (auto) |
Trade-off
nginx
Pro: Performance terbaik (10-30% lebih cepat). Matang — 20+ tahun production. Documentation paling lengkap (Indonesia banyak resource). Plugin/module ekosistem besar. Memory paling efisien.
Con: Config verbose (nginx.conf syntax learning curve). Cert renewal manual setup (certbot + cron). Reload config butuh test (nginx -t) wajib. Tidak ada service discovery.
Caddy
Pro: Auto-HTTPS bawaan — zero touch cert. Config Caddyfile paling simple (3-5 baris untuk basic site). HTTP/3 default. JSON API untuk programmatic config. Module ekosistem Go-based.
Con: Performance 5-15% di bawah nginx. Memory consumption 3-4x nginx. Adoption Indonesia masih kecil — community resource lebih sedikit. Plugin ecosystem lebih kecil dari nginx.
Traefik
Pro: Container-native — Docker labels auto-discovery service. Multi-provider (Docker, K8s, Consul, file). Dashboard built-in monitoring. Middleware composable (chain). Cloud-native focus.
Con: Performance terendah dari ketiga (10-30% di bawah nginx). Memory paling tinggi. Learning curve steep (terminology — provider, router, middleware, service). Bukan ideal untuk monolith single-app VPS.
Config comparison
nginx (Laravel app dengan SSL)
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
root /var/www/example/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Plus certbot setup terpisah.
Caddy (same app)
example.com {
root * /var/www/example/public
php_fastcgi unix//var/run/php/php8.4-fpm.sock
file_server
}
5 baris vs 25+. Auto-HTTPS included.
Traefik (Docker label)
# docker-compose.yml
services:
laravel-app:
image: my-laravel:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`example.com`)"
- "traefik.http.routers.app.entrypoints=websecure"
- "traefik.http.routers.app.tls.certresolver=letsencrypt"
- "traefik.http.services.app.loadbalancer.server.port=80"
traefik:
image: traefik:v3
command:
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "[email protected]"
ports: ["80:80", "443:443"]
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./letsencrypt:/letsencrypt"
Service auto-discovered. Adding new app = add docker-compose service + label, no proxy config edit.
Konteks Indonesia
Klien klinik dental Jakarta (Caddy + Laravel): VPS Niagahoster Rp 150rb/bulan. Setup 25 menit dari clean Ubuntu. Auto-HTTPS zero touch. Maintenance 5 menit/bulan (kebanyakan update sistem). Cocok untuk solo dev / freelance.
Warung scale Tangerang (nginx + Laravel + WordPress legacy): VPS Biznet Rp 250rb/bulan. nginx pilihan karena tim klien legacy nginx workflow. Cert renewal via certbot. Maintenance 30-45 menit/bulan untuk monitor log + tuning.
HR SaaS Jakarta (Traefik + Docker Compose stack): 5 service (app, worker queue, scheduler, MySQL, Redis). Traefik handle routing + SSL. Adding service baru: edit docker-compose, no config proxy edit. Productivity tinggi untuk dev stack microservice.
Use case decision matrix
| Scenario | Recommended |
|---|---|
| Monolith Laravel / Node single VPS | Caddy |
| WordPress + cPanel hosting | nginx (default Apache atau nginx) |
| Performance critical (10K+ RPS) | nginx |
| Memory-constrained VPS (< 2GB RAM) | nginx |
| Docker Compose stack 3+ service | Traefik |
| Kubernetes ingress | Traefik atau nginx-ingress |
| Dev/staging multi-app per VPS | Traefik atau Caddy |
| Solo dev new VPS | Caddy |
| Legacy team familiar nginx | nginx (no need to switch) |
Setup tips Indonesia
Caddy + Laravel + VPS Niagahoster (15 menit)
# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
# Edit /etc/caddy/Caddyfile
sudo nano /etc/caddy/Caddyfile
# Reload
sudo systemctl reload caddy
nginx + Laravel + certbot (60 menit)
sudo apt install nginx
sudo apt install certbot python3-certbot-nginx
# Config nginx.conf
sudo nano /etc/nginx/sites-available/my-app
sudo ln -s /etc/nginx/sites-available/my-app /etc/nginx/sites-enabled/
# Get SSL
sudo certbot --nginx -d example.com
# Cron auto-renew
sudo crontab -e
# Add: 0 3 * * * certbot renew --quiet
Traefik + Docker (90 menit first time)
Pakai docker-compose dengan labels seperti config di atas. Plus traefik service.
Untuk dev/staging multi-tenant per VPS: Traefik save 30+ menit per app added.
Yang surprising
Caddy adoption Indonesia tumbuh cepat 2025-2026. Dev mid-career mulai pakai untuk new VPS. Time-to-production saving significant — dev junior bisa setup VPS production-ready dalam 15-30 menit.
nginx performance lead mengecil. 5 tahun lalu 30-50% lebih cepat dari alternative. Sekarang Caddy 2.x close enough (5-15% gap) untuk most workload.
Traefik shine untuk Docker-first stack. Untuk klien yang adopt containerization, Traefik save effort proxy config setiap deploy.
Verdict
Conditional Recommend untuk ketiga:
Pakai nginx jika:
- Performance critical (10K+ RPS)
- Memory constrained VPS (< 2GB RAM)
- Legacy team familiar nginx workflow
- WordPress + cPanel stack
- Tooling Indonesia familiar (resource banyak)
Pakai Caddy jika:
- Solo dev / freelance setup VPS
- Monolith app simple
- Time-to-production priority
- Auto-HTTPS zero touch
- Default safe untuk new VPS 2026
Pakai Traefik jika:
- Docker Compose stack 3+ service
- Multi-app per VPS (dev/staging)
- Kubernetes ingress
- Microservice architecture
Skip jika: Anda pakai PaaS (Vercel, Cloudflare, Railway) — proxy sudah managed.
Untuk PM2 / Systemd / Docker comparison: PM2 vs Systemd vs Docker untuk VPS.
Ditulis oleh Asti Larasati