Skip to main content

Prerequisites

Important Decisions to Make

  1. Ensure you have full control of your domain to add records such as "A", "MX", etc. Verify that you can add records and that they are reflected on the internet.
  2. Select a domain name. For the email server, it is recommended to use a subdomain like mail.yourdomain.com. Ensure the domain is available and you have full control through your provider.
  3. Root access to the VM is required, as containers run on Docker. The VM must also be set up with other tools and configurations.

Hosting Requirements

  1. Set the hostname of the machine to the correct domain name using the following command. (Note: You may need to review and update your /etc/hosts file as well.)

    hostnamectl set-hostname <mail.example.com>
  2. Ensure port 25 is accessible on the host where the email server will be hosted. Test it with the following command:

    nc -4 -vz gmail-smtp-in.l.google.com 25

    Output:

    Connection to gmail-smtp-in.l.google.com (172.217.194.26) 25 port [tcp/smtp] succeeded!
  3. Configure the 'A' record with the IPv4 address and the 'AAAA' record with the IPv6 address in your domain hosting platform. (Note: The process varies by provider.)

    Ping should work from any external host to the email host.

    ping <mail.example.com>

    Output:

    Pinging mail.example.com [2202:1000:9000:700::15ef] with 32 bytes of data:
    Reply from 2202:1000:9000:700::15ef: time=41ms
    Reply from 2202:1000:9000:700::15ef: time=41ms
  4. Set reverse DNS for your VM at the provider hosting your VM. (Note: The process varies by provider.)

For more DNS-related requirements, visit the Mailcow Documentation.

For optimal performance, including antivirus:

ParameterMinimum ConfigurationComment
RAM8 GBThis is for 5 to 10 users. For a larger user base, more RAM will be required based on the number of concurrent users accessing emails.
CPU2 vCPU4 vCPU recommended for smoother operations with a larger user base.
Space10 GB + configured user space based on number of usersIf 3 GB per user and 20 users are planned, the minimum space should be around 70 GB.

Required Settings and Packages on the VM

Install Basic System Packages

sudo apt install net-tools

Set the Correct Time Zone

dpkg-reconfigure tzdata

After this, ensure NTP is enabled and synchronized. Run the following command to check:

timedatectl status

Output:

               Local time: Wed 2026-01-28 10:47:23 IST
Universal time: Wed 2026-01-28 05:17:23 UTC
RTC time: Wed 2026-01-28 05:17:23
Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

Network Settings for Optimal Performance

sysctl -w net.core.rmem_max=7500000
sysctl -w net.core.wmem_max=7500000

(Note: You may need to set this in /etc/sysctl.d to make it permanent on the host.)

Ensure Required Ports for Email Are Not Used or Blocked

If the following command returns anything, review and remove the processes before setting up the new email server.

ss -tlpn | grep -E -w '25|80|110|143|443|465|587|993|995|4190'

The above list covers the minimal settings required, for a more detailed and extensive list of prerequisites visit the MailCow Documentation.