How to set up your own mail server on a VPS
Your own mail on a VPS means mailboxes on your own domain with no per-user fees, full control over your messages and the ability to send newsletters and notifications from your own applications. In exchange you'll have to get to grips with DNS records and look after your IP's reputation: mail providers are strict about checking who sends messages. If running your own server seems like too much work, compare it with mail in a hosting plan and a separate mail service in Mail on Your Own Domain: Hosting or a Separate Service.
What to get for your budget: personal mail, a team, full antivirus
Catalog data as of 24 Nov 2026: about 2,500 plans from 120 hosts have port 25 open or opened on request. Monthly price and what runs on it:
- 1 GB — typically about $6: Postfix + Dovecot by hand for one domain and a few mailboxes.
- 2 GB — from about $1.30, typically about $10: Mail-in-a-Box or iRedMail with webmail.
- 4 GB — typically about $17: Mailcow with anti-spam for a small team.
- 8 GB — from about $4.40, typically about $34: Mailcow with the ClamAV antivirus (about 1 GB on its own) and room to grow.
4 GB is cheapest in Denmark and Finland (about $12.50–13) and Germany (about $15); in the US it is about $20, in the UK and the Netherlands $22–23. If the mailboxes hold personal data of EU customers, a server inside the EU keeps GDPR paperwork simpler.
The key requirement: an open port 25
Mail servers pass messages to each other over SMTP on port 25. Many hosts block outbound port 25 by default to keep spam from leaving their networks. Without it your server can receive mail but can't send it. That's why this selection includes only plans from hosts where the port is open or can be opened on request to support.
What to install
- Mailcow — a ready-made Docker bundle: Postfix, Dovecot, SOGo webmail, Rspamd anti-spam and a convenient admin panel. Needs 4 GB of memory and 2 cores or more, and is the easiest to set up.
- Mail-in-a-Box and iRedMail — all-in-one installers that configure the server and DNS step by step. They run on 1–2 GB of memory.
- Postfix + Dovecot by hand — minimal resources (1 GB is enough), but more manual configuration work.
DNS: without it your mail ends up in spam
- PTR (reverse record) — the server's IP should point to your mail host's name, for example
mail.example.com. The host sets it up in the control panel or on request — check that this option is available. - SPF — a TXT record listing the servers allowed to send mail on behalf of your domain.
- DKIM — a digital signature for messages; the mail server generates the key, and you publish the public part in DNS.
- DMARC — a policy for what to do with messages that fail the checks; start with
p=nonemode and reports.
IP reputation
Before launch, check the server's IP against blacklists (Spamhaus, Barracuda and others) — the address may have been inherited from a previous owner who sent spam. If it's listed, ask the host for a different one. Start with small volumes: a new address takes weeks to "warm up", and a sudden mass mailing from it will almost certainly land in spam.
Storage and backups
Mailboxes grow for years: plan for 20–40 GB or more for a small team and keep an eye on quotas. Store backups of messages and DKIM keys off the server, for example on a separate backup VPS.