Let’s SSH into the Mail Server VM and do some work there to get iRedMail (and the related services mentioned in the previous step) installed.
- Update + set up the desired hostname
sudo apt update && sudo apt upgrade sudo hostnamectl set-hostname mail.your-domain.com # Modify the hosts file like this: sudo nano /etc/hosts 127.0.0.1 mail.your-domain.com localhost # Check that it is correct: hostname -f
- Install iRedMail and related tools (check the latest version here)
# Download the package https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.1.tar.gz # Unpack it and go in tar xvf 1.7.1.tar.gz cd iRedMail-1.7.1 # Make the bash file executable and run it (it will download more packages): chmod +x iRedMail.sh sudo bash iRedMail.sh
- A wizard will be launched, eventually. Click on “Yes’ to proceed.
- Next, you will be asked for where to store email boxes – the default location is /var/vmail (as /var/mail cannot be used) – you can confirm the default, unless preferred otherwise.
- Web server step – Nginx is the default (in the past, it was Apache) – this allows you to set up mailboxes as admin and will be used for RoundCube webmail, so it is definitely recommended.
- Database menu – for our use, MariaDB is more than enough.
- Database root password – be careful to type it correctly, as you do not get to see what you are typing and there is no re-type confirmation.
- First domain name – what is the first (and could be the only) domain that you will want to be receiving emails on? This can be different from the hostname’s domain.
- Postmaster’s email admin password – again, keep track of what you enter. It should be different from the DB root password.
- Additional components – Roundcube replaces SoGo in terms of webmail capabilities (SoGo still runs on Apache). Others are good to install.
- At the end of the wizard, confirm ‘y’ to proceed with the installation.
- Once configured, you will be asked to confirm your SSH port for the firewall to ensure that you do not get locked out and then to restart the firewall:
- Before restarting, take a look at the tips file to confirm that you have got the passwords typed correctly and know the interfaces:
sudo nano iRedMail.tips
- Reboot your VM.
By this point, you have a basic installation of iRedMail completed. However, the services will not yet be reachable, we still have some configuration to do for each.