How to Install iRedMail on Ubuntu 18.04

Introduction

Running your own mail server offers the benefit of privacy as well as the ability to create as many mail accounts as you wish for your domains.

This tutorial will show you how to install iRedMail, an open source mail server setup script, on a fresh installation of Ubuntu 18.04. iRedMail saves you time by installing and setting up all of the components you need to run an email server, such as:

  • Postfix - A mail transfer agent (MTA)
  • Dovecot - An IMAP and POP3 server
  • Nginx - A web server
  • OpenLDAP - LDAP server for storing mail accounts or a MySQL, MariaDB or PostgreSQL server for storing mail accounts.
  • SpamAssassin - A spam scanner
  • ClamAV - A virus scanner
  • Amavisd - An interface between Postfix, SpamAssassin and ClamAV
  • iRedAPD - Postfix policy server

Optional:

  • Roundcube - A webmail interface
  • SOGo Groupware - A calendar, contact and tasks service
  • Fail2ban - Restricts and bans logins from IP addresses that look malicious

Requirements

  • A fresh Ubuntu 18.04 Vultr Cloud Compute instance with at least 2GB of memory (4GB is preferred) for a low traffic mail server
  • Port 25 unblocked
  • A non-blacklisted IP address. If your IP address has been added to a blacklist, your emails will be marked as spam and may never reach their destination. You can check whether your IP address is on a blacklist by entering it here.
  • A non-root sudo user

Installation

First, you will want to set your fully qualified domain name (FQDN) hostname. Enter hostname -f to view the current hostname.

hostname -f

On Ubuntu, the hostname is set in two files: /etc/hostname and /etc/hosts. Open /etc/hostname.

sudo nano /etc/hostname

In /etc/hostname, the short form of the hostname is given, not the FQDN hostname. Enter the short form of the hostname you wish to use. For example, if the FQDN hostname you wish to use is mail.example.com, your file will look like the following.

mail

Next, open /etc/hosts.

sudo nano /etc/hosts

Add your FQDN hostname as the first item.

127.0.0.1   mail.example.com mail localhost localhost.localdomain

Close the file and reboot your server.

sudo shutdown -r now

Once your server is up and running again, you can verify your hostname.

hostname -f

Install the bzip2 package so that you can uncompress the downloaded iRedMail package.

sudo apt-get install bzip2

You are now ready to install iRedMail. Download the latest version of iRedMail using wget. You can find the latest build by visiting the iRedMail download page.

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

Extract the tarball and then cd to the directory.

tar xvf iRedMail-0.9.9.tar.bz2
cd iRedMail-0.9.9

Then, add the appropriate permissions for the iRedMail installer script and run it with sudo.

chmod +x iRedMail.sh
sudo bash iRedMail.sh

The iRedMail installer script will ask you a series of questions before setting up the mail server for you. Choosing the default options is recommended if you are new to running a mail server.

Running the script will open a Welcome screen. Select Yes to continue.

The next screen will allow you to set the default mail storage path, which is /var/vmail. Select Next to continue.

The next screen allows you to choose your preferred back-end to store mail accounts. Make your selection and then select Next to continue.

You will then be asked to enter your first mail domain name. This will be your domain from earlier without the sub-domain. For example if your FQDN is mail.example.com then you would enter example.com as your first mail domain name. Enter your domain name and then select Next to continue.

An administrator account for your first mail domain. This account is both an admin account and a mail user, therefore you can login to webmail and the admin panel (iRedAdmin) with the same credentials. The username is the full email address. You will be asked to set the password for the admin account.

Once you have entered a suitably strong password, select Next to continue.

You will then be asked to choose optional components that can be installed, such as SOGo. At a minimum, you should choose iRedAdmin and Roundcube.

Once you have selected the optional components you want to be installed, select Next to continue.

The iRedMail installer will ask you to review and confirm your iRedMail configuration before the installation proceeds. Type y and press ENTER to start the installation.

Once the installation is complete, you will be asked whether you would like to use the firewall rules provided by iRedMail and whether you want to restart the firewall now. Type y or Y and press ENTER to use the default firewall rules and to restart the firewall.

After all the required packages are installed and configured, reboot your server.

sudo shutdown -r now

