Setting up your own email server on Linux from scratch is a long and tedious process, a pain in the but if you are not an advanced user. This tutorial will be showing you how to use iRedMail to quickly set up a full-featured mail server on CentOS 8, saving you lots of time and headaches.
iRedMail is a shell script that automatically installs and configures all necessary mail server components on your Linux/BSD server, thus eliminating manual installation and configuration. With iRedMail, you can easily create unlimited mailboxes and unlimited mail domains in a web-based admin panel. Mailboxes can be stored in MariaDB/MySQL, PostgreSQL database, or OpenLDAP. The following is a list of open-source software that will be automatically installed and configured by iRedMail.
Here is the prerequisite for setting up the server.
Go to the iReadMail download page to download https://www.iredmail.org/download.html
Or you can download the archive using curl command
curl -sLO https://github.com/iredmail/iRedMail/archive/1.4.2.tar.gz
Install & Configuration
Once done do the following things:
Unzip the file
tar xvf 1.4.2.tar.gz
Go to the unzipped directory & give the proper permission of the installation script
Run the script as well
chmod +x iRedMail.sh sudo ./iRedMail.sh
Then a series of TUI will appear
The mail server setup wizard will appear. Use the Tab key to select Yes and press Enter.
The next screen will ask you to select the mail storage path. You can use the default one
/var/vmail, so simply press Enter.
Then choose whether you want to run a web server. It’s highly recommended that you choose to run a web server because you need the web-based admin panel to add email accounts. Also it allows you to access the Roundcube webmail. By default, Nginx web server is selected, so you can simply press Enter. (An asterisk indicates the item is selected.)
Choose the one you’re familiar with for easier management and maintenance after installation. I’ll go with OpenLDAP.
If you chose OpenLDAP as default backend for storing mail accounts, provide LDAP suffix. These are just components of your domain name.
Next, set a password for the mail domain administrator.
Choose optional components. By default, all of the 4 items are selected. So simply press Enter. You can also customize.
Now you can review your configurations. Type
Y to begin the installation of all mail server components.
This will install necessary packages for ireadmail on your server
Once configurations done, it will start configuring the firewall access, type Yes or press enter to keep it as it is.
Make sure you see no error in the installation process. If there are errors, it’s better to reinstall the OS and then reinstall iRedMail on your server, or your mail server might not work properly.
At the end of the installation, choose
y to use firewall rules provided by iRedMail and restart the firewall.
Now iRedMail installation is complete. You will be notified the URL of webmail, web admin panel and the login credentials. The
iRedMail.tips file contains important information about your iRedMail server.
Reboot the system
You will be prompted to enter username & password.