FormoHost

Guide · Email

How to Run Your Own Mail Server on a VPS

To run your own mail server, you need a VPS with port 25 open, a reverse DNS (PTR) record, and a clean dedicated IP. Then you add six DNS records, test, and start sending slowly. This guide walks through each step. On FormoHost, port 25 is open and we set reverse DNS for you, on KVM VPS in 44 countries from $12 a month plus 10% tax.

  • port 25 open
  • reverse DNS
  • dedicated IPv4
  • full root
01Step by step5 steps
01

Check the VPS can send mail

Many cloud providers block port 25, the port mail servers use to talk to each other. If port 25 is blocked, your server can receive mail but cannot deliver it. Before you buy, check three things:

  • Port 25 is openfor outgoing mail, not only incoming.
  • Reverse DNS (PTR) can be setso your IP points back to a name like mail.example.com.
  • A dedicated IPv4so your sending reputation is yours alone.
02

Pick a mail server stack

A mail server is several programs working together: one to send and receive (SMTP), one to store mailboxes (IMAP), a spam filter and a webmail. An all-in-one package installs them together.

Common self-hosted mail stacks
StackGood forMemory
Mail-in-a-BoxOne domain or a few, the fastest setup512 MB minimum, 1 GB recommended
mailcowTeams, many domains, a full web admin panel6 GiB plus 1 GiB swap minimum
Postfix and DovecotPeople who want to set every part by handSmall; depends on what you add

Memory figures are from each project's own documentation: Mail-in-a-Box setup guide and mailcow system requirements. Check them again before you install, as they can change.

03

Add the DNS records

DNS records tell other mail servers that your server is allowed to send for your domain. Most mail problems come from a missing or wrong record here.

DNS records for a self-hosted mail server
RecordWhat it doesExample
APoints your mail hostname to the server IPmail.example.com → 203.0.113.10
MXTells the world where to deliver your mailexample.com → mail.example.com
PTRPoints the IP back to your hostname203.0.113.10 → mail.example.com
SPFLists the servers allowed to send for youv=spf1 mx -all
DKIMSigns each message so it cannot be changedYour mail stack creates this key
DMARCTells receivers what to do when checks failv=DMARC1; p=none; rua=mailto:you@example.com

You set the A, MX, SPF, DKIM and DMARC records at your DNS provider. The PTR record is set by whoever owns the IP. On FormoHost, open a ticket with the hostname you want and we set it for you.

04

Test before you send

Send a test message to a Gmail account. Open it, choose Show original, and check that SPF, DKIM and DMARC all say PASS. Also check that your IP is not on a public blocklist. If a check fails, fix the DNS record first, then test again.

05

Start slowly

A new IP has no reputation yet. Send a small amount of normal mail in the first weeks, and grow from there. Only send mail that people asked for. Bulk unsolicited email gets any IP blocked fast, and it is not allowed under our terms of service.

02QuestionsMail server

FAQ

Short answers about running mail on a VPS. Billing, delivery and refunds are covered in the Help centre.

Open the Help centre

Is port 25 open on FormoHost VPS?

Yes. Port 25 is open on every FormoHost VPS, so your mail server can send and receive mail directly.

Can I set reverse DNS (PTR)?

Yes. Open a ticket with the hostname you want, for example mail.example.com, and we set the PTR record for your IP.

How much RAM does a mail server need?

It depends on the stack. Mail-in-a-Box recommends 1 GB. mailcow needs at least 6 GiB of RAM plus 1 GiB of swap.

Why does my mail go to spam?

Usually a missing PTR, SPF, DKIM or DMARC record, or a new IP sending too much too soon. Check the message headers, fix the records, and send slowly at first.

Port 25 open and reverse DNS on request, from $12/mo.

See plans with port 25 open
Ready when you are

Your own mail server, in 44 countries.

Pick a country, pick a plan, and your KVM server is ready within 24 hours. Dedicated IPv4 on every plan, port 25 open, full root access.