Docs / Email Servers / Setting Up a Complete Mail Server with Mailcow

Setting Up a Complete Mail Server with Mailcow

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 30 views · 1 min read

What is Mailcow?

Mailcow is a Docker-based mail server suite that bundles Postfix, Dovecot, SOGo webmail, rspamd, ClamAV, and more into a single easy-to-deploy package. It provides a polished web UI for managing domains, mailboxes, and aliases.

Requirements

  • A server with at least 4 GB RAM
  • Docker and Docker Compose installed
  • A domain with proper DNS records (A, MX, PTR)
  • Ports 25, 80, 443, 143, 993, 110, 995, 587, 465 available

Installation

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

When prompted, enter your mail server's hostname (e.g., mail.example.com).

docker compose pull
docker compose up -d

Initial Configuration

  1. Access the admin UI at https://mail.example.com
  2. Default login: admin / moohoo (change immediately)
  3. Add your domain under Configuration → Mail Setup → Domains
  4. Create mailboxes under Mailboxes
  5. Let's Encrypt SSL is configured automatically

DNS Records Needed

  • A record: mail.example.com → YOUR_IP
  • MX record: example.com → mail.example.com (priority 10)
  • SPF: v=spf1 mx ~all
  • DKIM: Copy from Mailcow admin panel
  • DMARC: v=DMARC1; p=quarantine; rua=mailto:postmaster@example.com
  • PTR: Reverse DNS for your server IP

Was this article helpful?