This guide describes how to install and configure a single-node iRedMail mail server from scratch.
Before installation, gather the following details from the client:
- Fully Qualified Domain Name (FQDN) for the mail server (e.g.,
mail.example.com) - Access to manage DNS records (A, MX, SPF, DKIM, DMARC, PTR)
- Public domain ownership confirmation
- Decide whether to use Let's Encrypt or a custom SSL certificate
- If custom SSL: provide
fullchain.pemandprivkey.pem
- Static public IP address
- SSH credentials
- Operating system version (e.g., Ubuntu 22.04, Rocky Linux 9, etc.)
- Hostname must be set correctly
- List of mail domains to host (e.g.,
example.com) - Initial mailboxes and aliases
- Mailbox quota policy
- Disk size and layout plan
- Partition for
/var/vmailwith enough space for email storage
- Is backup required?
- Should spam/virus filtering be enabled (Rspamd, ClamAV)?
- Firewall rules (open ports 25, 587, 993, 443, etc.)
sudo apt update && sudo apt upgrade -y # Ubuntu/Debian
sudo dnf update -y # Rocky Linux
hostnamectl set-hostname mail.example.com
echo "192.0.2.10 mail.example.com mail" >> /etc/hostscd /opt/
wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.6.9.tar.gz
tar xzf 1.6.9.tar.gz
cd iRedMail-1.6.9/
chmod +x iRedMail.shReplace
1.6.9with the latest version from iRedMail Downloads
sudo bash iRedMail.shYou will be prompted to choose:
- Mail storage path (default:
/var/vmail) - Web server (Nginx or Apache)
- Backend (MariaDB, PostgreSQL, or OpenLDAP)
- Mail domain(s) and admin account password
Configure DNS for your mail domain:
| Record Type | Name | Value |
|---|---|---|
| A | 192.0.2.10 | |
| MX | @ | mail.example.com (priority 10) |
| TXT | @ | v=spf1 mx ~all |
| TXT | _dmarc | v=DMARC1; p=none |
| TXT | default._domainkey | (value generated by DKIM setup) |
Ensure reverse DNS (PTR) record points to mail.example.com.
sudo ufw allow 22,25,80,443,587,993/tcp
sudo ufw enable- Admin Panel:
https://mail.example.com/iredadmin - Default Admin:
postmaster@example.com - Webmail:
https://mail.example.com/mail(Roundcube)
- Enable DKIM (auto-configured by installer)
- Configure regular backups
- Monitor email queues and logs
- Keep system packages updated
- Use Fail2Ban or similar tools for brute-force protection
- Log location:
/var/log/maillog,/var/log/clamav,/var/log/fail2ban.log - Mail data:
/var/vmail - Backup your database and
/var/vmailregularly