Setting Up Your Email Server with Mailcow: Challenges and Lessons Learned


Setting up your own email server is a rewarding but challenging project. In this post, I’ll share my experience configuring a Mailcow email server from scratch. I’ll walk you through the process, highlight common hurdles like port 25 restrictions on AWS, Google Cloud, and some VPS providers, and explain why I ultimately chose Hostinger as my VPS provider. By the end of this guide, you’ll have a clear understanding of the steps involved, the difficulties to anticipate, and the lessons I learned along the way. If you’re considering hosting your own email server, this post is for you!
1. Why Set Up Your Own Email Server?
• Privacy, control, and independence.
• Avoid reliance on third-party providers.
• Learning opportunity for system admins and tech enthusiasts.
2. Choosing the Right VPS Provider
• Issues with AWS, Google Cloud, and most VPS providers blocking port 25.
• Why port 25 matters for email delivery.
• Why I chose Hostinger: No port 25 block, affordable, and beginner-friendly.
3. Prerequisites
• Basic understanding of Linux, Docker, and command-line tools.
• VPS instance with sufficient RAM (e.g., 4GB) and storage space.
• Domain name for email configuration (SPF, DKIM, DMARC, etc.).
4. Step-by-Step Process
1. Provision Your VPS
• Set up a VPS with Hostinger (or any provider that doesn’t block port 25).
• Update and secure the server (firewall, SSH keys, etc.).
2. Install Docker & Docker-Compose
• Commands to install Docker and Docker-Compose on the server.
3. Install Mailcow
• Clone Mailcow from GitHub.
• Run the docker-compose command to launch Mailcow.
4. DNS Configuration
• Set up essential DNS records (SPF, DKIM, DMARC, MX).
• Verify that DNS changes propagate correctly.
5. Test Your Mail Server
• Send a test email to check if it’s being delivered.
• Use tools like Mail Tester to verify SPF, DKIM, and DMARC compliance.
Self-hosting an email server is a rewarding learning experience for system administrators, security enthusiasts, and anyone passionate about mastering email infrastructure. While the process can be challenging, especially with port 25 restrictions and email authentication hurdles, choosing the right VPS provider can save you days of frustration. Hostinger, for instance, offers a simple path forward by not blocking essential ports. Be prepared for DNS propagation delays, which require patience as changes take time to reflect. Ultimately, the knowledge and skills you gain from this process are invaluable, equipping you to better understand email security, server configuration, and self-hosted solutions.
Subscribe to my newsletter
Read articles from Hans Wang directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
