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
- Sign up with an email address, a password and any nickname: no ID, no phone number.
- Pay with Monero, Bitcoin, Litecoin, USDT, USDC, SOL or TRX, or by card through MoonPay. Monero is the most private way to pay; USDT or USDC on Solana confirm in seconds, and we add no transfer fee on them.
- Orders are processed automatically and delivered in about 10 minutes.
- New VPS orders have a 24-hour guarantee (see the terms for what is covered).
See Instant VPS plansHow ordering worksCheck 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
- A (and optionally AAAA) for the mail host, such as mail.example.com.
- MX pointing your domain to that host name.
- PTR (reverse DNS) for the server's IP, pointing to the mail host name. The name must resolve back to the same IP. PTR is set by whoever controls the IP address, usually in the hosting panel or through a support ticket, not at your domain registrar.
- SPF, DKIM and DMARC to authenticate your mail.
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.
- Before installing anything, look up the IP at the official Spamhaus reputation checker.
- 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.
- 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
- Never run an open relay. Only logged-in users and your own machine should be able to send to outside domains. Postfix controls this with relay restrictions; do not loosen them to make a test pass.
- Strong passwords. A single guessed mailbox password can be used to send spam and damage your reputation quickly.
- Updates. See automatic security updates, and still read release notes for the mail software.
- Certificates must renew without your help. Alert yourself before they expire.
- Firewall. Open only what you use. Follow our UFW guide and allow SSH before enabling it, or you can lock yourself out.
- Backups of mail, configuration and DKIM keys, with a tested restore. See backups with restic.
- Monitoring of disk space and the mail queue. On Postfix, postqueue -p shows queued messages.
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:
- Missing one message would cost you money or a deadline.
- Your password resets for the server's own hosting account or domain would go to that same server. An outage then locks you out of the fix.
- Nobody can respond when it breaks while you travel.
- You expect better privacy by default. Mail to other providers is still readable by them, and a server provider controls the physical machine.
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.
Ready to try it? Instant VPS from $7.99 a month
- Pick a plan: Instant 1-2, $7.99 a month or all Instant VPS plans.
- Sign up with an email address, a password and any nickname: no ID, no phone number.
- Pay with Monero, Bitcoin, Litecoin, USDT, USDC, SOL or TRX, or by card through MoonPay. Monero is the most private way to pay; USDT or USDC on Solana confirm in seconds, and we add no transfer fee on them.
- Orders are processed automatically and delivered in about 10 minutes.
- New VPS orders have a 24-hour guarantee (see the terms for what is covered).
- Before you pay you can ping our test IPs and read the live status page.
- Support is available 24/7 via email and our client ticket portal.
See Instant VPS plansHow ordering works