Setting up an email server can be a long, complicated process. Fortunately, there is software that can speed up and optimize the setup process so that you don’t spend any more time on it than you have to. A perfect example of such software is iRedMail.
So what is iRedMail? It is an automated email and web server setup package. Experts recommend that you install it on a fresh system – that means before Apache and/or Dovecot and/or Postfix. The reason for this is that iRedMail will take care of all of that, that is it will automatically install and configure Postfix, Dovecot, Apache, and MySQL, as well as fail2ban and iptables.
With that in mind, let’s see how you can easily set up iRedMail on your Linux VPS. As always, there are some things you need to take care of because you start the actual installation.
Setting up FQDN
One of the steps you need to take prior to the installation is setting a fully qualified domain name (FQDN) hostname on your server.
To view your current hostname, you’ll need to enter the following command:
$ hostname -f
The hostname is defined in
Next, go to
and be sure to list the FQDN hostname as first item, as in the example below:
127.0.0.1 mx.example.com mx localhost localhost.localdomain
Enter the command
again to verify if any changes were made. If none are visible, reboot your server.
As iRedMail doesn’t work with SELinux, you’ll need to disable the latter in order to proceed to the installation. To do so, head to its config file /etc/selinux/config, and set its value to disabled, like so:
Enabling yum repositories
For CentOS or Scientific Linux, enable CentOS/Scientific official yum repositories, and disable all third-party yum repositories to avoid package conflict.
For Red Hat Enterprise Linux, enable Red Hat Network to install packages. Alternatively, you can create a local yum repository with DVD/CD ISO images.
For the final pre-installation step, you’ll need to head to this page on the iRedMail website, and get the latest stable release of iRedMail.
Next, you should upload iRedMail to your mail server via ftp or scp and login to install iRedMail.
Lastly, you will need to uncompress iRedMail tarball, like so:
# cd /root/ # tar xjf iRedMail-x.y.z.tar.bz2 (x, y, z stand for the version number)
You’re now ready to start iRedMail installer. You will be prompted to answer several simple questions which are all required to setup a full-featured mail server.
# cd /root/iRedMail-x.y.z/ # bash iRedMail.sh
Next, the installer will ask you to review and confirm to start installation. It will install and configure required packages automatically. Type Y and press Enter to start.
With that done, the installation is complete. Congratulations!