# Introduction

Before we start we will have to make a few clarifications. For the installation and the configurations below we use two domain names, one for the mail server:


which will be used to access the mail server (mail boxes, configurations of the mail server, etc.) and one for the domain name:


which will be used for the email accounts (for example: [email protected]).

It is important to understand that the mail server must have a domain name which corresponds to it (in our case this is mail.example.com) but it can have multiple domain names for the email accounts (like: [email protected], [email protected], [email protected], etc.). In our case, we will use only one domain name for the email accounts.

Feel free to change them to your own domains or sub domains, but keep in mind something very important, all domains must be registered and verified, otherwise you take the risk your server or IP address to be blocked.

Also, the domain name mail.example.com used for the mail server must be configured to point to the IP address of the machine which is going to be used as a mail server and where you will install "EasyMail". Example configuration:

Type: A Record
Name: @

All commands below must be run as root or another user with root privileges.

# Server Requirements

  • Dedicated machine or Virtual private server (VPS) and parametres not lower than:
    • RAM (or RAM + SWAP) >= 1GB
    • HDD/SSD 10 GB.
  • Any type of machine with Docker.

# Install

Install Docker if you still don't have it on your machine. For further information check Docker installation.

We will use a docker image of Ubuntu 16.04. Go to the terminal of your machine and execute the following command (read below first):

docker run -itd -p=110:110 -p=25:25 -p=995:995 -p=80:80 -p=443:443 -p=587:587 -p=993:993 -p=143:143 -p=465:465 -h "mail.example.com" --name="easymail" easymail/easymail:v1.0.7 /bin/sh -c "bash /opt/easymail/post_install.sh mail.example.com; exec /bin/bash" 

When the installation completes, attach to the container with the help of:

docker attach ID-OF-THE-CONTAINTER

and go to the directory below and open the config file:

cd /opt/easymail/
apt-get install nano -Y				
nano config.ini

In this file, you will find the credentials which you can use to access your Web Interface, API, etc.

# Configuration

MX record


  • Go to the domain register of your domain names.
  • Add a new MX record for the domain you want to use for you emails. Example:
Hostname: example.com
Priority: 0

CNAME records

The configuration of the CNAME is required if we want to configure our email address with a Desktop mail client. Steps:

  • Go to the domain register of your domain names.
  • Add the following two CNAME records for the domain name of the maill server. Example:
Name: autoconfig 
Hostname: mail.example.com.


Name: autodiscover
Hostname: mail.example.com.

With the help of these CNAMES, the mail server is able to generate the following XMLs:



They are used by the desktop mail clients for automatic configuration with your mail server. You can also use the information within the XML for other manual setups.

Please take into account that we can access the XML documents through port 80 but this port may vary depending on the configurations of your web service.

SPF record

It is up to you, how you will set up the SPF record but for the sake of clarity we will present a short example.

If you want to know more about how to add SPF records and the different configuration options just google for "add SPF record" or read this tutorial SPF Record.


  • Go to the domain register of your domain names.
  • Add the following TXT record to the domain name used for the email accounts (in our case this is example.com):
Name:  @
Text: "v=spf1 a:mail.example.com ~all"

Everyone who receives an email from an email account with domain name example.com (for example: [email protected]) can check the SPF record of this domain and to see that it authorizes only the server with IP address recorded in the DNS A record of the mail server mail.example.com, to send emails. If somebody else tries to send emails on behalf of example.com from a different server, this server most probably will go to the spam filters and permanently blocked.

PRT record

It is a good idea to consider the configuration of the PRT record because there are SPAM filters which take this configuration into account.

# RoundCube

“EasyMail” comes with a nice mail client “RoundCube”. In order to access it go to your web browser and type the following:




In order to log in, use the credentials from config.ini - read chapter "Install".

When you access your email account with RoundCube, you can change your password from “Settings” -> “Password”.

# Add email accounts and use the API

If you want to add new email account, declate DKIM record, add SSL certificates, etc., you can use the API.

If you have any issues and questions during the Installation, we would like to hear them and to help.