Back to Blog

Self-Hosted Email Server: Complete Privacy Guide

Take control of your email with a self-hosted mail server. Learn to deploy Mailcow or Mail-in-a-Box for complete email privacy and independence from big tech.

Posted by

Self-hosted email server for privacy

Why Self-Host Email?

Gmail reads your emails to serve targeted ads. Microsoft scans your Outlook messages. Every major email provider has access to your most private communications. Self-hosting your email server is the ultimate privacy move.

Warning: Self-hosted email is one of the more challenging services to run. But for those who value privacy, it's worth the effort.

Prerequisites

  • A VPS with static IP (home IPs are often blacklisted)
  • A domain name with DNS control
  • Reverse DNS (PTR record) configured
  • Ports 25, 465, 587, 993 open

Mailcow: Dockerized Email

Mailcow is a complete email solution with webmail, antispam, antivirus, and easy management - all in Docker containers.

# Clone Mailcow
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized

# Generate configuration
./generate_config.sh

# Edit mailcow.conf
MAILCOW_HOSTNAME=mail.yourdomain.com
TIMEZONE=America/New_York

# Start Mailcow
docker compose up -d

Essential DNS Records

# MX Record
yourdomain.com.    MX    10    mail.yourdomain.com.

# A Record
mail.yourdomain.com.    A    YOUR_SERVER_IP

# SPF Record
yourdomain.com.    TXT    "v=spf1 mx ~all"

# DKIM (generated by Mailcow)
dkim._domainkey.yourdomain.com.    TXT    "v=DKIM1; k=rsa; p=..."

# DMARC
_dmarc.yourdomain.com.    TXT    "v=DMARC1; p=quarantine; rua=mailto:[email protected]"

Deliverability Tips

  • Warm up your IP gradually - don't send bulk email immediately
  • Monitor blacklists with tools like MXToolbox
  • Set up proper SPF, DKIM, and DMARC
  • Use a reputable VPS provider (avoid cheap hosts)
  • Consider a relay service for outbound mail initially

Is It Worth It?

Self-hosted email requires ongoing maintenance and monitoring. For most users, a privacy-focused provider like ProtonMail or Tutanota is a better balance. But if you want complete control and are willing to put in the work, self-hosted email provides unmatched privacy.

Continue Reading