A Step-by-Step Guide to Installing hMailServer on Windows 10 & 11

,

Create a Mail Server on Windows with Open-Source hMailServer

Setting up your own mail server on Windows is easier than many people think. If you’re looking for a free, open-source SMTP server solution for Windows, hMailServer is one of the best options available.

Requirements

  • A registered domain name
  • A Windows machine (Windows 10, Windows Server 2016/2019, or newer)
  • Open port 25 on your server

Checking if Port 25 is Open

  1. Go to Control PanelWindows Features → enable Telnet Client.
  2. Open Command Prompt and run:
    telnet smtp.gmail.com 25
    If you see a connection message, port 25 is open. Otherwise, it’s blocked.

Installing hMailServer

  1. Download hMailServer from the official website.
  2. Run the installer and set an administrator password. This password will be required to access hMailServer’s admin panel.

Configuring hMailServer

1. Adding Your Domain

  1. Open hMailServer Administrator.
  2. Go to DomainsAdd.
  3. Enter your domain name and click Save.
Adding domain in hMailServer

2. Adding Email Accounts

  1. Go to AccountsAdd.
  2. Enter a username (e.g., user@yourdomain.com) and password.
  3. Click Save.
Creating an account in hMailServer

Generating and Adding a DKIM Key

To improve email deliverability, configure DKIM:

  1. Download and install OpenSSL for Windows.
  2. Open Command Prompt (as Administrator) and run:
    
    cd "C:\Program Files\OpenSSL-Win64\"
    openssl.exe genrsa -out dkim.private.key 1024
    openssl.exe rsa -in dkim.private.key -out dkim.public.key -pubout -outform PEM
                    
  3. In hMailServer, go to SettingsAdvancedDKIM Signing.
  4. Specify the selector (e.g., mail) and the path to dkim.private.key.
DKIM configuration in hMailServer

Configuring DNS Records

In your domain’s DNS settings, add the following records:

Type Host Value
A mail Your server’s public IP address
TXT @ v=spf1 a mx ip4:YOUR.IP.ADDRESS ~all
TXT _dmarc v=DMARC1; p=quarantine; rua=mailto:dmarc@yourdomain.com; ruf=mailto:dmarc@yourdomain.com; sp=quarantine
TXT mail._domainkey v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY

Testing Your Email Server

Use a mail client such as Thunderbird or Outlook with these settings:

Hostlocalhost
Useruser@yourdomain.com
PasswordYour account password
Port587
TLSNone

Conclusion

With hMailServer, setting up a fully functional Windows-based mail server is straightforward. By adding DKIM, SPF, and DMARC, you can significantly improve email deliverability and security.