Docs / Email Servers / How to Set Up Mailu All-in-One Email Server

How to Set Up Mailu All-in-One Email Server

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 32 views · 1 min read

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.env

Step 2: Edit the Environment File

nano /opt/mailu/mailu.env

Set these essential variables:

DOMAIN=yourdomain.com
HOSTNAMES=mail.yourdomain.com
SECRET_KEY=your-random-secret-key
SUBNET=192.168.203.0/24
TLS_FLAVOR=letsencrypt

Step 3: Launch the Stack

cd /opt/mailu
docker compose up -d

Step 4: Create the Admin Account

docker compose exec admin flask mailu admin admin yourdomain.com SecurePassword123

Access the admin panel at https://mail.yourdomain.com/admin.

DNS Records Required

  • MX: yourdomain.com pointing to mail.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

Was this article helpful?