Howto Setup iRedMail Server on Ubuntu Linux

iRedMail is a free, open-source mail server software that allows you to build and host your own mail server. It installs all necessary components and configures a full-fledged mail server, focusing on privacy and security. The post provides a detailed tutorial on how to install and configure iRedMail on Ubuntu 18.04 | 16.04 LTS servers.…

This brief tutorial shows students and new users how to install and configure iRedMail on Ubuntu 18.04 | 16.04 LTS servers.

iRedMail is a free, open-source mail server software that allows you to build and host your mail server in your environment. Right out of the box, iRedMail will install all necessary components and configure a full-fledged mail server.

With its intuitive web portal, you can create as many inboxes as you’d like on your server.

iRedMail focuses on privacy to make sure all your data are protected on your servers, and the best security practices are enabled by default, forcing all users to use mail services through secure connections (POP3/IMAP/SMTP over TLS, webmail with HTTPS).

If you’re looking for a free, open-source mail server for your environment, you may want to look at iRedMail.

For more about iRedMail, please check its homepage.

To get started installing iRedMail, follow the steps below:

Configure Ubuntu Hostname

Before installing iRedMail, make sure to configure the mail server’s hostname. For this tutorial, we’re going to be using the hostname and IP address below:

webmail.example.com                    =========== >              192.168.20.2

You can run the commands below to set the server hostname.

sudo hostnamectl set-hostname webmail.example.com

Also, run the commands below to open the Ubuntu hosts file.

sudo nano /etc/hosts

Then enter the line as shown below:

192.168.20.1    webmail.example.com webmail localhost
127.0.0.1       localhost
127.0.1.1       ubuntu1804

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
..

Save the file and exit.

Download and install iRedMail

Now that the mail server hostname is configured. Run the commands below to download and install iRedMail. First, update the Ubuntu server by running the commands below:

sudo apt update && sudo apt dist-upgrade && sudo apt autoremove

When you’re done updating, run the commands below to download the iRedMail archived package and extract it.

cd /tmp
wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2
tar xjf iRedMail-0.9.9.tar.bz2

After that, change into the extracted folder and run the commands below to initiate the installation.

cd iRedMail-0.9.9
sudo bash iRedMail.sh

That should start the installation and prompt you with questions on setting up iRedMail. Use the guide below to answer as much as possible.

Next, accept the default storage location for mailboxes. If you have another location, you can specify it at the line.

Next, choose to install the Nginx HTTP server for iRedMail.

Also, choose to install a database server. For this tutorial, we’re going with the MariaDB database server. You’ll be prompted to create and confirm a root user for the MariaDB database server.

After that, you’ll be prompted to create your first domain name. It won’t be the server domain name you specified above. This should be a test domain to ensure things are configured correctly.

For our first domain, we’ll be using example.net

After that, you’ll be prompted to enter the admin password for the domain above.

Next, choose a web interface to use with your server. And complete the wizard.

Finally, type y to complete.

*************************************************************************
***************************** WARNING ***********************************
*************************************************************************
*                                                                       *
* Below file contains sensitive infomation (username/password), please  *
* do remember to *MOVE* it to a safe place after installation.          *
*                                                                       *
*   * /tmp/iRedMail-0.9.9/config
*                                                                       *
*************************************************************************
********************** Review your settings *****************************
*************************************************************************

* Storage base directory:               /var/vmail
* Mailboxes:                            
* Daily backup of SQL/LDAP databases:   
* Store mail accounts in:               MariaDB
* Web server:                           Nginx
* First mail domain name:               example.net           
* Mail domain admin:                    postmaster@example.net           
* Additional components:                Roundcubemail SOGo netdata iRedAdmin Fail2ban

< Question > Continue? [y|N] y

That should install and configure your mail server environment. After a brief moment, the server should be ready to use.

Take note of the username and password to access the web portal.

********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://webmail.example.com/mail/
* - SOGo groupware: https://webmail.example.com/SOGo/
* - netdata (monitor): https://webmail.example.com/netdata/
*
* - Web admin panel (iRedAdmin): https://webmail.example.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: postmaster@example.net           
* - Password: secret_password
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /tmp/iRedMail-0.9.9/iRedMail.tips
*
* And it's sent to your mail account postmaster@example.net           .
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

To complete this, you’ll want to reboot the server. Run the commands below to do that.

sudo reboot

After rebooting, log in to the admin portal using the URL below:

http://webmail.example.com/iredadmin

Login and enjoy!

That it!

Don’t forget to delete the config file.

sudo rm -rf /root/iRedMail-0.9.9/config

Congratulations! You have learned how to install and configure iRedMail on Ubuntu 18.04 | 16.04 LTS server

You may also like the post below:

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Exit mobile version