1. Prerequisites
- A Linux server (Ubuntu 20.04 or Debian 11 recommended).
- Root or sudo access.
- A valid domain with DNS records (A and MX).
- Open ports: 25, 465, 587 for SMTP; 143, 993 for IMAP.
2. Update the System
First, update and upgrade packages:
sudo apt update && sudo apt upgrade -y
3. Download iRedMail
Switch to the root directory and download the package:
cd /root wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.4.tar.gz
4. Extract Files
Unpack the tarball:
tar xvf 1.7.4.tar.gz cd iRedMail-1.7.4
5. Run the Installer
Execute the installation script:
bash iRedMail.sh
During installation, you will be prompted for:
- Mail storage path (default: /var/vmail).
- Webmail choice (Roundcube or SOGo).
- Database choice (MariaDB or PostgreSQL).
- Main mail domain (e.g., mail.example.com).
6. Configure DNS
Set up DNS records for proper mail delivery:
- A Record: mail.example.com → server IP
- MX Record: example.com → mail.example.com
- SPF: "v=spf1 mx ~all"
- DKIM: Public key generated by iRedMail
- DMARC: "v=DMARC1; p=none; rua=mailto:[email protected]"
7. Access Panels
- Webmail:
https://mail.example.com/mail/ - Admin Panel (iRedAdmin):
https://mail.example.com/iredadmin/
8. Security Tips
- Use strong passwords.
- Enable firewall (ufw or iptables).
- Install Fail2Ban to prevent brute-force attacks.
- Configure SSL certificates (e.g., Let’s Encrypt).
9. Testing
After installation:
- Send test emails to Gmail/Yahoo to verify delivery.
- Check logs in
/var/log/mail.log. - Validate DNS records using
digor online tools like MXToolbox.
Conclusion
iRedMail provides a fast and complete solution for deploying a mail server. Following these steps, you will have a system with SMTP, IMAP, webmail, anti-spam, and antivirus features. The most critical post-installation tasks are DNS configuration and securing the server to ensure reliable mail delivery.