What Is Mailu?
Mailu is an open-source, Docker-based email server suite that bundles SMTP, IMAP, webmail, antivirus, and antispam into a cohesive system. It provides a web administration interface and is well-suited for self-hosting email on a Breeze without managing each component individually.
Prerequisites
- A Breeze with at least 2 GB RAM running Ubuntu 22.04+
- Docker and Docker Compose installed
- A domain with MX, SPF, DKIM, and DMARC DNS records configured
- Ports 25, 465, 587, 993, and 443 open
Step 1: Generate the Configuration
Use the Mailu setup utility to generate your configuration files:
mkdir -p /opt/mailu
cd /opt/mailu
wget https://setup.mailu.io/2024.06/file/docker-compose.yml
wget https://setup.mailu.io/2024.06/file/mailu.envStep 2: Edit the Environment File
nano /opt/mailu/mailu.envSet these essential variables:
DOMAIN=yourdomain.com
HOSTNAMES=mail.yourdomain.com
SECRET_KEY=your-random-secret-key
SUBNET=192.168.203.0/24
TLS_FLAVOR=letsencryptStep 3: Launch the Stack
cd /opt/mailu
docker compose up -dStep 4: Create the Admin Account
docker compose exec admin flask mailu admin admin yourdomain.com SecurePassword123Access the admin panel at https://mail.yourdomain.com/admin.
DNS Records Required
- MX:
yourdomain.compointing tomail.yourdomain.com - SPF:
v=spf1 mx -all - DKIM: Copy the key from the admin panel under Mail domains > Details
- DMARC:
v=DMARC1; p=quarantine; rua=mailto:postmaster@yourdomain.com