SharpMailserver SHARPMAILSERVER
19 Step-by-Step Docker Compose, OS, NAS & Hoster Guides

Deploy via Docker Compose, Windows Service (No Docker), Linux, NAS, Proxmox & Major Hosters

Pick your exact platform: from ready-to-run Docker Compose examples and a native Windows Server Service without Docker to Proxmox VE, Raspberry Pi, Synology, ASUSTOR, UGREEN, TerraMaster, and Unraid, plus exact PTR & firewall setup on netcup, Hetzner, IONOS, ALL-INKL.COM, Hostinger, Strato, and OVHcloud.

Docker & Docker Compose (Linux, Windows, macOS & NAS)

Official multi-arch OCI image (linux/amd64 & linux/arm64) · Live in 60 seconds with SQLite WAL or full Enterprise stack with PostgreSQL, S3 Object Lock & OpenTelemetry

Docker Compose
  1. Option A: Zero-Config Single-Container Compose (SQLite WAL + Zstandard): Ideal for up to thousands of mailboxes on a single VPS, dedicated server, or NAS with zero external database dependencies and ~58 MB idle RAM.
  2. Option B: Enterprise Production Compose (PostgreSQL 17 + MinIO/S3 WORM + ClamAV + OpenTelemetry): Horizontal scaling, GoBD-compliant S3 Object Lock, antivirus scanning, and OpenTelemetry OTLP traces, metrics & logs.
# === VARIANTE A: Kompakter Single-Container Stack (docker-compose.yml) ===
services:
  sharpmail:
    image: registry.sharpmailserver.com/sharpmailserver:latest
    container_name: sharpmailserver
    hostname: mail.firma.de
    restart: unless-stopped
    ports:
      - "25:25"       # ESMTP Inbound (MX)
      - "465:465"     # SMTPS Submission (Implicit TLS)
      - "587:587"     # SMTP Submission (STARTTLS)
      - "143:143"     # IMAP4rev2 (STARTTLS)
      - "993:993"     # IMAPS (Implicit TLS)
      - "4190:4190"   # ManageSieve (Filter & Abwesenheit)
      - "80:80"       # Let's Encrypt HTTP-01 & Autoconfig
      - "443:443"     # Admin-Cockpit, Webmail PWA, JMAP & REST API
    environment:
      Urls: "http://0.0.0.0:80;https://0.0.0.0:443"
      Bootstrap__DefaultDomain: "firma.de"
      Bootstrap__AdminEmail: "admin@firma.de"
      Bootstrap__AdminPassword: "BitteSofortAendern!2026"
      Storage__Provider: "Sqlite"
      Storage__DataDirectory: "/var/lib/sharpmail"
      Storage__BlobBackend: "FileSystem"
      Storage__Compression: "Zstd"
      Smtp__ServerHostName: "mail.firma.de"
      Imap__ServerHostName: "mail.firma.de"
      OpenTelemetry__Enabled: "true"
      OpenTelemetry__ServiceName: "SharpMailserver"
    volumes:
      - ./sharpmail-data:/var/lib/sharpmail

# Starten mit:
# docker compose up -d && docker compose logs -f sharpmail
# === VARIANTE B: Enterprise Stack mit PostgreSQL 17, S3 Object Lock & OpenTelemetry ===
services:
  sharpmail:
    image: registry.sharpmailserver.com/sharpmailserver:latest
    restart: unless-stopped
    depends_on: [postgres, otel-collector]
    ports: ["25:25", "465:465", "587:587", "993:993", "4190:4190", "80:80", "443:443"]
    environment:
      Urls: "http://0.0.0.0:80;https://0.0.0.0:443"
      Storage__Provider: "Postgres"
      Storage__PostgresConnectionString: "Host=postgres;Database=sharpmail;Username=sharpmail;Password=${PG_PASSWORD}"
      Storage__BlobBackend: "Hybrid"
      Storage__Compression: "Zstd"
      Storage__S3Endpoint: "https://s3.eu-central-1.ionoscloud.com"
      Storage__S3Bucket: "firma-gobd-mail-archive"
      OpenTelemetry__Enabled: "true"
      OpenTelemetry__ServiceName: "SharpMailserver-Prod"
      OpenTelemetry__OtlpEndpoint: "http://otel-collector:4317"
    volumes:
      - sharpmail-nvme-cache:/var/lib/sharpmail

  postgres:
    image: postgres:17-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: sharpmail
      POSTGRES_USER: sharpmail
      POSTGRES_PASSWORD: "${PG_PASSWORD}"
    volumes:
      - pg-data:/var/lib/postgresql

  otel-collector:
    image: otel/opentelemetry-collector-contrib:latest
    restart: unless-stopped
    ports: ["127.0.0.1:4317:4317"]

