iRedMail

How to Install iRedMail on CentOS 9: A Comprehensive Guide

Welcome to the Greenhost.cloud blog! In this post, we will walk you through the step-by-step process of installing iRedMail on CentOS 9. iRedMail is a powerful, open-source mail server solution that allows you to manage your own email service with ease. Whether you’re a small business or just want your own personal email server, iRedMail simplifies the entire process.

Prerequisites

Before you begin the installation, make sure you have the following:

  1. CentOS 9 Installed: You should have CentOS 9 installed on your server. This can be a fresh installation, and it’s best to update it to the latest packages.
  2. Root Access: Ensure you have root (or sudo) access. Some commands will require administrative privileges.
  3. Domain Name: You will need a domain name that you own or control, since the mail server will be handling emails for that domain.
  4. Static IP Address: It’s recommended to have a static IP address for your mail server to avoid issues with DNS.

Step 1: Update Your System

Before starting the installation, it’s essential to update your system packages. Open your terminal and run the following commands:

sudo dnf update -y

Step 2: Install Required Packages

Make sure you have the necessary dependencies installed. iRedMail requires some basic packages prior to installation. Use the following command:

sudo dnf install wget vim -y

Step 3: Download iRedMail

Next, you will need to download the latest version of the iRedMail installer from the official website. You can do this using wget:

cd /tmp
wget https://github.com/iredmail/iRedMail/archive/refs/heads/master.zip

Once downloaded, you can unzip the package using:

sudo dnf install unzip -y
unzip master.zip
cd iRedMail-master/

Step 4: Start the iRedMail Installation

To begin the iRedMail installation process, run the installation script:

sudo bash iRedMail.sh

Step 5: Follow the Installation Wizard

The installer will present you with a series of prompts. Here are the steps you will typically encounter:

  1. Select Your Mail Store: Choose the mail server backend. Options include OpenLDAP, MySQL, or PostgreSQL. For simplicity, we recommend the popular MySQL database management system.
  2. Set Your Domain Name: Provide your fully qualified domain name (e.g., mail.yourdomain.com).
  3. Set the Password for the Admin User: You’ll be prompted to create an admin email address along with a password.
  4. Select Your Web Server: Choose between using Nginx or Apache. Both are excellent choices, but make your selection based on your preference.
  5. Review Your Configuration: The installer will show a summary of your chosen configurations. Ensure everything looks correct before proceeding.
  6. Installation: The installation wizard will now run various scripts to set up your mail server. This can take several minutes.

Step 6: Configure Firewall

After the installation completes, configure the firewall to allow mail services:

sudo firewall-cmd --permanent --add-service=smtp
sudo firewall-cmd --permanent --add-service=smtp-submission
sudo firewall-cmd --permanent --add-service=pop3
sudo firewall-cmd --permanent --add-service=pop3s
sudo firewall-cmd --permanent --add-service=imap
sudo firewall-cmd --permanent --add-service=imaps
sudo firewall-cmd --reload

Step 7: Access Your Web Admin Panel

After the installation, iRedMail will provide you with the URL to access the iRedMail web administration interface. This is generally located at https://mail.yourdomain.com/iredadmin. Use the admin email and password you created earlier to log in.

Step 8: Configure Your DNS Records

For email functionality, you must set up the necessary DNS records with your domain registrar. Be sure to configure the following:

  • MX Records: Pointing to your mail server.
  • A Records: For your mail server’s domain.
  • SPF Records: To help prevent spoofing.
  • DKIM Records: To verify the email and improve deliverability.

Conclusion

Congratulations! You’ve successfully installed iRedMail on CentOS 9. You now have a fully functional mail server ready to send and receive emails. Make sure to take the time to secure your server, regularly update your software, and back up your configurations.

If you need further assistance or have questions, feel free to reach out! We’re here to help you on your journey of managing your email server.

Happy Hosting!