Next.js App Router + Self-Host di Dokploy: Production Setup

11 Mei 2026 · Rahman Fakhrul · Website · 1 min read

Self-host Next.js 16 di VPS dengan Dokploy: Docker, SSL otomatis Let's Encrypt, deployment via Git push. Alternatif Vercel untuk projek Indonesia.

#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

  1. Connect GitHub di Dokploy
  2. Create Application → pilih repo
  3. Build pack: Nixpacks auto-detect Next.js
  4. 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.