volumes:
  sharpmail-nvme-cache:
  pg-data:

Windows Server (2019 / 2022 / 2025) Native Windows Service Without Docker

True Windows Service Control Manager (SCM) daemon with zero Docker, Hyper-V, or WSL2 overhead

Native Windows Service
  1. Create program & data directories: Extract the win-x64 release archive into C:\SharpMailserver\bin and create C:\SharpMailserver\data on local NVMe storage.
  2. Grant least-privilege NTFS permissions: Run under NT AUTHORITY\NetworkService rather than LocalSystem, granting write access strictly to the data folder.
  3. Create appsettings.Production.json: Use zero-dependency SQLite WAL out of the box, or point to your PostgreSQL cluster and S3 bucket.
  4. Open Windows Firewall ports & register the Windows Service with auto-recovery: Run the following Administrator PowerShell script:
# 1. Verzeichnisse & sichere NTFS-Berechtigungen für NetworkService einrichten
New-Item -ItemType Directory -Force -Path "C:\SharpMailserver\bin", "C:\SharpMailserver\data" | Out-Null
icacls "C:\SharpMailserver\data" /grant "NT AUTHORITY\NetworkService:(OI)(CI)M" /T

# 2. appsettings.Production.json erstellen (SQLite WAL oder PostgreSQL, kein Docker nötig)
@'
{
  "Urls": "http://0.0.0.0:80;https://0.0.0.0:443",
  "Bootstrap": {
    "DefaultDomain": "firma.de",
    "AdminEmail": "admin@firma.de",
    "AdminPassword": "BitteSofortAendern!2026"
  },
  "Storage": {
    "Provider": "Sqlite",
    "DataDirectory": "C:\\SharpMailserver\\data",
    "BlobBackend": "LocalFileSystem",
    "Compression": "Zstd"
  },
  "Smtp": { "Enabled": true, "BindAddress": "0.0.0.0", "MxPort": 25, "SmtpsPort": 465, "SubmissionPort": 587 },
  "Imap": { "Enabled": true, "BindAddress": "0.0.0.0", "ImapPort": 143, "ImapsPort": 993 },
  "ManageSieve": { "Enabled": true, "BindAddress": "0.0.0.0", "Port": 4190 }
}
'@ | Set-Content -Path "C:\SharpMailserver\bin\appsettings.Production.json" -Encoding UTF8

# 3. Eingehende Ports in der Windows Defender Firewall freischalten
New-NetFirewallRule -DisplayName "SharpMailserver Mail & HTTPS" -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 25,80,143,443,465,587,993,4190

# 4. Als nativen Windows-Dienst registrieren, Auto-Restart bei Fehlern aktivieren & starten
New-Service -Name "SharpMailserver" `
  -BinaryPathName '"C:\SharpMailserver\bin\SharpMailserver.Server.exe" --contentRoot "C:\SharpMailserver\bin"' `
  -DisplayName "SharpMailserver Enterprise Mail & GoBD Service" `
  -StartupType Automatic `
  -Credential "NT AUTHORITY\NetworkService"

sc.exe failure SharpMailserver reset= 86400 actions= restart/5000/restart/5000/restart/10000
Start-Service -Name "SharpMailserver"
Get-Service -Name "SharpMailserver"
# Admin-Cockpit: https://mail.firma.de/admin/  |  Webmail: https://mail.firma.de/mail/
# Hinweis bei aktivem IIS auf Port 80/443: Urls auf "http://127.0.0.1:5080" stellen und IIS Reverse-Proxy nutzen.

Linux Native Daemon Without Docker (systemd)

Debian · Ubuntu · RHEL · Rocky
  1. Create dedicated system user: Runs non-root with CAP_NET_BIND_SERVICE for ports 25/443.
  2. Enable native Type=notify systemd unit: Integrates natively with journald and systemd readiness.
sudo useradd -r -s /usr/sbin/nologin -d /var/lib/sharpmail sharpmail
sudo mkdir -p /opt/sharpmail /var/lib/sharpmail
sudo chown -R sharpmail:sharpmail /var/lib/sharpmail

# /etc/systemd/system/sharpmail.service
[Unit]
Description=SharpMailserver Enterprise Service
After=network-online.target

