You may value your privacy and want to break away from email providers like Gmail, Outlook, or Yahoo. You can set up an email server and prevent companies from scanning your emails or sending targeted ads. Here's a quick guide to get you started.
Pick the Device
To set up an email server, you need a dedicated device you want to run it from. It could be a physical server.
Servers allow you to dedicate the most resources to a specific task. You can load up a server with a ton of drives that can handle the email load.
But this can get pricey. A great alternative is a dedicated computer.
It does not need to be super powerful, but it needs to have a decent hard drive space and a solid power supply.
Windows or macOS computers are fine, but Linux OS systems are a lot more customizable and less restrictive.

Pick the Software
Once you've picked a device, you need email server software. There are a lot of programs available if you're willing to pay.
But there are free and open-source alternatives out there.
A good option for Windows is hMailServer. It supports the standard email protocols. It also has built-in spam protection and attaches to your antivirus program to scan emails.
Postal is another solid option. It's compatible with all operating systems and packed with features.
To run Postal, it's recommended you have at minimum 4GB RAM, a CPU with at least 2 cores, and 100GB of disk space.

Connect to the Network
Now that you've found your device and software, you'll want to connect your server to the internet.
Email servers require a domain name. Whatever software you choose, there should be specific instructions on how to get to those settings.
The domain name does not need to be super specific, just identifiable to you.
Another setting you will want to check is if the proper ports are active. Ports 25, 110, and 143 are all necessary ports for your email server to function correctly.
You'll have to enable some features manually such as forwarding, auto-reply, blacklists, etc.
And connect your server wired, not wireless. Wireless connections can be spotty and get bogged down by other devices.

Wrapping Up
Now that your email server is set up, you just need a client to read and write emails. Thunderbird is an excellent option for this.
When you open Thunderbird, log in with the domain credentials you made earlier. Email servers require maintenance and upkeep, so set aside some time to check for updates.
Sometimes, email providers can blacklist incoming emails, so keep an eye on the server's IP, domain, and DNS settings.