After rebooting, you can access the web admin page at https://mail.example.com/iredadmin using your domain. To access your mail, use the Roundcube page at https://mail.example.com/mail. The server is installed with a self-signed certificate which requires special permissions to open the page in your browser. It is recommended that you upgrade to a certificate from a Certificate Authority (CA). Let's Encrypt is a CA that offers free certificates. Read the Vultr Setup LetsEncrypt on Linux article for information about using this service. You will need to follow the instructions for Nginx, as it is the default web server that iRedMail installs. Once the certificate is obtained you will need to replace the self-signed certificates that iRedMail creates.

sudo cp /path/to/your/cert /etc/ssl/certs/iRedMail.crt
sudo cp /path/to/your/key /etc/ssl/private/iRedMail.key

Restart all services that require the SSL certificate key.

sudo systemctl restart postfix
sudo systemctl restart nginx
sudo systemctl restart dovecot

Enjoy your new mail server! Be sure to read the iRedMail.tips file which is in the iRedMail-0.9.9 directory created within the directory you uploaded iRedMail to. The file contains:

  • The URLs, usernames and passwords of the web-based applications installed by iRedMail
  • The location of mail service related software configuration files
  • Additional important and sensitive information

You will also need to set the DNS records for your mail server before you can send and receive mail. Read the Introduction to Vultr DNS tutorial for information about setting DNS records.



Leave a Comment

Cómo configurar Spamassassin con Postfix en Ubuntu 16.04

Cómo configurar Spamassassin con Postfix en Ubuntu 16.04

Spamassassin es un filtro de correo gratuito y de código abierto escrito en Perl que se utiliza para identificar el correo no deseado mediante una amplia gama de pruebas heurísticas en los encabezados y el cuerpo del correo

How to Install RainLoop Webmail on Ubuntu 16.04

How to Install RainLoop Webmail on Ubuntu 16.04

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

Cómo arreglar que Office 365 no reciba correos electrónicos - ayuda de Office

Cómo arreglar que Office 365 no reciba correos electrónicos - ayuda de Office

En caso de que los miembros de su grupo de Office 365 no estén recibiendo correos electrónicos, deberá asegurarse de que los usuarios estén suscritos y cambiar la configuración del grupo.

How to Install Mailtrain Newsletter Application on Ubuntu 16.04

How to Install Mailtrain Newsletter Application on Ubuntu 16.04

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on CentOS 7

How to Install Mailtrain Newsletter Application on CentOS 7

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on Debian 9

How to Install Mailtrain Newsletter Application on Debian 9

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

Instale sSMTP con Mailtrap para el desarrollo de aplicaciones web en Ubuntu 16.04

Instale sSMTP con Mailtrap para el desarrollo de aplicaciones web en Ubuntu 16.04

En este tutorial, aprenderá cómo instalar sSMTP, un servidor de reenvío simple. Mailtrap.io ofrece un servidor de correo electrónico falso para desarrolladores. Úselo para enviar

How to Migrate Mailboxes Easily With Imapsync on Ubuntu 16.04 LTS

How to Migrate Mailboxes Easily With Imapsync on Ubuntu 16.04 LTS

Using a Different System? While migrating websites is usually not a problem, sometimes its more difficult to migrate email boxes. This is especially the cas

How to Install RainLoop Webmail on Fedora 28

How to Install RainLoop Webmail on Fedora 28

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you ho

How to Install RainLoop Webmail on CentOS 7

How to Install RainLoop Webmail on CentOS 7

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you ho

Construyendo su propio servidor de correo con FreeBSD 11

Construyendo su propio servidor de correo con FreeBSD 11

Ejecutar su propio servidor de correo electrónico puede ser muy gratificante. Usted está a cargo de sus datos. También le permite una mayor flexibilidad con sus opciones de entrega. sin embargo

How to Install RainLoop Webmail on Debian 9

How to Install RainLoop Webmail on Debian 9

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

How to Install Mail-in-a-box on Ubuntu 18.04

How to Install Mail-in-a-box on Ubuntu 18.04

Introduction Mail-in-a-box (MiaB) takes care of all the complicated configurations required to avoid security problems, provides a solid spam detection syste

How to Install Mailtrain Newsletter Application on FreeBSD 12

How to Install Mailtrain Newsletter Application on FreeBSD 12

Using a Different System? Mailtrain is an open-source self-hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on Fedora 28

How to Install Mailtrain Newsletter Application on Fedora 28

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install RainLoop Webmail on FreeBSD 12

How to Install RainLoop Webmail on FreeBSD 12

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

Un servidor de correo electrónico OpenBSD que utiliza OpenSMTPD, Dovecot, Rspamd y RainLoop

