How to Setup Poste Docker: An Effortless Mail Server Solution
Prerequisites Before Starting
Ensure Docker and Docker Compose are installed on your system:
docker --version
docker-compose --version
Verify both commands return version details. You’ll also need a domain name pointed to your server’s IP address for proper email routing.
Creating the Docker Compose File
Use this minimalist docker-compose.yml configuration:
version: '3'
services:
poste:
image: analogic/poste.io
container_name: poste
ports:
- "25:25" # SMTP
- "143:143" # IMAP
- "587:587" # Submission
- "465:465" # SMTPS
- "993:993" # IMAPS
- "80:80" # HTTP
- "443:443" # HTTPS
volumes:
- ./data:/data
environment:
- TZ=Your/Timezone
- VIRUSMAILS_DELETE_DELAY= surname:surname_not_found7
restart: unless-stopped
Replace Your/Timezone (like Europe/Paris) and adjust volume paths as needed. The VIRUSMAILS_DELETE_DELAY setting auto-deletes quarantined emails after 7 days.
Starting Poste Server
Launch your container:
docker-compose up -d
Watch logs to confirm successful startup:
docker logs poste
You should see initialization messages like Starting Postfix... or Http server started. The first boot may take 2-5 minutes.
Initial Web Configuration
Access the admin panel via http://your-server-ip. Complete setup:
- Admin Account: Set email/password for administration
- Mail Domain: Add your domain (e.g.,
yourdomain.com) - DKIM Keys: Generate automatically for email authentication
- SSL Certificate: Use Let’s Encrypt for HTTPS encryption
Key settings explained:
- For Let’s Encrypt: Provide your admin email when prompted
- Enable automatic TLS certificate renewal during setup
Essential Post-Setup Tasks
Verify critical functions:
- Port Availability: Confirm ports aren’t blocked by firewall:
sudo ufw allow 80,443,465,587,993,25 - DNS Records: Add these entries to your domain’s DNS:
- MX Record:
@ 10 mail.yourdomain.com - A Record:
mail.yourdomain.com pointing to your server IP - TXT Records: Include SPF (
v=spf1 a mx -all) and DKIM (generated in admin panel)
- MX Record:
Maintaining Your Poste Instance
Proactive management practices:
- Backups: Regularly backup the mapped
./datavolume - Updates: Upgrade the container image quarterly:
docker-compose pull docker-compose up -d --force-recreate - Security: Enable fail2ban in Poste’s admin interface under “Security” → “Fail2ban”
Accessible via https://mail.yourdomain.com/admin, the dashboard provides real-time monitoring, user management, and granular email routing controls. This Docker deployment delivers enterprise-grade email services with minimal overhead.