ServerFaktEU Server & Hosting Reference

Self-Hosting Server Guide: Mail Servers (Port 25 / rDNS), Docker, PostgreSQL & Nextcloud

Copy-pasteable configuration files, DNS zone records, firewall rule matrices and database memory parameters for running a production mail stack, Docker Compose services and PostgreSQL on a European KVM server.

Verified: · 11 min read

1. Provider Capabilities for Self-Hosters

Self-hosting stateful services requires capabilities that many cloud providers restrict by default — specifically outbound TCP Port 25, customizable IPv4 and IPv6 reverse DNS (PTR), sustained CPU/disk I/O without throttling, and off-provider image backups:

Infrastructure Requirementnetcup Root Server G12.5netcup VPS G12.5Hetzner Cloud (CX / CCX)OVHcloud VPSContabo Cloud VPS
Sustained 100% CPU load
Databases, CI/CD, video, game servers
Allowed (dedicated physical EPYC 9645 cores)Fair-use shared vCores (throttled under constant 100% load)CX: shared fair-use
CCX: dedicated cores
Shared vCoresShared vCPU
Outbound TCP Port 25 (SMTP)
Self-hosted Postfix / Mailcow / Stalwart
Self-service unblock in SCP Firewall (remove default Mail block rule)Self-service unblock in SCP FirewallBlocked for new accounts until 1st paid invoice + manual limit requestRestricted by default on many regions; requires support reviewOpen after account verification
IPv4 & IPv6 Reverse DNS (PTR)Instant self-service in SCP (/64 IPv6 + IPv4)Instant self-service in SCP (/64 IPv6 + IPv4)Instant self-service in Cloud Console / APISelf-service in OVH Manager (single /128 IPv6 on some tiers)Self-service in Customer Control Panel
Custom ISO Upload & RescueSelf-service HTTP/upload + Grml Live RescueSelf-service HTTP/upload + Grml Live RescueCurated ISO library + Linux Rescue (custom ISO via support ticket)Pre-built OS templates + netboot rescueCustom image add-on or Cloud-Init
Local Snapshot Export
Off-provider backup
1 free .raw.zst download while VM is stopped1 free .raw.zst download while VM is stoppedCloud snapshots (€0.011/GB/mo, 0% VAT); no raw disk downloadPaid snapshot add-onCloud snapshots only
Renewal Price StabilityRenews at same base tariff (no intro hike)Renews at same base tariffFixed hourly / monthly capStandard renewal tariff24M promo discounts revert to higher standard rate at renewal

2. Self-Hosted Mail Server Configuration (Port 25, FCrDNS, DNS Zone & Postfix IPv6)

Delivering email directly to Gmail, Microsoft 365 and European MX hosts requires four verified configuration steps:

  1. Unblock Outbound TCP Port 25 in SCP & Verify Connectivity: On netcup G9–G12.5 servers, open SCP → Select Server → Firewall, remove the default netcup Mail block policy, click Save, and verify outbound SMTP plus forward-confirmed reverse DNS (FCrDNS) from the server shell:
    # 1. Test outbound TCP Port 25 connectivity to Gmail MX
    nc -zv -w 5 gmail-smtp-in.l.google.com 25
    
    # 2. Verify IPv4 and IPv6 Reverse DNS (PTR) matches your mail hostname
    dig +short -x 203.0.113.45
    dig +short -x 2a03:4000:60:1234::1
  2. Required DNS Zone Records & SCP Reverse DNS (PTR): Set the PTR record in SCP → Network for both your IPv4 address and your chosen IPv6 address (::1) to mail.example.com, and publish the matching records in your DNS zone:
    Record TypeHost / NameValue / Example TargetPurpose
    Amail.example.com203.0.113.45Maps mail hostname to your server IPv4 (must match SCP IPv4 PTR)
    AAAAmail.example.com2a03:4000:60:1234::1Maps mail hostname to the specific IPv6 address (must match SCP IPv6 PTR)
    MXexample.com10 mail.example.com.Directs inbound mail for your domain to your mail host
    TXT (SPF)example.com"v=spf1 mx -all"Authorizes only the hosts listed in your MX record to send mail
    TXT (DKIM)dkim._domainkey"v=DKIM1; k=rsa; p=MIIBIjANBg..."Cryptographic signature generated by Rspamd / OpenDKIM / Stalwart
    TXT (DMARC)_dmarc.example.com"v=DMARC1; p=quarantine; rua=mailto:postmaster@example.com"Instructs receiving servers to quarantine messages failing SPF + DKIM
  3. Bind Outbound Postfix to the Exact IPv6 PTR Address (/etc/postfix/main.cf): Because Linux may otherwise pick an arbitrary address from your /64 subnet without a matching PTR record (causing Gmail IPv6 rejections), explicitly bind Postfix to your primary IPv4 and IPv6 addresses:
    # /etc/postfix/main.cf — explicit outbound bind for FCrDNS compliance
    myhostname = mail.example.com
    inet_protocols = all
    smtp_bind_address = 203.0.113.45
    smtp_bind_address6 = 2a03:4000:60:1234::1
    smtp_helo_name = mail.example.com
    smtp_tls_security_level = may

