How to Install iRedmail on Ubuntu 20.04

how to install iredmail on ubuntu 20.04

Let’s learn how to install iRedmail on Ubuntu 20.04. Having our own mail server is cool, we can create as many email accounts as we want, configure how big the attachment limit, create our own spam filters, etc. But, installing and configuring a mail server can stress you and consume your precious time. iRedmail is an open source mail server solution, with iRedmail we can deploy a full-featured mail server in several minutes. It can help you to reduce the time you spend when building a mail server.

It will install the needed services and application to run a mail server. iRedmail supports all major Linux distribution, but in this tutorial, we will show you how to install iRedmail on Ubuntu 20.04. iRedmail is designed to be installed on a fresh operating system. It means it is highly recommended that you install it on a newly installed OS.

Prerequisites

  • SSH access with root privileges
  • A domain name
  • A fresh Ubuntu 20.04 with a minimum of 2 GB of RAM

1. Log in via SSH and update the system

ssh root@IP_Address -p Port_number

Once logged in, run the following command to update all installed packages to the latest available version

apt update && apt upgrade

2. Create/Edit Hostname

You need to have a proper Fully Qualified Domain Name (FQDN) as your server’s hostname to be able to install iRedmail. The FQDN should be like sub.domain.com, if your hostname is only a domain name, iRedmail would not install properly. Once created, you also need to create A record for it. For example, in this tutorial, we will use mailx.domain.com.

hostnamectl set-hostname mailx.domain.com

Besides creating A record for the hostname, you also need to create an MX record. An MX record of your domain name should be pointed to the mail server’s hostname. As for A record for your hostname, should be pointed to your server IP address.

If you are using our Free Managed DNS server (dns1.rosehosting.com, and dns2.rosehosting.com), you can edit/add A and MX records for your domain name through the client area. Or, if you don’t know or have a doubt on how to do it, you can contact our support team anytime.

You can invoke the following command to see your hostname:

hostnamectl status

You will see output like this:

root@server ~ # hostnamectl status
Static hostname: mailx.domain.com
Icon name: computer-vm
Chassis: vm
Machine ID: 13fced5cb25a4188a476f6010ac63a68
Boot ID: f75fc7bec4bf4dcb8718c8c550dd7e6f
Virtualization: kvm
Operating System: Ubuntu 20.04.2 LTS
Kernel: Linux Linux 5.4.0-65-generic
Architecture: x86-64

To see the changes, log out from SSH and re-login, then invoke:

hostname -f

3. Download iRedmail

You can go to their official download page to get the latest version. As of June 2021, at the time of this blog writing, the latest version was 1.4.0, we use that version for this tutorial purpose.

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

Let’s uncompress it.

tar -xf 1.4.0.tar.gz

4. Install iRedmail

Let’s proceed with the installation now.

cd iRedMail-1.4.0/
chmod +x iRedmail.sh
./iRedmail.sh

You will be brought to a setup wizard, press Y to continue.

In this step, you are asked to specify the storage path, you can use the default one and continue

how to install iredmail on ubuntu 20.04

Choose whether you want to install Nginx or no, you will need to access webmail and mail administration page to manage your domain, email accounts, etc. So, it is better to choose Nginx as the web server, press Next to continue.

install iredmail mail server on ubuntu 20.04

Choose your preferred storage backend to store mail accounts and all. In this tutorial, we use MariaDB as the storage backend.

install iredmail open source mail server on ubuntu 20.04

Now, you are asked to create a password for MySQL root user, please create and save a copy of it, you might need it in the future. Please note that if you chose MariaDB in the previous step, even you created a password for the root user, you can still log in to MariaDB shell as root without being asked for a password. It is because MariaDB uses unix_socket authentication plugin, it means that it allows users to use OS credentials to connect to MariaDB server.

installing iredmail mail server on ubuntu 20.04

As seen in the picture, you will need to specify your domain name, which cannot be the same as your server’s hostname:

set up iredmail open source on ubuntu 20.04

Once the domain is specified, you will be asked to create a password for postmaster@yourdomain.com, this credentials will be needed to manage your email accounts and domains.

iredmail open source installation on ubuntu 20.04

Choose additional components to install. We will install Roundcube, which is a fast and lightweight webmail client.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
iredmail open source mail server installation on ubuntu 20.04

Press Next to continue with the installation. The installation script will display all selected options.

installation of iredmail on ubuntu 20.04

Review the options and press Y then ENTER to continue with the installation of the necessary components.

installing iredmail open source mail server on ubuntu 20.04

Press ENTER
Press ENTER again to restart the firewall.

After this, you will be shown your iRedmail installation details.

Now, go to your https://mailx.domain.com/iredadmin/ to access iRedAdmin’s admin panel, where you can manage your domains and email accounts

how to set up iredmail on ubuntu 20.04

Of course, you don’t have to install iRedmail on Ubuntu 20.04, if you use one of our managed Linux VPS hosting packages, in which case you can simply ask our expert system administrators to install iRedmail, Open-Source Mail Server, on Ubuntu 20.04 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install iRedmail on Ubuntu 20.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

Leave a Comment