Guide

Self-Hosting Email: What It Really Takes

Last updated: 30 November 2026

Installing mail server software is the easy part. Getting your messages accepted by other providers, and keeping the server safe for years, is the real work. Here is what to check before you start.

Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works

Check port 25 first

Mail servers deliver to each other on TCP port 25. Many hosting and cloud providers block it by default to limit spam. Some open it on request, some never do. Ask before you order, and describe your use honestly.

Ports 465 and 587 are for your mail program submitting messages with a login. They do not replace port 25 for receiving mail from the rest of the internet.

Once you have a server, test outgoing connectivity to a mail host's port 25, for example with nc:

nc -vz mx.example.net 25

Replace the name with a real mail host that you find with dig MX followed by a domain. A timeout often means the port is filtered somewhere along the way.

If port 25 is closed, one alternative is to receive and store mail yourself but send through an authenticated relay service. You then trust that relay with your outgoing mail.

DNS records you need

Check both directions:

dig +short mail.example.com
dig +short -x 203.0.113.10

Google's sender guidelines require valid forward and reverse DNS, TLS, and SPF or DKIM from all senders to personal Gmail accounts, with more for bulk senders.

A common trap: publishing an IPv6 address without setting its PTR and including it in SPF. Mail may then leave over IPv6 and be rejected. Either configure IPv6 fully or do not send over it.

IP reputation

Receivers judge the address you send from, not only your settings. A new IP has no history, and a previously used one may carry someone else's.

  1. Before installing anything, look up the IP at the official Spamhaus reputation checker.
  2. If it is listed, read the reason. Some lists, such as the Policy Blocklist, describe address ranges that are not expected to send mail directly, and have their own removal rules.
  3. If you cannot get it cleared, ask for help before building on that address.

Even a clean server with perfect records can land in spam folders for a while. Send normal, wanted mail to people who expect it. Never send unsolicited bulk mail; it is abuse and it will ruin the address.

Google offers Postmaster Tools for senders to see how Gmail views their domain, though small senders may see little data.

Security and ongoing work

Keep addresses such as postmaster working and read them. Review DMARC reports and logs.

When not to self-host

Think twice if any of these apply:

A middle path works well: use a hosted mail provider with your own domain. You keep control of your address and can move later, without running the server.

If you still want to learn, start with a spare domain that nothing important depends on, run it for several weeks, and only then move real mail. We offer VPS with root access; ask support about port 25 and reverse DNS before ordering, and use the server within the acceptable use policy.

Questions and answers

Can I host email on any VPS?
Not necessarily. You need outgoing and incoming port 25, a correct PTR record and an IP without serious listings. Confirm these with the provider first.

Why does my mail go to spam even though SPF, DKIM and DMARC pass?
Authentication proves who sent it, not that it is wanted. IP and domain history, message content and recipient complaints also count.

What happens to incoming mail if my server is down?
Sending servers normally queue and retry for a limited time, then return an error. Do not rely on this for long outages.

Should I use an all-in-one mail package?
It saves setup work and usually configures the parts together. You still own updates, backups, reputation and troubleshooting.

Related guides

Ready to try it? Instant VPS from $7.99 a month

See Instant VPS plansHow ordering works