[Service]
Type=notify
User=sharpmail
WorkingDirectory=/opt/sharpmail
ExecStart=/opt/sharpmail/SharpMailserver.Server
AmbientCapabilities=CAP_NET_BIND_SERVICE
Environment=Storage__DataDirectory=/var/lib/sharpmail
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

sudo systemctl enable --now sharpmail

macOS (Apple Silicon M1-M4 & Intel)

macOS · ARM64 · launchd
  1. Native Apple Silicon ARM64: Ideal for office Mac mini / Mac Studio servers and local staging on MacBook Pro.
  2. Run persistently via launchd: Starts automatically on boot with ~58 MB RAM usage.
sudo mkdir -p /usr/local/sharpmail /var/lib/sharpmail
sudo xattr -dr com.apple.quarantine /usr/local/sharpmail

# /Library/LaunchDaemons/com.sharpmailserver.daemon.plist
# ProgramArguments: /usr/local/sharpmail/SharpMailserver.Server
# KeepAlive: true, RunAtLoad: true
sudo launchctl bootstrap system /Library/LaunchDaemons/com.sharpmailserver.daemon.plist

# Alternativ via OrbStack / Docker Desktop auf macOS:
docker run -d --name sharpmail -p 2525:25 -p 2993:993 -p 8080:8080 \
  -v ~/sharpmail-data:/var/lib/sharpmail \
  registry.sharpmailserver.com/sharpmailserver:latest

Kubernetes (EKS, AKS, GKE, K3s, OpenShift, Rancher) & Rootless Podman

Helm · StatefulSet · Podman · CRI-O
  1. Cloud-Native HA Architecture: Backed by PostgreSQL and S3 Object Lock, multiple replicas scale behind an L4 LoadBalancer with PROXY protocol v2 preserving client IPs for SPF/CIDR checks.
  2. Native Probes & OpenMetrics: Built-in GET /health probes and GET /metrics for Prometheus Operator.
# Kubernetes via Helm installieren (AWS EKS, Azure AKS, Google GKE, K3s, OpenShift)
helm repo add sharpmail https://charts.sharpmailserver.com
helm upgrade --install sharpmail sharpmail/sharpmailserver -n mail --create-namespace \
  --set replicaCount=2 \
  --set storage.provider=Postgres \
  --set storage.blobBackend=S3 \
  --set service.externalTrafficPolicy=Local

# Alternativ: Rootless Podman Quadlet (RHEL 9 / Fedora / AlmaLinux ohne Docker-Daemon)
podman run -d --name sharpmail --restart=always \
  -p 25:25 -p 465:465 -p 587:587 -p 993:993 -p 4190:4190 -p 8443:8443 \
  -v /var/lib/sharpmail:/var/lib/sharpmail:Z \
  registry.sharpmailserver.com/sharpmailserver:latest
Virtualization, ARM64 & NAS Appliances

Installation on Proxmox, Raspberry Pi, Synology, ASUSTOR, UGREEN, TerraMaster & Unraid

Proxmox VE (LXC & KVM)

Proxmox VE 8+ · ZFS / NVMe
  1. LXC Container erstellen: Create an unprivileged Debian 12 LXC container (2 vCPU, 1024 MB RAM) with a ZFS/NVMe mountpoint at /var/lib/sharpmail.
  2. Nativ oder per Docker: Inside LXC, run the native systemd service for zero nested container overhead and instant Proxmox Backup Server snapshots.
  3. Proxmox Firewall: Allow inbound TCP 25, 465, 587, 993, 4190, 80, 443 in Datacenter/CT Firewall.
# Auf dem Proxmox-Host (erstellt schlanken Debian-LXC CT 210):
pct create 210 local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \
  --hostname mail --cores 2 --memory 1024 --net0 name=eth0,bridge=vmbr0,ip=dhcp \
  --storage local-zfs --rootfs local-zfs:32 --unprivileged 1 --start 1
pct exec 210 -- bash -c "curl -fsSL https://sharpmailserver.com/install.sh | sh"

Raspberry Pi 4 & Raspberry Pi 5

linux/arm64 · ~58 MB RAM
  1. 64-Bit OS & NVMe statt SD-Karte: Use 64-bit Raspberry Pi OS Lite and place /var/lib/sharpmail on an M.2 NVMe HAT or USB 3 SSD rather than a microSD card.
  2. Heimanschluss-Tipp (Smarthost): On residential dynamic IPs, set Smtp__OutboundSmartHost to your ISP/hoster relay for 100% inbox delivery.
