This is a complete guide on how to install iRedMail on Debian 11 / Debian 10 Linux Server. iRedMail is a powerful, open source and easy to deploy and manage Mail solution that runs on Linux, FreeBSD and OpenBSD systems. iRedMail comes with an intuitive web interface where system administrators can create and manage mailboxes – users and domains.
Installation on CentOS 7: How To Install iRedMail Mail Server on CentOS 7
Features of iRedMail Mail Server
- Fully Open Source: All iRedMail components are
built from open source applications. It has bee certified to run on Red
Hat Enterprise Linux, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD. - Top Security:
All mail services are accessed through secured connections – Use of TLS
to access POP3, IMAP and SMTP services. Web portals are access via
HTTPS. Emails are encrypted in transit using TLS if possible. - Access to Webmail:
An intuitive web portal is available for accessing and managing mails,
folders, sieve filters – (Roundcube webmail or/and SOGo groupware). - Unlimited Accounts: You have the powers to create as many mail accounts (domains, users, mailing lists, admins) as you want.
- Web Admin Panel: As admin user, you get a web admin panel where you manage mail accounts.
- Antispam & Antivirus:
SpamAssassin, ClamAV, SPF, DKIM, greylisting, whitelisting,
blacklisting. Quarantining detected spam into SQL database for further
review. - Support for OpenLDAP, MySQL, MariaDB, and PostgreSQL backend store for mail accounts. Choose what you like.
Before you begin
These are the basic requirements for installing iRedMail on Debian 10 / Debian 11 Linux.
- Fresh Installation of Debian 11 / Debian 10 Linux
- 2 GB of memory required. If you plan to use it in production environment with multiple domains and user accounts, the add more memory – 4 GB+
- Make sure 3 UID/GID are not used by other user/group: 2000, 2001, 2002.
- Mail Server domain name
- A sudo user account – User account added to sudo group or root user access
So relax as you start installation of iRedMail Mail Server onDebian 11 / Debian 10 with these easy to follow steps.
Step 1: Update System
Ensure your system is running the latest version of the operating system.
sudo apt -y update
sudo apt -y upgrade
After a system upgrade, we recommend doing a reboot.
sudo systemctl reboot
Step 2: Set your server hostname
Set server hostname to a subdomain name configured in your DNS server.
export HOSTNAME="mail.geeksforgeeks.org"
sudo hostnamectl set-hostname $HOSTNAME --static
sudo hostnamectl set-hostname $HOSTNAME --transient
After updating your hostname, logout and login again to update your working environment.
$ logout
Now add the IP address and DNS name mapping to the /etc/hosts file.
# Example
$ sudo vim /etc/hosts
95.216.98.16 mail.geeksforgeeks.org
To confirm DNS resolution, first install dns-utils package.
sudo apt -y install dnsutils
Then use host command for local resolution.
$ host mail.geeksforgeeks.org
mail.geeksforgeeks.org has address 95.216.98.16
For record in DNS server, use the dig command.
dig A mail.geeksforgeeks.org
Step 3: Download the latest release of iRedMail
Visit the iRedMail Download page to get the latest stable release of iRedMail for your platform.
sudo apt -y install wget
wget https://github.com/iredmail/iRedMail/archive/1.x.y.tar.gz
Extract the downloaded archive file.
tar xvf *.tar.gz
Step 4: Install iRedMail onDebian 11 / Debian 10
An installer script is provided for automated installation of iRedMail Mail Server onDebian 11 / Debian 10. Change the working directory to the folder created.
cd iRedMail-*/
Start iRedMail installer.
chmod +x iRedMail.sh
sudo ./iRedMail.sh
The installer script will install dependencies required then ask you several simple questions required to setup iRedMail mail server onDebian 11 / Debian 10 Linux system.
1 – Accept installation wizard
The first screen asks you whether to accept or decline installation of iRedMail on Debian.
2 – Specify directory used to store mailboxes
Make sure you read the NOTES provided before changing default mailboxes store directory.
3 – Choose web server to use
Go with the default selection of nginx.
4 – Choose backend used to store mail account
Choose the one you’re familiar with for easier management and maintenance after installation. I’ll go with OpenLDAP.
5 – Specify LDAP Suffix
If you chose OpenLDAP as default backend for storing mail accounts,
provide LDAP suffix. These are just components of your domain name.
6 – Set MySQL root password
Provide the password for MySQL root user.
7 – Add your first mail domain name
Provide your Mail domain name – This cannot be the same as server name.
7 – Provide Password for Mail domain Administrator
Input the mail domain administrator password and tick the features to enable.
Review provided values and start installation.
***************************** WARNING ***********************************
*************************************************************************
* *
* Below file contains sensitive infomation (username/password), please *
* do remember to *MOVE* it to a safe place after installation. *
* *
* * /home/debian/iRedMail-1.0/config
* *
*************************************************************************
********************** Review your settings *****************************
*************************************************************************
* Storage base directory: /var/vmail
* Mailboxes:
* Daily backup of SQL/LDAP databases:
* Store mail accounts in: OpenLDAP
* Web server: Nginx
* First mail domain name: geeksforgeeks.org
* Mail domain admin: [email protected]
* Additional components: Roundcubemail SOGo netdata iRedAdmin Fail2ban
< Question > Continue? [y|N] y
Type y
or Y
and press Enter
to start installation. The script will install and configure all the packaged required automatically.
You can choose to enable iRedMail firewall.
*************************************************************************
* iRedMail-1.x.y installation and configuration complete.
*************************************************************************
< Question > Would you like to use firewall rules provided by iRedMail?
< Question > File: /etc/default/iptables, with SSHD ports: 22. [Y|n]y
[ INFO ] Copy firewall sample rules.
< Question > Restart firewall now (with ssh ports: 22)? [y|N]y
[ INFO ] Restarting firewall ...
[ INFO ] Updating ClamAV database (freshclam), please wait ...
.....
Reboot your Server to enable mail services.
sudo systemctl reboot
Step 5: iRedMail Access Credentials
Your iRedMail Server details & Access credentials are store in the file “/root/iRedMail-1.x.y/config” if script was run as root user or “/home/$USER/iRedMail-1.x.y/config” if the script was executed as normal user.
The URLs of installed web applications are shown after a successful installation of iRedMail onDebian 11 / Debian 10.
- Roundcube webmail: https://your_server/mail/
- SOGo Groupware: https://your_server/SOGo
- Web admin panel (iRedAdmin): httpS://your_server/iredadmin/
- Awstats: httpS://your_server/awstats/awstats.pl?config=web (or
?config=smtp
for SMTP traffic log)
My output looks like below.
********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://mail.geeksforgeeks.org/mail/
* - SOGo groupware: https://mail.geeksforgeeks.org/SOGo/
* - netdata (monitor): https://mail.geeksforgeeks.org/netdata/
*
* - Web admin panel (iRedAdmin): https://mail.geeksforgeeks.org/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: [email protected]
* - Password: password
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
* - /home/debian/iRedMail-1.0/iRedMail.tips
*
* And it's sent to your mail account [email protected].
*
********************* WARNING **************************************
Login to the portals using the credentials saved.
Here is the default look of iRedMail Admin dashboard on initial login.
Access Mail Client on /mail.
Step 6: Secure iRedMail With Let’s Encrypt SSL Certificates
iRedMail generates self-signed certificates during installation, you have an option of getting a Commercial certificate or using Let’s Encrypt free SSL Certificates. Refer to our guide below.
More guides on iRedMail: