--- title: "Self-Hosted Email Server VPS: Postfix & Dovecot | CubePath" description: "Run your own mail server with Postfix and Dovecot, mailcow or HestiaCP on a VPS from $5.56/mo with IPv4. Reverse DNS and SPF, DKIM and DMARC from the panel." language: en source: https://cubepath.com/self-hosted-email --- # Run your own mail server on a VPS Postfix and Dovecot, mailcow, Stalwart or HestiaCP on your own domain, on a server with a dedicated IPv4, reverse DNS you set yourself and SPF, DKIM and DMARC from the DNS panel. From $5.56/mo with the IPv4 included. [Deploy a server](https://my.cubepath.com/deploy/vps) See the plans - Reverse DNS from the panel - SPF, DKIM and DMARC from the DNS panel - Dedicated IPv4 and IPv6 - Billed by the hour Mail stacks ## Pick the stack you want to run Build it piece by piece with our Postfix and Dovecot guides, or start from a packaged server. Every option below runs on a standard CubePath VPS. ### Postfix + Dovecot Step-by-step guide The classic pair: Postfix exchanges mail with other servers over SMTP, Dovecot stores it and serves it over IMAP. Our guide builds virtual domains and users, LMTP delivery, authenticated sending on port 587 and IMAP over TLS. [Read the guide](https://cubepath.com/docs/email-server/postfix-dovecot-complete-configuration) ### HestiaCP 1-click app A free control panel that installs a mail server (Exim and Dovecot) with webmail, next to web hosting and DNS. Mailboxes and domains are managed from the browser. [Deploy](https://my.cubepath.com/deploy/vps?app=hestiacp&plan=gp.starter) [Marketplace page](https://cubepath.com/marketplace/hestiacp) ### mailcow Step-by-step guide A complete mail suite in Docker: Postfix, Dovecot, Rspamd, ClamAV and SOGo webmail, with its own admin interface. It asks for at least 6 GB of RAM. [Read the guide](https://cubepath.com/docs/email-advanced/mailcow-dockerized-mail-server-installation) ### Stalwart Step-by-step guide A modern all-in-one mail server written in Rust (SMTP, IMAP and JMAP) with built-in spam filtering and a web admin. [Read the guide](https://cubepath.com/docs/email-advanced/stalwart-mail-server-installation) ### Proxmox Mail Gateway 1-click app A filtering gateway that sits in front of your mail server and stops spam and viruses before they reach your mailboxes. [Deploy](https://my.cubepath.com/deploy/vps?app=pmg&plan=gp.small) [Marketplace page](https://cubepath.com/marketplace/proxmox-mail-gateway) ### Move an existing server Step-by-step guide Already running Postfix and Dovecot somewhere else? Our migration guide moves mailboxes, settings and DNS with minimal downtime. [Read the guide](https://cubepath.com/docs/server-migration/mail-server-migration-postfix-dovecot) Read this first ## Sending mail directly: port 25 and reverse DNS Outgoing connections to ports 25 and 465 are blocked by default on every CubePath cloud server, over IPv4 and IPv6, as on most cloud providers: it protects the reputation of the whole IP range. Receiving mail is not affected, and port 587 is open, so you can send through an external delivery service from day one. - To deliver mail straight to other servers, request unblocking from the Network tab of the server. Requests are reviewed case by case and need at least one full billing cycle, the first invoice paid and a description of what the server will send. See [blocked SMTP ports](https://cubepath.com/docs/products/deployment/vps-network) . - Unblocking applies to an IP address, not to the server. If you release the IP or destroy the server, the ports close again for that address, and a new IP always starts blocked. - Set the reverse DNS (PTR) of the sending IP to your mail hostname, such as `mail.your-domain.com`, from the same tab. Gmail and Outlook treat a missing or generic PTR as a reason to reject mail. Plans ## Which server for your mail Starting points, not requirements: spam and virus filtering use most of the memory, and the number of mailboxes adds disk. You can resize from the panel later. | Plan | Good for | Per month | Per hour | | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | --------- | -------- | | gp.nano 1 vCPU · 2 GB RAM · 40 GB NVMe · 3 TB traffic | Postfix and Dovecot for a few mailboxes on one or two domains, or an outbound relay for your apps. | $5.56 | $0.0076 | | gp.micro 2 vCPU · 4 GB RAM · 80 GB NVMe · 5 TB traffic | Postfix and Dovecot with SpamAssassin or Rspamd and a webmail, or Stalwart, for a small team. | $9.61 | $0.0132 | | gp.starter 4 vCPU · 8 GB RAM · 100 GB NVMe · 10 TB traffic | mailcow (at least 6 GB of RAM), HestiaCP or a busier server with antivirus scanning. | $16.71 | $0.0229 | | gp.small 8 vCPU · 16 GB RAM · 200 GB NVMe · 20 TB traffic | Proxmox Mail Gateway, the plan its template recommends, or many domains and mailboxes. | $30.90 | $0.0423 | Prices in USD from the live pricing API, with the dedicated IPv4 included (hourly rate x 730 plus the IPv4), the same in Barcelona, Houston and Miami. Billed by the hour with the monthly price as the cap; a server bills while it exists, stopped included. [Deploy a server](https://my.cubepath.com/deploy/vps) [All VPS plans](https://cubepath.com/vps) Deliverability ## What gets your mail into the inbox Most delivery problems come from a short list of settings. Each card links to the guide that sets it up. [Reverse DNS Set the PTR record of each IP from the server's Network tab, so the address resolves back to your mail hostname.](https://cubepath.com/docs/products/deployment/vps-network) [SPF, DKIM and DMARC from the DNS panel If your domain uses CubePath DNS, the Recommendations tab checks the three records and creates them for you; edit SPF to add your server's IP and start DMARC at p=none.](https://cubepath.com/docs/products/deployment/dns-email-security) [DKIM signing Sign outgoing mail with OpenDKIM so receivers can check it really came from your domain.](https://cubepath.com/docs/email-server/dkim-configuration-for-email-authentication) [TLS everywhere Let's Encrypt certificates for SMTP and IMAP, STARTTLS between servers and authentication only over encrypted connections.](https://cubepath.com/docs/email-server/postfix-dovecot-complete-configuration) [Spam filtering SpamAssassin or Rspamd in front of your mailboxes keep incoming junk out, and mark what slips through.](https://cubepath.com/docs/email-server/spamassassin-configuration) [Reputation and blocklists Check your IP against blocklists, warm it up slowly and watch your logs: the guide lists every check in order.](https://cubepath.com/docs/email-server/how-to-prevent-your-emails-from-going-to-spam) Included ## What comes with every server A mail server is only as reliable as the machine under it. ### Barcelona, Houston and Miami Keep European mail in the EU on the Barcelona site, or run it in Houston or Miami for the Americas. ### Snapshots and backups Snapshot before an upgrade and roll back if it goes wrong. Automatic backups with up to 7 days of retention are optional, for a surcharge on the plan price. ### DDoS protection Network-level DDoS mitigation on every server at no extra cost. ### Hourly billing, no contract Test a stack for a few hours and destroy the server if it is not the one. You never pay more than the monthly price. ### Full root access Ubuntu, Debian, AlmaLinux, Rocky Linux, Fedora or CentOS Stream, configured exactly the way you want. ### Engineers on support The people who run the network answer, in English and Spanish, including port and reverse DNS questions. The server is unmanaged: you administer the mail software. How it works ## From a new server to your first email 1. ### Deploy the server A clean Ubuntu or Debian server for Postfix and Dovecot, or HestiaCP from the Marketplace, in the location closest to your users. 2. ### Set the names Point `mail.your-domain.com` at the server, set the reverse DNS of its IP to the same name and add the MX record. 3. ### Install and secure Follow the guide for your stack, add TLS certificates and publish SPF, DKIM and DMARC. 4. ### Start sending Send through a relay on port 587 right away, or request port 25 for direct delivery once the account meets the requirements. [Deploy your mail server](https://my.cubepath.com/deploy/vps) FAQ ## Self-hosted email on CubePath: questions ### Can I run a mail server on a CubePath VPS? Yes. Receiving mail works from the start. To send directly to other mail servers on port 25 you request unblocking for the IP, which needs one full billing cycle, the first invoice paid and a description of your use. Until then you can send through an external delivery service on port 587. ### Why is port 25 blocked? Spammers routinely abuse cloud servers to send mail, and one of them can get a whole IP range onto blocklists. Blocking outgoing ports 25 and 465 by default, as most cloud providers do, keeps the range clean for everyone who sends legitimate mail from it. ### How do I set the reverse DNS (PTR) record? From the server's Network tab: each IP has a reverse DNS field where you type your mail hostname, for example `mail.your-domain.com`. Make sure the same name resolves forward to that IP, and that Postfix announces it as its hostname. ### Postfix and Dovecot, or mailcow? Postfix and Dovecot by hand is light and teaches you how every piece works; it runs on the smallest plans. mailcow packages the same core with Rspamd, antivirus, webmail and an admin interface, at the cost of more memory (at least 6 GB). HestiaCP is the simplest if you also host websites. ### Is there a one-click mail server? HestiaCP deploys from the [Marketplace](https://cubepath.com/marketplace/hestiacp) with a mail server, webmail and DNS included, and Proxmox Mail Gateway as a spam and virus filter. There is no Postfix and Dovecot template: our [step-by-step guide](https://cubepath.com/docs/email-server/postfix-dovecot-complete-configuration) builds that stack. ### Do I need IPv6 for mail? No, but if the server has IPv6 make sure it is configured properly, with its own reverse DNS, or bind your mail software to IPv4\. Port unblocking is per IP: a server with an open IPv4 and a blocked IPv6 will fail to deliver over IPv6. ### Where should my mail server be? Close to your users and, if you handle European personal data, in the EU: the Barcelona site keeps mail in Spain. Houston and Miami serve North and Latin America. ### Is this a managed email service? No. You get an unmanaged VPS with full root access, and you install, update and monitor the mail software. Support helps with the server, the network, reverse DNS and port requests. ## Your domain, your mail server A dedicated IPv4, reverse DNS and SPF, DKIM and DMARC from the panel, in Barcelona, Houston or Miami. [Deploy a server](https://my.cubepath.com/deploy/vps) Compare plans