# Nativer ARM64-Container auf Raspberry Pi 4 / 5:
sudo mkdir -p /mnt/nvme/sharpmail
docker run -d --name sharpmail --restart unless-stopped \
  -p 25:25 -p 465:465 -p 587:587 -p 993:993 -p 4190:4190 -p 8443:8443 \
  -v /mnt/nvme/sharpmail:/var/lib/sharpmail \
  -e Bootstrap__DefaultDomain="familie.de" \
  registry.sharpmailserver.com/sharpmailserver:latest

Synology NAS (DSM 7.2+)

Container Manager · Btrfs
  1. Ordner in File Station erstellen: Create /volume1/docker/sharpmail in File Station on your Btrfs/SSD volume.
  2. Synology MailPlus-Portkonflikt vermeiden: Ensure Synology MailPlus is stopped so ports 25, 465, 587, and 993 are free.
  3. Container Manager öffnen: Open Container Manager -> Project -> Create, select /volume1/docker/sharpmail, and paste:
services:
  sharpmail:
    image: registry.sharpmailserver.com/sharpmailserver:latest
    container_name: sharpmail
    restart: unless-stopped
    ports:
      - "25:25"
      - "465:465"
      - "587:587"
      - "993:993"
      - "4190:4190"
      - "8443:8443"
    volumes:
      - /volume1/docker/sharpmail:/var/lib/sharpmail
    environment:
      Storage__Provider: "Sqlite"
      Storage__Compression: "Zstd"

ASUSTOR NAS (ADM 4.x)

App Central · Docker-CE · Portainer
  1. Docker-CE & Portainer CE installieren: Install Docker-CE and Portainer CE from ADM App Central.
  2. Persistenter Ordner: Create /volume1/Docker/sharpmail in ADM File Explorer.
  3. Portainer Stack starten: Deploy a new Stack in Portainer mapping /volume1/Docker/sharpmail:/var/lib/sharpmail and allow mail ports in ADM Defender.
mkdir -p /volume1/Docker/sharpmail
docker run -d --name sharpmail --restart unless-stopped \
  -p 25:25 -p 465:465 -p 587:587 -p 993:993 -p 8443:8443 \
  -v /volume1/Docker/sharpmail:/var/lib/sharpmail \
  registry.sharpmailserver.com/sharpmailserver:latest

UGREEN NASync (UGOS Pro)

UGOS Pro · Docker Projekt
  1. NVMe-Speicherpool nutzen: On UGREEN NASync DXP models, place /volume1/docker/sharpmail on your M.2 NVMe pool for instant search.
  2. UGOS Pro Docker-App: Open UGOS Pro Docker -> Project -> Create, paste the Compose file, and click Deploy.
# UGOS Pro -> Docker -> Projekt -> Compose-Konfiguration:
services:
  sharpmail:
    image: registry.sharpmailserver.com/sharpmailserver:latest
    restart: always
    ports: ["25:25", "465:465", "587:587", "993:993", "4190:4190", "8443:8443"]
    volumes:
      - ./data:/var/lib/sharpmail

TerraMaster NAS (TOS 5 / TOS 6)

TOS Docker Manager
  1. Docker Manager installieren: Install Docker Manager from TOS App Center and create /Volume1/docker/sharpmail.
  2. Projekt bereitstellen: In Docker Manager -> Projects -> Add, paste the YAML stack and start.
volumes:
  - /Volume1/docker/sharpmail:/var/lib/sharpmail
# Admin-Cockpit nach Start: https://TERRAMASTER-IP:8443/admin/

Unraid Server (6.12+ / 7.x)

Unraid · Cache NVMe · Custom br0
  1. Appdata auf Cache-NVMe pinnen: Map /mnt/cache/appdata/sharpmail so parity array disks can spin down while indexes run at NVMe speed.
  2. Eigene LAN-IP über Netzwerktyp Custom: br0 (Empfohlen): Assign Network Type: Custom br0 with a dedicated LAN IP so ports 80/443/25 never collide with the Unraid WebGUI.
# Unraid Terminal oder Docker Compose Manager Plugin:
docker run -d --name SharpMailserver --net=br0 --ip=192.168.178.25 --restart=unless-stopped \
  -v /mnt/cache/appdata/sharpmail:/var/lib/sharpmail \
  -e Urls="http://0.0.0.0:80;https://0.0.0.0:443" \
  -e Bootstrap__DefaultDomain="firma.de" \
  registry.sharpmailserver.com/sharpmailserver:latest
Hosting Provider & DNS Guides

Setup Guides for netcup, Hetzner, IONOS, ALL-INKL.COM, Hostinger, Strato & OVHcloud

Achieving 100% inbox placement with Gmail, Outlook, and corporate gateways requires three hoster settings: outbound port 25 access, matching IPv4/IPv6 PTR reverse DNS, and clean SPF/DKIM/DMARC records.

netcup.de (Root-Server & VPS)

SCP · CCP DNS · Port 25 offen
  1. Reverse-DNS (PTR) im SCP setzen: In netcup SCP -> Network, set Reverse DNS (PTR) for both your IPv4 and primary IPv6 address to mail.yourdomain.de.
  2. DNS im CCP pflegen: In netcup CCP -> Domains -> DNS, add A, AAAA, MX (prio 10), SPF, and DKIM TXT records.
  3. Installation: Deploy Debian 12 or Windows Server ISO in SCP and install natively or via Docker.

hetzner.de (Cloud CX/CAX & Dedicated)

Cloud Console · x64 & Ampere ARM64
  1. Port 25 & 465 Hinweis bei Neukunden: New Hetzner Cloud accounts block outbound 25/465 initially; request the port unblock via Cloud Console -> Limits after your first invoice.
  2. IPv4 & IPv6 PTR setzen: In Hetzner Cloud Console -> Networking -> Edit Reverse DNS on both Primary IPv4 and IPv6::1 to mail.yourdomain.de.
  3. Preis-Leistungs-Tipp: Runs natively on ultra-efficient Hetzner CAX ARM64 instances and pairs directly with Hetzner S3 Object Storage.

ionos.de (VPS & Cloud Server)

IONOS Cloud Panel · S3 Object Lock
  1. Externe IONOS-Firewall öffnen: Open IONOS Cloud Panel -> Network -> Firewall Policies and allow inbound TCP 25, 80, 443, 465, 587, 993, and 4190.
  2. Reverse-DNS konfigurieren: Set Reverse DNS under Network -> Public IPs to mail.yourdomain.de once the A record resolves.
  3. GoBD-Archiv mit IONOS S3: Pair with IONOS S3 Object Storage in Frankfurt/Berlin with native S3 Object Lock (COMPLIANCE).

ALL-INKL.COM (KAS DNS & Smarthost)

KAS DNS-Werkzeuge · Smarthost
  1. Variante A (Domain bei ALL-INKL, SharpMailserver auf VPS/Firmen-IP): In ALL-INKL KAS -> Tools -> DNS Tools, point A/AAAA for mail and MX to your SharpMailserver IP, and add SPF/DKIM/DMARC TXT records.
  2. Variante B (SharpMailserver im Büro / NAS mit ALL-INKL als Versand-Relay): Running SharpMailserver on an office NAS/Proxmox behind dynamic IP? Configure w01abc.kasserver.com:587 as Smtp__OutboundSmartHost and add include:_spf.kasserver.com to SPF.

Hostinger (KVM VPS & hPanel)

hPanel · KVM 2 / KVM 4
  1. PTR Record im VPS-Dashboard: In Hostinger hPanel -> VPS -> IP Addresses, set the PTR record to mail.yourdomain.de.
  2. Port 25 / Relay beachten: Verify outbound port 25 is unlocked on your KVM plan, or configure an authenticated port 587 Smarthost in SharpMailserver.
  3. hPanel DNS Zone Editor: Replace default MX entries in hPanel DNS Zone Editor with mail.yourdomain.de and your SPF/DKIM/DMARC TXT records.

Strato (V-Server Linux/Windows & Dedicated)

STRATO Server-Login · Windows & Linux
  1. Beliebt für Windows Server ohne Docker: On STRATO Windows V-Servers, install directly as a native Windows Service using the PowerShell script above.
  2. Reverse-DNS im STRATO Server-Login: In STRATO Server Login -> IP Addresses, set Reverse DNS for IPv4 and IPv6 to mail.yourdomain.de.
  3. STRATO Domainverwaltung: In STRATO Domain Management -> DNS Settings, switch MX to custom mail server (mail.yourdomain.de) and add TXT records.

OVHcloud (VPS, Dedicated & Public Cloud)

OVHcloud Control Panel · EU S3 WORM
  1. Wichtige Reihenfolge für OVHcloud PTR: OVHcloud validates forward DNS before accepting a PTR change: create A and AAAA records for mail.yourdomain.de first, then set Reverse DNS under Network -> Public IPs.
  2. Edge Network Firewall & S3 Object Lock: Allow mail ports in OVHcloud Edge Network Firewall and optionally connect OVHcloud S3 Object Storage (Limburg/Strasbourg) for immutable GoBD WORM archiving.