3. Docker Compose, daemon.json & the SCP Stateful Firewall Matrix

Publishing a port with -p 5432:5432 in Docker writes directly to the Linux kernel nat / FORWARD chains, bypassing UFW / iptables INPUT rules and exposing internal databases to the public internet. Harden your container host with two layers:

  1. Bind internal containers to 127.0.0.1 and cap container logs in /etc/docker/daemon.json:
    {
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "20m",
        "max-file": "3"
      },
      "live-restore": true
    }
  2. Enforce ingress filtering outside the VM using the hypervisor-level SCP Stateful Firewall: Because SCP’s OpenStack-backed firewall filters packets at the host hypervisor tap interface before they reach the VM kernel, Docker cannot bypass it. Use this baseline rule table:
    OrderDirectionProtocolPort(s)Source / DestinationAction & Purpose
    1INGRESSTCP22Your admin IP / VPN subnet (or 0.0.0.0/0)ACCEPT — SSH access
    2INGRESSTCP80, 4430.0.0.0/0, ::/0ACCEPT — Reverse proxy (Caddy / Traefik / Nginx)
    3INGRESSUDP4430.0.0.0/0, ::/0ACCEPT — HTTP/3 (QUIC)
    4INGRESSTCP25, 465, 587, 9930.0.0.0/0, ::/0ACCEPT — Mail server (if running SMTP + IMAPS)
    5INGRESSICMP / ICMPv6All0.0.0.0/0, ::/0ACCEPT — Required for Path MTU Discovery & IPv6 Neighbor Discovery
    6INGRESSALLAll other ports0.0.0.0/0, ::/0DROP — Blocks direct external access to Docker ports (5432, 6379, etc.)

4. PostgreSQL NVMe Tuning for an 8 GB Root Server (RS 1000 G12.5)

Default PostgreSQL settings assume spinning disks and 128 MB of shared memory. On a 4-core / 8 GB DDR5 / NVMe server such as netcup RS 1000 G12.5, apply these tuned parameters in postgresql.conf (or pass them via Docker command: -c ...):

# postgresql.conf — tuned for 4 dedicated EPYC cores, 8 GB RAM, NVMe storage
shared_buffers = 2GB                  # 25% of total RAM
effective_cache_size = 6GB            # 75% of total RAM (OS page cache + shared_buffers)
maintenance_work_mem = 512MB          # Speeds up VACUUM and CREATE INDEX
work_mem = 16MB                       # Per sort/hash operation
max_worker_processes = 4              # Match dedicated physical CPU cores
max_parallel_workers_per_gather = 2
max_parallel_workers = 4
random_page_cost = 1.1                # Tell query planner storage is NVMe SSD (default is 4.0)
effective_io_concurrency = 200        # Concurrent async NVMe I/O requests
wal_compression = zstd                # Reduce WAL write amplification on NVMe
checkpoint_completion_target = 0.9

5. Recommended Server Tiers & Active Vouchers

New customers· New customers only

netcup New-Customer Voucher (€4.20 net / €5 gross)

  • First order of a new account
  • Deducted once at 0% VAT (€4.20 net)
  • Not for domains, VPS ARM, VPS Lite

€4.20 net off (0% VAT)

Worth €4.20(one-time cart deduction at 0% VAT (excl. tax); €5.00 face value incl. 19% DE VAT)

4 backup codes
  • 36nc17833646272
  • 36nc17833646270
  • 36nc17833646271
  • 36nc17833646273

Product codes are single-use. If netcup reports the code as already redeemed, use the next one.

Details & prices →
Root Server· New and existing customers

RS 1000 G12.5

  • 4 dedicated cores
  • 8 GB RAM
  • 128 GB NVMe
  • 2.5 Gbit/s

2 months free

Worth €36.52(2 × €18.26 · 12-month rate, 0% VAT (excl. tax))

4 backup codes
  • 6874nc17940391780
  • 6874nc17943134860
  • 6874nc17940129280
  • 6874nc17942196620

Product codes are single-use. If netcup reports the code as already redeemed, use the next one.

Details & prices →
Root Server· New and existing customers

RS 2000 G12.5

  • 8 dedicated cores
  • 16 GB RAM
  • 256 GB NVMe
  • 2.5 Gbit/s

1 month free

Worth €34.20(1 × €34.20 · 12-month rate, 0% VAT (excl. tax))

4 backup codes
  • 6875nc17939016850
  • 6875nc17942234940
  • 6875nc17939086810
  • 6875nc17937997610

Product codes are single-use. If netcup reports the code as already redeemed, use the next one.

Details & prices →
VPS· New and existing customers

VPS 1000 G12.5

  • 4 vCores
  • 8 GB RAM
  • 128 GB SSD
  • 2.5 Gbit/s

1 month free

Worth €12.18(1 × €12.18 · 12-month rate, 0% VAT (excl. tax))

4 backup codes
  • 6877nc17940520550
  • 6877nc17939634411
  • 6877nc17940514860
  • 6877nc17942858710

Product codes are single-use. If netcup reports the code as already redeemed, use the next one.

Details & prices →