2026-05-15 · 5 min
Systemd vs Docker untuk VPS Indonesia: Pilih Sederhana
Setiap kali ada developer baru join freelance saya, pertanyaan pertama: “Pak Reza, deploy-nya pakai Docker?” Saya hampir selalu jawab: tidak. Pakai systemd.
Penjelasan ini bukan anti-Docker. Docker sangat powerful untuk specific use case. Tapi untuk SMB Indonesia yang VPS-nya satu, tidak ada Kubernetes, tim cuma 1-3 orang — Docker often over-engineering.
Konteks: VPS 4GB / 4 CPU di Hetzner Singapore
Setup standard saya untuk klien SMB:
- VPS Hetzner cx41 (4GB / 4 CPU, $11/month)
- Ubuntu 24.04 LTS
- Nginx reverse proxy
- Postgres 17
- App layer: Bun + Hono atau Go + Fiber
App jalan via systemd service:
# /etc/systemd/system/myapp.service
[Unit]
Description=My Warung App
After=network.target postgresql.service
[Service]
Type=simple
User=myapp
WorkingDirectory=/opt/myapp
ExecStart=/usr/local/bin/bun run /opt/myapp/server.ts
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
Environment="NODE_ENV=production"
EnvironmentFile=/opt/myapp/.env
[Install]
WantedBy=multi-user.target
Deploy script:
#!/bin/bash
# deploy.sh
git pull
bun install --production
bun run build
sudo systemctl restart myapp
sudo journalctl -u myapp -n 50 --no-pager
That’s it. 15 lines of config. Done.
Dengan Docker, saya butuh
- Dockerfile (writing image)
- docker-compose.yml (orchestration)
- Network config (frontend, backend network)
- Volume mount (data persistence)
- Health check config
- Restart policy
- Resource limits
- Logging driver
- nginx-proxy atau Traefik untuk reverse proxy
50+ lines of config minimum, lebih kalau pakai Docker Swarm atau Kubernetes.
Resource overhead
VPS 4GB, app saya (Hono + Postgres + Redis):
Systemd setup: 350MB RAM used. Docker setup (same app): 580MB RAM used.
Docker tax ~230MB karena: container runtime, multiple syscalls, network bridge overhead, isolation overhead.
Untuk VPS 4GB, 230MB = 5.7% kapasitas. Tidak break, tapi gratis kapasitas yang bisa untuk caching.
Yang systemd kasih, tanpa drama
- Restart on failure:
Restart=alwaysdi unit file. - Logging: Journald otomatis.
journalctl -u myapp -funtuk realtime tail. - Permission isolation:
User=myappuntuk run app sebagai non-root user. - Auto-start on boot:
systemctl enable myapp. - Resource limits:
MemoryMax=500M,CPUQuota=200%(2 cores) di unit file. - Graceful shutdown:
TimeoutStopSec=30plus SIGTERM handler di app.
Semua di unit file ~25 lines.
Yang Docker kasih (yang systemd tidak)
- Dependency isolation: app A pakai Node 18, app B pakai Node 22. Docker easy. Systemd harus pakai nvm or manual paths.
- Multi-architecture build: Docker buildx untuk arm64 + amd64. Systemd: native compile.
- Easy multi-environment: dev image = prod image. Systemd: deployment script harus handle env differences.
- Service discovery: docker compose otomatis. Systemd: manual
network=bridgeor unix sockets. - Quick scale-out: Docker swarm trivial. Systemd: harus setup load balancer manual.
Untuk klien SMB: poin-poin ini biasanya tidak relevan. App-nya satu, dependency-nya satu set, scale-nya vertical (upgrade VPS) bukan horizontal.
Kapan saya pakai Docker
- Klien punya tim DevOps yang preference Docker (tidak fight existing flow)
- Multi-tenant SaaS dengan per-customer database container
- Setup local dev yang harus matched production tanpa “works on my machine” issue
- Deploy ke Kubernetes (memang harus pakai Docker)
Kapan saya pakai systemd
- VPS tunggal SMB Indonesia
- Side project pribadi
- Project warisan yang code masih jalan (no migration)
Saran
Junior dev sering install Docker karena “industri standard”. Mungkin benar di Bay Area startup. Untuk Indonesia SMB context: pertimbangkan systemd. Lebih sederhana, lebih hemat, less to maintain.
Yang penting bukan tool. Yang penting: deploy bisa diulang, restart on failure, logging accessible. Systemd kasih semua itu, gratis, sudah dibuilt-in Ubuntu.
Ditulis oleh Reza Pradipta