Un servidor de correo electrónico OpenBSD que utiliza OpenSMTPD, Dovecot, Rspamd y RainLoop

Introducción Este tutorial muestra un servidor de correo electrónico con todas las funciones que se ejecuta en OpenBSD con OpenSMTPD, Dovecot, Rspamd y RainLoop. OpenSMTPD es th

Cómo configurar un servidor de correo usando iRedMail en Ubuntu 16.04

Cómo configurar un servidor de correo usando iRedMail en Ubuntu 16.04

¿Usando un sistema diferente? Introducción Si alguna vez ha creado un servidor de correo desde cero, sabrá que puede ser una empresa tediosa. Estoy ahí

How to Migrate Mailboxes Easily With Imapsync on CentOS 7

How to Migrate Mailboxes Easily With Imapsync on CentOS 7

Using a Different System? While migrating websites is usually not a problem, sometimes its more difficult to migrate email boxes. This is especially the cas

ZPanel y Sentora en CentOS 6 x64

ZPanel y Sentora en CentOS 6 x64

ZPanel, un panel de control de alojamiento web popular, se bifurcó en 2014 a un nuevo proyecto llamado Sentora. Aprende a instalar Sentora en tu servidor con este tutorial.

Cómo instalar Vtiger CRM Open Source Edition en CentOS 7

Cómo instalar Vtiger CRM Open Source Edition en CentOS 7

Aprende cómo instalar Vtiger CRM, una aplicación de gestión de relaciones con el cliente, en CentOS 7 para aumentar tus ventas y mejorar el servicio al cliente.

Cómo instalar el servidor Counter-Strike 1.6 en Linux

Cómo instalar el servidor Counter-Strike 1.6 en Linux

Esta guía completa le mostrará cómo configurar un servidor Counter-Strike 1.6 en Linux, optimizando el rendimiento y la seguridad para el mejor juego. Aprende los pasos más recientes aquí.

¿Puede la IA luchar con un número cada vez mayor de ataques de ransomware?

¿Puede la IA luchar con un número cada vez mayor de ataques de ransomware?

Los ataques de ransomware van en aumento, pero ¿puede la IA ayudar a lidiar con el último virus informático? ¿Es la IA la respuesta? Lea aquí, sepa que la IA es una bendición o una perdición

ReactOS: ¿Es este el futuro de Windows?

ReactOS: ¿Es este el futuro de Windows?

ReactOS, un sistema operativo de código abierto y gratuito, está aquí con la última versión. ¿Puede satisfacer las necesidades de los usuarios de Windows de hoy en día y acabar con Microsoft? Averigüemos más sobre este estilo antiguo, pero una experiencia de sistema operativo más nueva.

Manténgase conectado a través de la aplicación de escritorio WhatsApp 24 * 7

Manténgase conectado a través de la aplicación de escritorio WhatsApp 24 * 7

Whatsapp finalmente lanzó la aplicación de escritorio para usuarios de Mac y Windows. Ahora puede acceder a Whatsapp desde Windows o Mac fácilmente. Disponible para Windows 8+ y Mac OS 10.9+

¿Cómo puede la IA llevar la automatización de procesos al siguiente nivel?

¿Cómo puede la IA llevar la automatización de procesos al siguiente nivel?

Lea esto para saber cómo la Inteligencia Artificial se está volviendo popular entre las empresas de pequeña escala y cómo está aumentando las probabilidades de hacerlas crecer y dar ventaja a sus competidores.

La actualización complementaria de macOS Catalina 10.15.4 está causando más problemas que resolver

La actualización complementaria de macOS Catalina 10.15.4 está causando más problemas que resolver

Recientemente, Apple lanzó macOS Catalina 10.15.4, una actualización complementaria para solucionar problemas, pero parece que la actualización está causando más problemas que conducen al bloqueo de las máquinas Mac. Lee este artículo para obtener más información

13 Herramientas comerciales de extracción de datos de Big Data

13 Herramientas comerciales de extracción de datos de Big Data

13 Herramientas comerciales de extracción de datos de Big Data

¿Qué es un sistema de archivos de diario y cómo funciona?

¿Qué es un sistema de archivos de diario y cómo funciona?

Nuestra computadora almacena todos los datos de una manera organizada conocida como sistema de archivos de diario. Es un método eficiente que permite a la computadora buscar y mostrar archivos tan pronto como presiona buscar.