# Self-Hosting Coolify v4 & Dokploy on Netcup RS 1000 G12.5 (€15.22/mo): Host Prep, Firewall & OOM Guide

> Deploy Coolify v4 or Dokploy on Netcup RS 1000 G12.5 (€15.22/mo net): Debian 12 swap/BBR, Docker daemon.json, SCP firewall, build caps & R2 backups.

- Canonical URL: https://euserverlab.com/guides/coolify-dokploy-self-hosting-netcup-guide/
- Language: en
- Published: 2026-11-04 | Updated: 2026-11-22
- Publisher: EUServerLab (https://euserverlab.com/methodology/)

## Key Findings (TL;DR)
- Concurrent Next.js, TypeScript, and Rust Nixpacks builds pin shared vCPUs and stall live databases. Netcup RS 1000 G12.5 provides 4 dedicated AMD EPYC™ 9645 or 9655 (Zen 5) physical threads, 8 GB DDR5 ECC, and 128 GB NVMe RAID (6.87 GB/s) at €15.22/mo net Year-1 with #rs1.
- Pre-configure 4 GB swap (vm.swappiness=10), TCP BBR, and /etc/docker/daemon.json log rotation (20m x 3) plus non-overlapping 172.80.0.0/16 bridge pools before running the Coolify v4 or Dokploy installer.
- Lock down SCP Firewall immediately after binding your HTTPS admin domain: allow TCP 80 and TCP/UDP 443 publicly, restrict SSH to WireGuard/Tailscale, and drop raw ports 8000, 3000, 6001, and 6002.
- Cap Docker/Nixpacks builds (--cpus=2.5 --memory=4g and NODE_OPTIONS=--max-old-space-size=3072) to eliminate exit-137 OOM kills, and stream nightly zstd-compressed pg_dump backups to Cloudflare R2 over the 2.5 Gbps EU/US fair-use port (>3 TB/24h -> 300 Mbps; Singapore SIN runs a 1 Gbps port with a 2 TB/mo quota).

## Execution Checklist
1. **Prepare Debian 12 Swap, Sysctl & Docker Daemon**: Allocate a 4 GB /swapfile with vm.swappiness=10, enable TCP BBR, and write /etc/docker/daemon.json with 20m x 3 log caps and custom 172.80.0.0/16 address pools.
2. **Install Coolify v4 or Dokploy & Point Wildcard DNS**: Run the official Coolify or Dokploy bootstrap script on clean Debian 12 and point A + AAAA records for deploy.example.com and *.apps.example.com to your Netcup dual-stack IPs.
3. **Harden Netcup SCP Firewall**: Expose only TCP 80 and TCP/UDP 443 to 0.0.0.0/0 and ::/0, restrict SSH to WireGuard/Tailscale, and drop raw ports 8000, 3000, 6001, and 6002.
4. **Enforce Build Caps & Schedule R2 Database Backups**: Constrain builds with --cpus=2.5 --memory=4g and NODE_OPTIONS=--max-old-space-size=3072, take €0 SCP CoW snapshots before upgrades, and run nightly pg_dump | zstd | rclone cron jobs.

---

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](/models/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](/guides/vat-free-registration-guide/) and [1-month CCP contract & cancellation rules](/guides/contract-and-cancellation-guide/) 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:

```bash
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:

```bash
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:

```bash
# 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](/models/rs-1000-g12-5/) (`€15.22/mo`) or `VPS 500` (`€6.94/mo` 12M) UI + [RS 2000](/models/rs-2000-g12-5/) worker | [VPS 500 G12.5](/models/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:

```text
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:

```ini
# 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`):

```bash
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](/models/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](/tools/server-sizer/) or compare dedicated vs. shared cores in [Netcup Root-Server vs. VPS](/compare/netcup-root-server-vs-vps/) before applying an active `#rs1` or `#rs2` code below.

## Frequently Asked Questions

### Should I choose Coolify v4 or Dokploy on an 8 GB Netcup RS 1000 G12.5?

Dokploy idles lighter (~320 MB vs ~620 MB for Coolify v4) and uses Docker Swarm natively, making it nimble on 4 GB VPS 500 or 8 GB RS 1000 nodes. Coolify v4 adds dedicated remote Build Server offloading, richer one-click service templates, and PR preview workflows once you run 8 GB (RS 1000) or 16 GB (RS 2000).

### Why pick RS 1000 G12.5 (€15.22/mo) over VPS 1000 G12.5 (€11.17/mo) for PaaS hosting?

VPS 1000 G12.5 runs shared EPYC vCores normalized to a 2.0 GHz live-migration profile. RS 1000 G12.5 pins 4 dedicated AMD EPYC™ 9645 or 9655 (Zen 5) physical threads for €4.05/mo extra in Year 1, letting you isolate 2.5 cores for Docker builds while 1.5 physical cores serve PostgreSQL and Traefik with 0% steal.

### Which ports must be blocked in Netcup SCP Firewall after installing Coolify or Dokploy?

Once your dashboard is reachable over HTTPS (port 443) via Traefik or Caddy, explicitly drop inbound TCP 8000 (Coolify HTTP), TCP 3000 (Dokploy HTTP), and TCP 6001/6002 (Coolify Soketi realtime/terminal) in SCP Firewall so attackers cannot bypass proxy TLS or middleware.

### When should I split out a build server or upgrade to RS 2000 G12.5?

Step up to RS 2000 G12.5 (8 dedicated Zen 5 cores, 16 GB DDR5 ECC, 256 GB NVMe, €31.35/mo net Year-1 with #rs2) or pair a VPS 500 G12.5 build worker (€6.94/mo net standard 12M for existing accounts, or €6.52/mo net Year-1 with #5e for new customers) when active containers exceed 25 services or local database volumes pass 90 GB.

---
Source: EUServerLab (https://euserverlab.com/guides/coolify-dokploy-self-hosting-netcup-guide/) | Open Telemetry Dataset: https://euserverlab.com/benchmarks/vps-500-g12-5.json
