Hostwinds Tutorials

Search results for:


Table of Contents


Step 1: Set Hostname to Your Fully Qualified Domain Name
Step 2: Disable SELinux (Required to use iRedMail)
Step 3: Install iRedMail

How to Install iRedMail on a VPS (CentOS 7)

Tags: Email,  VPS 

Step 1: Set Hostname to Your Fully Qualified Domain Name
Step 2: Disable SELinux (Required to use iRedMail)
Step 3: Install iRedMail

iRedMail offers a secure, total solution for a standalone mail server. You can create unlimited email domains, users, and admins in the iRedMail web admin panel. The installation is recommended on a clean server installation and completed with a script, followed by some configurations after installation. If you decide to install iRedMail on an existing VPS, please be sure to take a snapshot backup before proceeding with this guide.

The following components will be installed during the installation of iRedMail:

  • Postfix
  • Dovecot
  • Nginx
  • OpenLDAP or LDAP(8) (optional)
  • MySQL, MariaDB, or PostgreSQL
  • mlmmj
  • Amavisd-new
  • SpamAssassin
  • ClamAV
  • Roundcube webmail
  • SOGo Groupware
  • Fail2ban
  • iRedAPD

**Prerequisites:
**Be sure to update your VPS before you begin.
You will need to connect to your Hostwinds server through SSH

Step 1: Set Hostname to Your Fully Qualified Domain Name

hostnamectl set-hostname **mail.yourdomain.com**

Next, verify in your host's file that your IP is associated with your hostname:

sudo vi /etc/hosts

Add the following line to the bottom of the file using your information:

YOUR-IP mail.yourdomain.com

Then reboot the server. Verify this change following the reboot:

hostname -f

Step 2: Disable SELinux (Required to use iRedMail)

vi /etc/selinux/config

Edit this file so that SELINUX is set to SELINUX=disabled or SELINUX=permissive. Setting SELinux to permissive means SELinux policy will not be enforced, but AVC messages will be logged for further troubleshooting.

Immediately enforce the policy to avoid a reboot:

setenforce 0

Step 3: Install iRedMail

cd /root

Download the latest stable release of iRedMail. At this time, the latest stable release is version 1.1. Verify version 1.1 is the latest version here. If version 1.1 is the latest, run:

wget https://github.com/iredmail/iRedMail/archive/1.1.tar.gz

If there is a later stable release, right-click and copy the link address of the latest stable release, then download using wget as seen above.

Next, uncompress the TAR file. the version number should replace x.y.z. In the case above, it would be iRedMail-1.1.tar.gz:

tar -zxf iRedMail-x.y.z.tar.gz

Next, start the installer inside of the uncompressed directory:

cd /root/iRedMail-x.y.z
./iRedMail.sh

You will then be asked a series of questions to configure iRedMail on your server and set up your mail domain. You will be able to review and confirm all selected options before the installation begins.

Written by Benjamin Bream  /  March 11, 2020