#Self-Host Next.js di Dokploy
Vercel enak tapi mahal di skala. Dokploy = open-source PaaS yang jalanin Next.js di VPS sendiri. Setup awal 30 menit, ongoing maintenance minimal.
#Kenapa Dokploy
- Dashboard mirip Vercel
- Auto SSL via Let's Encrypt
- Git push to deploy
- Bisa run Postgres/Redis/Convex di compose yang sama
#Setup VPS
Minimum VPS 2 vCPU + 4GB RAM. Hetzner CPX21 €5/bulan lebih dari cukup untuk projek personal + 2-3 client app.
curl -sSL https://dokploy.com/install.sh | sh
Browse ke http://<ip>:3000, set admin password.
#Deploy Next.js
- Connect GitHub di Dokploy
- Create Application → pilih repo
- Build pack:
Nixpacksauto-detect Next.js - Domain:
app.example.com→ auto SSL
#Environment Variables
Set di Dokploy UI atau via .env file di repo (private). Hot reload saat update.
#Self-Hosted Convex
Bonus: Dokploy bisa jalanin Convex backend di compose yang sama. Akses via https://api.example.com — domain terpisah, satu VPS.
#Production Notes
- Backup database harian (Dokploy built-in)
- Monitoring via Uptime Kuma container
- CDN: Cloudflare di depan domain — proxy ON, SSL Flexible
#Cost Comparison
Vercel Pro: $20/bulan + bandwidth overage. Dokploy + VPS Hetzner: €5/bulan flat, bandwidth 20TB included.
Cocok untuk projek bandwidth tinggi (image-heavy, video) atau client yang sensitif data routing.
