Mailcow Dockerised is the most complete self-hosted email solution available — it packages Postfix, Dovecot, SOGo webmail, Rspamd anti-spam, ClamAV and an admin UI into a single Docker Compose stack.
Prerequisites
- Ubuntu 22.04 with minimum 3GB RAM
- Docker and Docker Compose installed
- A domain with DNS control
- Ports 25, 80, 443, 465, 587, 993, 995 open
Step 1 — Install Docker
curl -fsSL https://get.docker.com | sh
sudo systemctl enable docker --now
Step 2 — Clone Mailcow
cd /opt
sudo git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
Step 3 — Generate Configuration
sudo ./generate_config.sh
Enter your mail hostname when prompted e.g. `mail.yourdomain.com`
Step 4 — Start Mailcow
sudo docker compose pull
sudo docker compose up -d
First startup takes 5-10 minutes to pull all images.
Step 5 — Access Admin UI
https://mail.yourdomain.com
Default credentials: admin / moohoo — change immediately!
Step 6 — Configure DNS Records
# Required DNS records
mail.yourdomain.com A YOUR_SERVER_IP
yourdomain.com MX 10 mail.yourdomain.com
yourdomain.com TXT "v=spf1 mx ~all"
_dmarc.yourdomain.com TXT "v=DMARC1; p=quarantine; rua=mailto:[email protected]"
# DKIM — get key from Mailcow admin UI
# Configuration → Domains → your domain → DKIM
Step 7 — Add Domain and Mailbox
Mailcow Admin → Configuration → Mail Setup → Domains → Add domain
Then → Mailboxes → Add mailbox
Step 8 — Enable Auto-Update
sudo crontab -e
0 4 * * * cd /opt/mailcow-dockerized && sudo docker compose pull && sudo docker compose up -d 2>&1
Conclusion
Mailcow is the best self-hosted email solution in 2022. Our team provides Mailcow installation and management services.
Comments