Installing iRedMail on Debian

iRedMail is an open-source mail server software that can be used to set up a mail server quickly and easily. In this tutorial, we will guide you through the installation process of iRedMail on Debian.

Prerequisites

Before we get started, make sure you have a Debian latest system set up with sudo privileged access.

Step 1: Install Required Dependencies

To begin with, we need to install some required dependencies for iRedMail software to work on Debian. Run the following commands to install them:

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install -y mariadb-server mariadb-client postfix dovecot-core dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-mysql dovecot-pop3d dovecot-sieve opendkim opendkim-tools spamassassin postgrey clamav-freshclam amavisd-new libmariadb-dev-compat libmariadb-dev libicu-dev libicu-dev libssl-dev libsasl2-dev libldap2-dev libldb-dev libmysqlclient-dev libpq-dev libsqlite3-dev python python-pip python-mysqldb python-sqlalchemy python-jinja2 python-tz python-psutil python-lxml python-netifaces python-netaddr python-webpy python-ldap python-pymysql python-requests python-bs4 python-qrencode

When prompted, set a root password for your MariaDB installation.

Step 2: Download and Extract iRedMail

Next, we need to download and extract iRedMail package to a specific directory. Execute the below commands to do that:

wget https://github.com/iredmail/iRedMail/archive/1.4.2.tar.gz
tar -xvzf 1.4.2.tar.gz
cd iRedMail-1.4.2

Step 3: Install iRedMail

Once we have iRedMail package in place, next step is to begin the installation process.

sudo bash iRedMail.sh

You may follow the on-screen instructions to install iRedMail by:

  • Selecting the language
  • Installing iRedMail via automatic or custom installation mode
  • Providing the domain name, server host name and IP, admin email address, and admin password.
  • Adding SSL/TLS certificates

iRedMail installation will take some time depending on your system's specifications.

Step 4: Configure Firewall

Now, it's time to configure your firewall to allow traffic to your new mail server. By default, iRedMail uses the following ports:

  • 25 (SMTP)
  • 465 (SMTPS)
  • 587 (Submission)
  • 110 (POP3)
  • 143 (IMAP)
  • 993 (IMAPS)
  • 995 (POP3S)

You can allow traffic from these ports on your firewall by executing the following command:

sudo ufw allow 25,465,587,110,143,993,995/tcp

Step 5: Access Admin Panel

Finally, you can access the iRedMail admin control panel using your web browser by navigating to https://<SERVER-IP>/iredadmin.

Provide your admin email address and password to log in.

Congratulations! You have successfully installed iRedMail on Debian. Start sending and receiving emails from your new mail server.