Self-hosting Coolify v4 or Dokploy rarely fails during idle HTTP traffic; outages happen when git push triggers concurrent pnpm build, TypeScript type-checking, and zstd image compression on the same kernel running live PostgreSQL and Redis. On Netcup RS 1000 G12.5 (€15.22/mo net Year-1 with #rs1), 4 dedicated AMD EPYC™ 9645 or 9655 (Zen 5) physical threads, 8 GB DDR5 ECC RAM, 6.87 GB/s NVMe RAID (115.87 µs 4K Q1T1 write), and a 2.5 Gbps fair-use port in EU/US (NUE/VIE/MNZ, throttled to 300 Mbps only above 3 TB/24h; Singapore SIN runs 1 Gbps with a 2 TB/mo quota) let you hard-partition build compute away from production traffic (see our 0% Non-EU VAT setup and 1-month CCP contract & cancellation rules before checkout).
1. Debian 12 Host Preparation: Swap, BBR & /etc/docker/daemon.json
Run these commands on a fresh Netcup SCP Debian 12 (Bookworm) image before installing Coolify or Dokploy so Docker Engine inherits log rotation and non-conflicting bridge subnets from its first boot:
sudo apt update && sudo apt full-upgrade -y
sudo apt install -y curl git jq zstd rclone ca-certificates
# 1. Create a 4 GB NVMe swap safety buffer against transient bundler spikes
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# 2. Keep active pages in DDR5 ECC RAM (swappiness=10) & enable TCP BBR on 2.5 Gbps NIC
cat <<'EOF' | sudo tee /etc/sysctl.d/99-paas-host.conf
vm.swappiness=10
vm.vfs_cache_pressure=50
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
EOF
sudo sysctl --system
Write /etc/docker/daemon.json next. Capping JSON logs at 20m × 3 prevents verbose Node/Python stdout from silently filling a 128 GB NVMe disk, live-restore keeps app containers running across Docker daemon patch restarts, and 172.80.0.0/16 avoids subnet collisions with Tailscale (100.64.0.0/10) or corporate WireGuard (10.0.0.0/8) routes:
sudo mkdir -p /etc/docker
cat <<'EOF' | sudo tee /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "20m",
"max-file": "3"
},
"live-restore": true,
"default-address-pools": [
{
"base": "172.80.0.0/16",
"size": 24
}
]
}
EOF
Note: If you choose Dokploy (which initializes Docker Swarm mode), remove "live-restore": true from /etc/docker/daemon.json, as Docker Engine disallows live-restore alongside Swarm orchestration.
2. Installing Coolify v4 vs. Dokploy (Commands & Architecture Matrix)
Install either Coolify v4 or Dokploy on a clean host — never run both control planes on the same VM, as both claim ports 80/443 and manage overlapping Docker networks:
# Option A: Official Coolify v4 installer (opens initial setup on TCP 8000)
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
# Option B: Official Dokploy installer (initializes Swarm & opens setup on TCP 3000)
curl -sSL https://dokploy.com/install.sh | sh
| Technical Dimension | Coolify v4 | Dokploy |
|---|---|---|
| Idle Control-Plane RAM | ~580–700 MB (Laravel/FrankenPHP + Postgres + Redis + Soketi) | ~280–380 MB (Node.js/Next + Postgres + Redis) |
| Container Orchestrator & Proxy | Standalone Docker Engine + Traefik or Caddy | Docker Swarm (single- or multi-node) + Traefik |
| Bootstrap & Realtime Ports | TCP 8000 UI + TCP 6001/6002 (Soketi WebSockets & terminal) | TCP 3000 UI (realtime multiplexed over main port/proxy) |
| Multi-Server & Build Offload | Native Dedicated Build Server role over SSH + remote Docker hosts | Swarm worker nodes + remote SSH server deployments |
| Best Netcup G12.5 Tier | RS 1000 G12.5 (€15.22/mo) or VPS 500 (€6.94/mo 12M) UI + RS 2000 worker | VPS 500 G12.5 (€6.52/mo Yr-1 w/ #5e new acct / €6.94/mo 12M) for light apps; RS 1000 for heavy CI builds |
3. Dual-Stack Wildcard DNS & Netcup SCP Firewall Rules
Configure wildcard DNS once so every new preview branch or service (api.apps.example.com, umami.apps.example.com) provisions Let’s Encrypt certificates automatically without manual DNS edits:
deploy.example.com 300 IN A 203.0.113.42
deploy.example.com 300 IN AAAA 2a03:4000:60:1234::1
*.apps.example.com 300 IN A 203.0.113.42
*.apps.example.com 300 IN AAAA 2a03:4000:60:1234::1
Bind https://deploy.example.com inside Coolify (Settings → Instance's Domain) or Dokploy (Settings → Web Server), verify HTTPS login works, and immediately enforce an explicit inbound policy in Netcup SCP → Firewall (which filters packets on the host hypervisor outside iptables — remember Docker bypasses host ufw rules by inserting PREROUTING DNAT and DOCKER FORWARD rules ahead of ufw INPUT chains, requiring DOCKER-USER or SCP Firewall rules):
| SCP Firewall Direction | Protocol & Port | Source | Action | Operational Reason |
|---|---|---|---|---|
| Inbound | TCP 80 | 0.0.0.0/0, ::/0 | ACCEPT | HTTP-to-HTTPS redirect & Let’s Encrypt HTTP-01 |
| Inbound | TCP 443 & UDP 443 | 0.0.0.0/0, ::/0 | ACCEPT | TLS 1.3 & HTTP/3 QUIC ingress to Traefik/Caddy |
| Inbound | UDP 51820 / UDP 41641 | 0.0.0.0/0, ::/0 | ACCEPT | WireGuard or Tailscale direct peer tunnel |
| Inbound | TCP 22 | WireGuard / Admin IP | ACCEPT (else DROP) | Eliminates public SSH brute-force noise |
| Inbound | TCP 8000, 3000, 6001, 6002 | 0.0.0.0/0, ::/0 | DROP | Blocks unencrypted setup UI & raw Soketi sockets after HTTPS cutover |
4. Preventing Build OOMs & Nightly pg_dump Backups to R2
Unconstrained Next.js, Vite, or Rust builds happily allocate 6+ GB of heap and trigger the Linux OOM killer on an 8 GB host. Lock every heavy build pipeline to 2.5 cores and 4 GB RAM so 1.5 physical Zen 5 threads and 4 GB DDR5 ECC remain dedicated to live traffic:
# Build-time Environment Variables (Coolify -> Environment Variables -> Build Time / Dokploy -> Env)
NODE_OPTIONS=--max-old-space-size=3072
NEXT_TELEMETRY_DISABLED=1
CARGO_BUILD_JOBS=2
# Custom Docker Build / Run Options on RS 1000 G12.5 (4C / 8G)
--cpus="2.5" --memory="4g" --memory-swap="5g"
Pair free €0 SCP Copy-on-Write VM snapshots (taken before OS or Coolify/Dokploy upgrades) with an automated nightly PostgreSQL logical dump streamed over Netcup’s 2.5 Gbps EU/US fair-use port (300 Mbps only above 3 TB/24h; 1 Gbps with a 2 TB/mo quota in SIN, with rclone config pre-configured with a Cloudflare R2 or Hetzner Storage Box remote named r2):
cat <<'EOF' | sudo tee /usr/local/bin/backup-paas-pg.sh
#!/usr/bin/env bash
set -euo pipefail
STAMP=$(date -u +"%Y-%m-%d_%H%M")
HOST_TAG=$(hostname -s)
# Dump every PostgreSQL container running on the node with zstd compression
for CID in $(docker ps --format '{{.ID}} {{.Image}}' | awk '/postgres|pgvector/ {print $1}'); do
NAME=$(docker inspect --format '{{.Name}}' "$CID" | sed 's#^/##')
docker exec "$CID" pg_dumpall -U postgres --clean --if-exists \
| zstd -T2 -10 \
| rclone rcat "r2:netcup-backups/${HOST_TAG}/${NAME}_${STAMP}.sql.zst"
done
rclone delete --min-age 14d "r2:netcup-backups/${HOST_TAG}/"
EOF
sudo chmod 700 /usr/local/bin/backup-paas-pg.sh
echo "20 2 * * * root /usr/local/bin/backup-paas-pg.sh >> /var/log/paas-backup.log 2>&1" \
| sudo tee /etc/cron.d/paas-pg-backup
5. Coolify & Dokploy Production Troubleshooting Matrix
| Failure Symptom | Root Cause on KVM / Docker | Exact Remediation |
|---|---|---|
Traefik 502 Bad Gateway right after green deploy | App binds 127.0.0.1 or ::1 loopback inside container, or Traefik routes to an unexposed port on dual-stack networks. | Set HOST=0.0.0.0 and PORT=3000 in app env, and explicitly set Ports Exposes: 3000 (Coolify) or Container Port 3000 (Dokploy). |
Nixpacks / Dockerfile build aborts with exit code 137 | Linux cgroup OOM-killed node or rustc because V8 heap exceeded container memory or swap was absent. | Confirm swapon --show displays 4G, set NODE_OPTIONS="--max-old-space-size=3072" (build-time), or upgrade to RS 2000 G12.5 (16 GB RAM). |
no space left on device under /var/lib/docker/overlay2 | Accumulated BuildKit layer caches and dangling images exhausted the 128 GB NVMe partition. | Enable scheduled Docker cleanup in UI and run docker builder prune -af --filter "until=168h" && docker image prune -af --filter "until=168h". |
| Coolify live build stream stalls or terminal disconnects | Proxy strips WebSocket Upgrade headers or client connects to raw port 6001/6002 blocked by SCP Firewall. | Access Coolify strictly via https://deploy.example.com (Traefik routes /app and /terminal/ws internally over 443); enable WebSockets in Cloudflare if orange-clouded. |
Let’s Encrypt cert fails with 429 rateLimited or redirect loop | Repeated broken deploys hit ACME’s 5-failures/hour limit, or Cloudflare SSL mode is set to Flexible instead of Full (Strict). | Switch Cloudflare SSL/TLS to Full (Strict), or configure Traefik DNS-01 wildcard issuance (CF_DNS_API_TOKEN) so individual app deploys skip HTTP-01 challenges. |
Size multi-container memory headroom in our Workload Sizer or compare dedicated vs. shared cores in Netcup Root-Server vs. VPS before applying an active #rs1 or #rs2 code below.
RS 1000 G12.5
2 Months Free · Valid for New & Existing Customers (12M Term)