Poste.io is a full-featured mail server packaged as a single Docker container, providing SMTP, IMAP, webmail, antivirus, spam filtering, DKIM, SPF, and a web administration interface. It is one of the easiest ways to run a production mail server on a VPS. This guide covers deployment, configuration, and management.
Prerequisites
- VPS with Docker installed, at least 2GB RAM
- Public IP with port 25 open and PTR record configured
- Domain with DNS access
Quick Deployment
docker run -d \
--name mailserver \
--hostname mail.example.com \
--restart always \
-p 25:25 -p 80:80 -p 443:443 \
-p 110:110 -p 143:143 \
-p 465:465 -p 587:587 \
-p 993:993 -p 995:995 \
-v /data/mailserver:/data \
-e TZ=America/New_York \
-e HTTPS=ON \
-e DISABLE_CLAMAV=FALSE \
analogic/poste.io
Docker Compose
version: "3.8"
services:
mailserver:
image: analogic/poste.io
container_name: mailserver
hostname: mail.example.com
restart: always
ports:
- "25:25"
- "80:80"
- "443:443"
- "110:110"
- "143:143"
- "465:465"
- "587:587"
- "993:993"
- "995:995"
volumes:
- maildata:/data
environment:
- TZ=America/New_York
- HTTPS=ON
- DISABLE_CLAMAV=FALSE
volumes:
maildata:
Initial Setup
- Access the admin panel at
https://mail.example.com/admin - Create an admin account
- Add your domain(s) under "Virtual domains"
- Create email accounts
- Follow the DNS setup guide shown in the admin panel
DNS Configuration
# Records to add:
mail.example.com A your-server-ip
example.com MX 10 mail.example.com
example.com TXT "v=spf1 mx -all"
mail._domainkey.example.com TXT "v=DKIM1; k=rsa; p=..." # Get from admin panel
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"
# Reverse DNS (PTR) — set through your hosting provider
your-server-ip → mail.example.com
Features
- Webmail — built-in Roundcube webmail at
https://mail.example.com - Admin panel — manage domains, users, aliases at
/admin - Antivirus — ClamAV integrated (disable with
DISABLE_CLAMAV=TRUEto save RAM) - Spam filtering — Rspamd with auto-training
- DKIM signing — automatic key generation per domain
- TLS — automatic Let's Encrypt certificates
- Sieve filters — server-side email filtering via webmail settings
- Per-user quotas — configurable storage limits
Resource Optimization
# For low-memory VPS (1-2GB), disable ClamAV
docker run -d \
--name mailserver \
-e DISABLE_CLAMAV=TRUE \
...
# ClamAV uses ~800MB RAM; disabling it drops usage to ~300-500MB
# You still have Rspamd for spam protection
Backup and Restore
# Backup the data volume
docker stop mailserver
tar czf /backup/mailserver-$(date +%Y%m%d).tar.gz /data/mailserver
docker start mailserver
# Restore
docker stop mailserver
tar xzf /backup/mailserver-20250115.tar.gz -C /
docker start mailserver
# Automated daily backup
0 3 * * * docker stop mailserver && tar czf /backup/mailserver-$(date +\%Y\%m\%d).tar.gz /data/mailserver && docker start mailserver
Upgrading
# Pull latest image and recreate container
docker pull analogic/poste.io
docker stop mailserver
docker rm mailserver
# Re-run the original docker run command (data persists in volume)
docker run -d --name mailserver ... analogic/poste.io
Monitoring
# View logs
docker logs mailserver -f --tail 100
# Check container resource usage
docker stats mailserver
# Check mail queue
docker exec mailserver postqueue -p
# Test email delivery
docker exec mailserver swaks --to test@gmail.com --from user@example.com --server localhost
Best Practices
- Always configure PTR (reverse DNS) before sending email
- Use a dedicated IP for the mail server — shared IPs often have poor reputation
- Disable ClamAV on VPS with less than 4GB RAM to avoid out-of-memory issues
- Back up the
/datavolume daily — it contains all configuration, mail, and DKIM keys - Use Docker Compose for reproducible deployments
- Check deliverability with mail-tester.com after setup
- Monitor disk usage — email storage grows continuously