How to install iRedMail mail server on CentOS 8

You can download this article in PDF format to support us through the following link.

Download the guide as a PDF

turn off


iRedMail is an open source mail server solution designed to simplify deployment, configuration and routine daily mail operations. iRedMail runs on Linux, FreeBSD and OpenBSD systems. This blog post will discuss the steps to install iRedMail Mail Server on a CentOS 8 Linux server.

For users unfamiliar with the command line interface, you can use a simpler installation method. iRedMail Lite It is a web-based deployment and support platform. With this platform, you can easily deploy and keep the iRedMail server up-to-date, and easily get fast professional technical support from the iRedMail team.

Other installations:

Debian: Install and set up iRedMail mail server on Debian Linux

CentOS 7: Install iRedMail mail server on CentOS 7

Functions of iRedMail mail server

  • Fully open source: All iRedMail components are built from open source applications. It has been certified by Bee and can be run on Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, FreeBSD, OpenBSD.
  • Maximum security: Access all mail services through a secure connection-use TLS to access POP3, IMAP and SMTP services The web portal can be accessed via HTTPS. If possible, use TLS to encrypt emails during transmission.
  • Access webmail: Intuitive web portal can be used to access and manage emails, folders, sifters (Roundcube Webmail or / and SOGo components).
  • Unlimited account: You can create as many mail accounts as you need (domain, user, mailing list, administrator).
  • Web Management Panel: As an admin user, you will get a web management panel where you can manage your mail account.
  • Anti-spam and anti-virus: SpamAssassin, ClamAV, SPF, DKIM, gray list, white list, black list. Isolate the detected spam into the SQL database for further inspection.
  • Supports OpenLDAP, MySQL, MariaDB and PostgreSQL backend storage for mail accounts. Choose what you like.

Install iRedMail mail server on CentOS 8 Linux

For a successful installation, please check the following minimum server requirements.

  • 2 GB The 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 that other users / groups are not using 3 UID / GID: 2000, 2001, 2002.
  • Mail server domain name
  • sudo user account-the user account added to Round Group or root user access

With basic hardware requirements, you can start to install and configure iRedMail Mail Server on CentOS 8 Linux server.

Step 1: Add EPEL repository and update system

Let’s add the EPEL repository to our CentOS 8 server in case certain dependent packages are located here.

sudo yum -y install epel-release
sudo yum config-manager --set-enabled PowerTools

Update the system and perform a reboot.

sudo dnf -y update
sudo systemctl reboot

Step 2: Set SELinux to licensing mode

When SELinux is enforced, the iRedMail development team did not provide SELinux strategy to make the service work properly. You need to disable SELinux or configure it to run in licensed mode.

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

After making changes, confirm the current SELinux status.

$ sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

Step 3: Set the server host name

Set the server host name to the subdomain name configured in the DNS server. Replace Use the correct host name.

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 working environment.

$ logout

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

# Example
$ sudo vim /etc/hosts

To confirm DNS resolution, please install Binding tool package.

sudo yum -y install bind-utils

Then use the host command for local analysis.

$ host has address

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

$ dig A

Step 4: Download iRedMail on CentOS 8

Visit iRedMail Download page To get the latest stable version of iRedMail for your platform.

As of this update, the latest version is v1.2.

sudo yum -y install wget

Unzip the downloaded archive file.

sudo yum -y install tar bzip2
tar xvf 1.2.tar.gz

Step 5: Install iRedMail on CentOS 8 Linux

We will use an automated script to set up iRedMail on CentOS 8 Linux.

cd iRedMail-*/

Start the iRedMail installer.

chmod +x
sudo ./

The installer script will install the required dependencies and then ask you a few simple questions to set up the iRedMail mail server on CentOS 8.

1-Accept the installation wizard

The first screen asks if you accept or refuse to install iRedMail on CentOS 7.

How to install iRedMail mail server on CentOS 82-Specify the directory for storing mailboxes

Before changing the default mailbox storage directory, make sure you have read the provided comments.

How to install iRedMail mail server on CentOS 83-Select the web server to use

Use nginx’s default selection.

How to install iRedMail mail server on CentOS 84-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.

How to install iRedMail mail server on CentOS 85-Specify the LDAP suffix

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

How to install iRedMail mail server on CentOS 86-Set MySQL root password

Provide the password of the MySQL root user.

How to install iRedMail mail server on CentOS 87-Add your first email domain

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

How to install iRedMail mail server on CentOS 88-Provide a password for the mail domain administrator

Enter the password of the mail domain administrator, and then check the features to be enabled.

How to install iRedMail mail server on CentOS 8

Allow DKIM and SPF verification.

Verify the settings and agree to install iRedMail on the CentOS 8 server.

***************************** WARNING ***********************************
*                                                                       *
* Below file contains sensitive infomation (username/password), please  *
* do remember to *MOVE* it to a safe place after installation.          *
*                                                                       *
*   * /root/iRedMail-1.2/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 netdata iRedAdmin Fail2ban

< Question > Continue? [y|N]y

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

Accept the firewall configuration.

* iRedMail-1.2 installation and configuration complete.

[ INFO ] Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail?
< Question > File: /etc/firewalld/zones/iredmail.xml, 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 ...
< Question > Would you like to use MySQL configuration file shipped within iRedMail now?
< Question > File: /etc/my.cnf. [Y|n]y
[ INFO ] Copy MySQL sample file: /etc/my.cnf.
[ INFO ] Enable SSL support for MySQL server.

Save the displayed login credentials.

* URLs of installed web applications:
* - Roundcube webmail:
* - 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:
*   - /root/iRedMail-1.2/
* And it's sent to your mail account [email protected]
********************* WARNING **************************************
* Please reboot your system to enable all mail services.

Restart the server to enable the mail service.

sudo reboot

Step 6: iRedMail access credentials

Your iRedMail server details and access credentials are stored in the file “/root/iRedMail-1.x/config“” (If the script is run as root) or “~ / IRedMail-1.x / config“(If the script is executed as a normal user).

After successfully installing iRedMail on CentOS 8, the URL of the installed web application will be displayed.

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

Use the saved credentials to log in to the portal.

How to install iRedMail mail server on CentOS 8

Step 7: Protect iRedMail by encrypting SSL certificate

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

Secure iRedMail server by encrypting SSL certificate

Our next guide below covers adding domains and users to the iRedMail Mail server:

How to add domain and user account to iRedMail mail server

You can download this article in PDF format to support us through the following link.

Download the guide as a PDF

turn off