OKAlle Dienste sind betriebsbereit
InfrawireInfrawire LogoDokumentation

mailcow auf einem Linux-VPS installieren und absichern

mailcow: dockerized ist ein vollständiger E-Mail-Stack (Postfix, Dovecot, Rspamd, optional ClamAV, MariaDB, Redis, Nginx, SOGo, Web-UI) mit Docker und Docker Compose.

Wofür mailcow?

  • Eigenen Mailserver mit einer Admin-Oberfläche betreiben.
  • Domains, Postfächer, Aliase, Quotas zentral verwalten.

Zustellbarkeit braucht korrektes DNS (MX, SPF, DKIM, DMARC) und PTR passend zum Hostnamen. Siehe DNS-Voraussetzungen.

Offizielle Mindestanforderungen

Laut Prepare your system:

RessourceMinimum
RAM6 GiB + 1 GiB Swap
Disk20 GiB (ohne Postfächer)

Nicht unterstützt: OpenVZ, Virtuozzo, LXC, typische NAS-Geräte. Volle Virtualisierung (KVM, …) verwenden.

Ports 25, 80, 110, 143, 443, 465, 587, 993, 995, 4190 müssen frei sein:

Bash
ss -tlpn | grep -E -w '25|80|110|143|443|465|587|993|995|4190'

Optional in mailcow.conf: SKIP_CLAMD=y, SKIP_FTS=y für weniger RAM.

1 — Pakete (Debian/Ubuntu)

Bash
sudo apt update sudo apt install -y git openssl curl gawk coreutils grep jq

2 — Docker und Compose v2

Docker ≥ 24.0.0, Compose ≥ 2.0:

Bash
curl -sSL https://get.docker.com/ | CHANNEL=stable sudo sh sudo systemctl enable --now docker sudo apt update sudo apt install -y docker-compose-plugin

Prüfen: docker --version, docker compose version.

3 — Repository und Konfiguration

Bash
1sudo su 2umask 0022 3cd /opt 4git clone https://github.com/mailcow/mailcow-dockerized 5cd mailcow-dockerized 6./generate_config.sh

Bei fehlendem/kaputtem IPv6 (mailcow ab 2025-09): ENABLE_IPV6=false in mailcow.conf, dann Stack neu starten — Disable IPv6.

4 — Start

Bash
docker compose pull docker compose up -d

Admin: https://IHR_MAILCOW_HOSTNAME/admin — Standard admin / moohoo sofort ändern.

Absicherung

  1. Admin-Passwort ändern.
  2. 2FA aktivieren — Two-Factor Authentication.
  3. NTP/Zeit prüfen (timedatectl status).
  4. DKIM/SPF/DMARC setzen (DKIM aus der UI).
  5. Firewall: Hinweis in der mailcow-Doku zu UFW/firewalld und DOCKER-USERprerequisite-system.

Admin-Passwort zurücksetzen

Bash
cd /opt/mailcow-dockerized ./helper-scripts/mailcow-reset-admin.sh

Reset passwords

Weitere Links: Installation, GitHub.