Install and set up iRedMail mail server on Debian 10 (Buster)

This is a complete guide on how to install iRedMail on Debian 10 (Buster) Linux. iRedMail is a powerful, open source and easy to deploy and manage email 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

  • Completely open source: All iRedMail components are
    Built from open source applications. Its bees are certified to run on red
    Hat Enterprise Linux, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD.
  • Highest security:
    Access all mail services over a secure connection-use TLS
    Access to POP3, IMAP and SMTP services. You can access the web portal by
    HTTPS. If possible, use TLS to encrypt the email during transmission.
  • Access webmail:
    Intuitive web portal can be used to access and manage mail,
    Folders, sieve filters – (Roundcube Webmail or / and SOGo components).
  • Unlimited account: You can create as many mail accounts (domain, user, mailing list, administrator) as you want.
  • Web Management Panel: As an admin user, you will get a web management panel where you can manage your mail accounts.
  • Anti-spam and anti-virus:
    SpamAssassin, ClamAV, SPF, DKIM, greylist, whitelist,
    Blacklisted. Isolate detected spam into a SQL database for further processing
  • Supports OpenLDAP, MySQL, MariaDB and PostgreSQL backend storage for mail accounts. Choose what you like.

Before you start

These are the basic requirements for installing iRedMail on Debian 10 Linux.

  • Fresh installation of Debian 10 (Buster) Linux
  • 2 GB Required memory. If you plan to use it in a production environment with multiple domains and user accounts, add more memory – 4 GB or more
  • Make sure other users / groups are not using 3 UID / GID: 2000, 2001, 2002.
  • Mail server domain name
  • sudo user account-the user account to add to Sudo Group or root user access

So when you start installing iRedMail Mail Server on Debian 10 (Buster), follow these easy-to-follow steps to relax.

Step 1: Update the system

Make sure your system is running the latest version of the operating system.

sudo apt -y update
sudo apt -y upgrade

After the system upgrade, it is recommended to restart.

sudo systemctl reboot

Step 2: Set the server host name

Set the server host name to the subdomain name configured in the DNS server.

export HOSTNAME=""
sudo hostnamectl set-hostname $HOSTNAME --static
sudo hostnamectl set-hostname $HOSTNAME --transient

After updating the host name, log out and log in again to update your work environment.

$ logout

Now add IP address and DNS name mapping to / etc / hosts file.

# Example
$ sudo vim /etc/hosts

To confirm DNS resolution, first install dns-utils package.

sudo apt -y install dnsutils

Then use the host command for local resolution.

$ host has address

To record in the DNS server, use the dig command.

$ dig A

Step 3: Download the latest version of iRedMail

Access iRedMail Download page Get the latest stable version of iRedMail for your platform.

At the time of writing, the latest stable version is the version 1.0.

sudo apt -y install wget

Extract the downloaded archive file.

tar xvf iRedMail-1.0.tar.gz

Step 4: Install iRedMail on Debian 10 (Buster)

An installer script is provided for automatically installing iRedMail Mail Server on Debian 10. Change the working directory to the folder you created.

cd iRedMail-*/

Launch the iRedMail installer.

chmod +x
sudo ./

The installer script will install the required dependencies and then ask you a few simple questions needed to set up an iRedMail mail server on Debian 10 (Buster).

1-Accept the installation wizard

The first screen asks if you accept or decline to install iRedMail on Debian.

Install and set up iRedMail mail server on Debian 10 (Buster)2-Specify the directory to store the mailbox

Before changing the default mailbox store directory, make sure you have read the notes provided.

Install and set up iRedMail mail server on Debian 10 (Buster)3-Select the web server to use

Use nginx’s default selection.

Install and set up iRedMail mail server on Debian 10 (Buster)4-Select the backend for storing mail accounts

Choose the equipment you are familiar with for easier management and maintenance after installation. I will use OpenLDAP.

Install and set up iRedMail mail server on Debian 10 (Buster)5-Specify the LDAP suffix

If you choose OpenLDAP as the default backend for storing mail accounts,
Provide an LDAP suffix. These are just part of your domain name.

Install and set up iRedMail mail server on Debian 10 (Buster)6-Set MySQL root password

Provide the password of the MySQL root user.

Install and set up iRedMail mail server on Debian 10 (Buster)7 – Add your first email domain

Provide your mail domain name-the name cannot be the same as the server name.

Install and set up iRedMail mail server on Debian 10 (Buster)7-Provide a password for the mail domain administrator

Enter the mail domain administrator password and check the features you want to enable.

Install and set up iRedMail mail server on Debian 10 (Buster)

Review the values ​​provided and start the 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:     
* Mail domain admin:                    [email protected]
* Additional components:                Roundcubemail SOGo netdata iRedAdmin Fail2ban

< Question > Continue? [y|N] y

Types of y Either Y then press Enter start installation. The script will automatically install and configure all required packaging files.

You can choose to enable iRedMail firewall.

* iRedMail-1.0 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 ...

Restart the server to enable the mail service.

sudo systemctl reboot

Step 5: iRedMail access credentials

Your iRedMail server details and access credentials are stored in a file “/root/iRedMail-1.0/config“” (If the script runs as root) or “/home/$USER/iRedMail-1.0/config“(If the script is executed as a normal user).

After successfully installing iRedMail on Debian 10 (Buster), the URL of the installed web application will be displayed.

  • Roundcube webmail: Https: // your server / mail /
  • SOGo components: Https: // your server / SOGo
  • Web Management Panel (iRedAdmin): HttpS: // your_server / iredadmin /
  • Awstats: HttpS: //your_server/awstats/ config = web (or ?config=smtp For SMTP traffic logs)

My output looks like this.

* URLs of installed web applications:
* - Roundcube webmail:
* - SOGo groupware:
* - netdata (monitor):
* - Web admin panel (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/
* And it's sent to your mail account [email protected]
********************* WARNING **************************************

Log in to the portal using the saved credentials.

Install and set up iRedMail mail server on Debian 10 (Buster)

This is the default appearance of the iRedMail admin console at initial login.

Install and set up iRedMail mail server on Debian 10 (Buster)

Access the Mail Client at / mail.

Install and set up iRedMail mail server on Debian 10 (Buster)

Step 6: Protect iRedMail with encrypted SSL certificate

iRedMail generates a self-signed certificate during the installation process. You can choose to obtain a commercial certificate or use “Let’s Encrypt Free SSL Certificate”. See the guide below.

Secure iRedMail server with encrypted SSL certificate

More guides on iRedMail:

How to add domain and user accounts to iRedMail mail server