Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Set Up Mailcow: Dockerized Email Server on Contabo VPS (Self-Hosted Guide)

Alex Vance
Alex VanceCloud Infrastructure Architect
November 02, 2026
•
16 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Set Up Mailcow: Dockerized Email Server on Contabo VPS (Self-Hosted Guide)
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Contabo High-Performance Cloud VPS

Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe

The Financial Burden of Enterprise Email SaaS

Google Workspace and Microsoft 365 charge between $7.20 and $18 per user per month. For a growing agency or business with 25 employees and several domain aliases, email licensing alone costs upwards of $2,000 to $5,000 annually. By deploying Mailcow: Dockerized on a high-RAM Contabo Cloud VPS, you can host thousands of mailboxes with enterprise spam filtering, modern webmail, and full data sovereignty for just $8.50 per month.

Server Requirements and Choosing the Right Contabo Tier

Mailcow is an enterprise-grade suite comprising Postfix, Dovecot, Nginx, MariaDB, Redis, Rspamd (spam filtering), and ClamAV (antivirus scanning). ClamAV alone requires at least 4 GB of RAM to hold virus signature databases in memory:

  • Recommended VPS: Contabo Cloud VPS 2 (6 vCPU cores, 16 GB RAM, 100 GB NVMe).
  • Operating System: Clean installation of Ubuntu 24.04 LTS.
  • Clean IP Address: Verify your allocated IP is not on Spamhaus or Barracuda blacklists.

Step 1: Setting Up Reverse DNS (rDNS / PTR Record)

Receiving mail servers (Gmail, Outlook, Yahoo) reject incoming emails if the sending server's IP does not resolve back to its Fully Qualified Domain Name (FQDN). On Contabo:

  1. Log in to the Contabo Customer Control Panel (CCP).
  2. Navigate to IP Management -> Reverse DNS.
  3. Locate your VPS IPv4 address and set the PTR value to your mail hostname (e.g. mail.yourdomain.com).
  4. Save changes and allow 1 hour for global DNS propagation.

Step 2: Configuring DNS Records at Your Registrar

Add the following mandatory records to your domain's DNS zone:

# Mail Host A Record
mail.yourdomain.com.    IN A        YOUR_CONTABO_IP

# Primary MX Record
yourdomain.com.         IN MX 10    mail.yourdomain.com.

# Autodiscover & Autoconfig for Outlook / Thunderbird
autodiscover.yourdomain.com. IN CNAME mail.yourdomain.com.
autoconfig.yourdomain.com.   IN CNAME mail.yourdomain.com.

# Sender Policy Framework (SPF)
yourdomain.com.         IN TXT      "v=spf1 mx a:mail.yourdomain.com ~all"

# DMARC Policy
_dmarc.yourdomain.com.  IN TXT      "v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com"

Step 3: Installing Docker & Git Dependencies

Connect to your Contabo VPS via SSH and prepare the host:

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git apt-transport-https ca-certificates gnupg

# Install Docker CE
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo systemctl enable --now docker

Step 4: Cloning Mailcow and Generating Configuration

Mailcow lives in /opt/mailcow-dockerized:

cd /opt
sudo git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized

# Run the interactive configuration generator
sudo ./generate_config.sh

During the script execution, enter:

  • Mail server hostname: mail.yourdomain.com
  • Timezone: UTC or your local timezone
  • Branch: master

Step 5: Pulling Images and Launching the Stack

Download the container images and launch Mailcow in background mode:

sudo docker compose pull
sudo docker compose up -d

Inspect the running containers to verify health status:

sudo docker compose ps

Step 6: Logging in to Mailcow Admin & Activating DKIM

  1. Open your browser and navigate to https://mail.yourdomain.com.
  2. Log in using default credentials: Username admin, Password moohoo (change immediately under Administrator settings).
  3. Go to Configuration -> Mail Setup -> Domains and click Add Domain.
  4. Under the DKIM tab, generate a 2048-bit DKIM key for your domain.
  5. Copy the public key value and publish it as a TXT record at dkim._domainkey.yourdomain.com.

Step 7: Testing Deliverability

Create a test mailbox, log in to SOGo webmail at https://mail.yourdomain.com/SOGo, and send a test message to mail-tester.com. With SPF, DKIM, DMARC, and Contabo's rDNS aligned, you will achieve a perfect 10/10 score.

Frequently Asked Questions (FAQ)

Does Contabo block port 25?

On new accounts, Contabo sometimes blocks outbound port 25 to prevent spam abuse. Simply open a quick ticket with Contabo support stating you are running a private business mail server; their team unblocks port 25 promptly once identity is verified.

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Host unlimited business email domains and mailboxes with zero per-user licensing fees
  • Contabo allows setting reverse DNS (PTR record) directly inside their Customer Control Panel
  • Includes modern SOGo webmail, CalDAV calendars, CardDAV contacts, and automated Let's Encrypt SSL
  • Contabo VPS 2 (16GB RAM) easily handles Mailcow's ClamAV anti-virus engine and spam filters

Drawbacks (Cons)

  • Requires unblocking outbound SMTP port 25 with your VPS host
  • Demands strict adherence to IP warmup and email deliverability practices
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Deploy Your Contabo Cloud Server

Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe
#Mailcow#Email Server#Contabo VPS#Docker#Self-Hosted
Alex Vance

Written by Alex Vance

Cloud Infrastructure Architect

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads