How to Set Up Your Own Email Server on Windows PC

Host your own email server Featured

It hardly shocks anyone today that popular web-mail providers, including Gmail, Yahoo and Outlook, are routinely scanning emails. Indeed, as the cliched adage goes: “If you’re not the consumer, you’re the product.

Should privacy lovers then simply surrender to the might of Big Data firms? Not when there are so many nice alternatives to popular web-mail providers. If you are willing to learn how to set up a basic email server, you will be surprised at how safe and private emails can truly be.

Here we will show you how you can host your own email server right in your Windows PC.

The Easy Way Out – hMailServer

hMailServer is one of the best free, open-source email servers for Windows. It is commonly used by ISPs, governments, educational institutions and more. The application comes with built-in spam control by SpamAssassin and supports a fast and easy download/installation.

hmailserver setup

Once you have downloaded it, run the Installer. In the below screen, select “Server” only if you want your local computer to work as a server. If you set up a server elsewhere, only select “Administrative tools” to remotely manage that server.


You will have to set up a password during installation. Write it down somewhere because you will need it every time you launch the application.

Connect hMailServer Administrator

Once the dashboard is open, enter a new website domain (with SMTP enabled from a hosting provider). After creating the domain, head towards “Protocols” followed by “SMTP.” Here, you must set up the Local host name as “localhost.”

Localhost SMTP settings in hMailServer Administrator

Finally, click the “Accounts” item. Here, you can create an email address for which you need prior access to a top-level domain name and its DNS settings. Basically, every time you send an email, the message first gets stored in hMailServer and is later relayed to the IP address of the DNS.

DNS settings are easily available from any purchased domain’s control panel. You will have to update Mail Exchange records (MX) for the domain. The exact procedure to update MX records varies from domain to domain. For example, updating a detailed MX record for a domain purchased with GoDaddy has been explained here.

New email address set up with hMailServer

You can also enable options for auto-reply, forwarding, greylisting, DNS blacklists and more in hMailServer. But, we will reserve these options for the below step. Once your email server has been successfully set up, you will need a client like Thunderbird or Outlook Express to read/write those emails.

Set Up Hosted Email Using Thunderbird Client

Download and install Mozilla Thunderbird. You will have to immediately set up an email account there. Use the same email ID and password that you would normally use with the web-hosting provider.


You will soon be prompted to the next screen where you must choose “Manual Config” to fine-tune your Thunderbird client settings.


At this stage, you must set up your existing email account. The server hostname should be “localhost,” as you previously enabled those settings with hMailServer. As per hMailServer guidelines, use “143” for IMAP port, “993” for IMAP via SSL/TSL and either “465” or “587” for SMTP port.

Thunderbird Localhost Setting

Additionally, you can change server settings from the Thunderbird account. Once the email address has been configured with the client, you can readily start using your new web host’s email service.

Server Settings Thunderbird

You can use the Thunderbird mail client to run as many private email instances on hMailServer as you want. The email server is up and running and configured with the original email.

Multiple email accounts Thunderbird

As an optional step, you might want a webmail facility that works with your new email server for accessing emails on the go. SquirrelMail is one of the popular web-mail clients favored by IT admins. It has a file-based configuration (Perl-based) system for configuration based on the steps described here. In case you are unable to run the configuration, you can change the values for hMailServer manually.


Hosting an email server on your own requires some precautions and maintenance efforts. First, it is very important that your domain and server IP are in good health. You must keep track if your server IP is in some kind of public blacklist. Use this tool to find out if you are indeed going to have troubles. Sometimes web-mail providers like Gmail blacklist emails arriving from a particular server’s IP address because of incorrect DNS settings.

Have you considered going for your own email server? Which solutions did you use?

Sayak Boral
Sayak Boral

Sayak Boral is a technology writer with over eleven years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox