Complete Guide to Building a Self-Hosted Mail Server on VPS with iredMail: Professional Google Workspace Alternative
A detailed guide on setting up a self-hosted mail server on VPS using iredMail, a professional, cost-effective solution to replace Google Workspace with full data control, high...
Introduction to Self-Hosted Mail Server with iredMail
In the digital era, owning a dedicated business email system is crucial for data protection, professional branding, and full control over internal communications. Instead of relying on public email services like Google Workspace, many businesses are shifting to self-hosted email solutions using iredMail on VPS. This open-source, free, and highly flexible platform enables complete control over email infrastructure—from DNS configuration to security and user management.
iredMail is a comprehensive email server solution built on proven technologies such as Postfix, Dovecot, MySQL, and Roundcube. Its intuitive web-based admin interface allows organizations to deploy a professional email system without monthly subscription fees. This guide walks you through the full process of installing and configuring iredMail on a VPS, including setup, verification, and security hardening.
Prerequisites and Preparation
To successfully deploy iredMail, ensure the following requirements are met:
- VPS running Ubuntu 20.04 or 22.04 (64-bit)
- Static IP address (not dynamic)
- Registered domain name (e.g.,
email.yourcompany.com) - Open required ports: 25 (SMTP), 587 (SMTP TLS), 143 (IMAP), 993 (IMAPS), 80 (HTTP), 443 (HTTPS)
- SSH access with root or sudo privileges
Before installation, configure your domain’s DNS records as follows:
MXrecord: Point to your email server (e.g.,email.yourcompany.com)Arecord: Map the email domain to your VPS IPSPF,DKIM, andDMARCrecords to improve email deliverability and prevent spoofing
Installing iredMail on VPS
Execute the following commands on your VPS to begin the iredMail installation:
# Update system packages
sudo apt update && sudo apt upgrade -y
# Download and extract iredMail
wget https://iredmail.org/iredmail-1.6.0.tar.gz
tar -xzf iredmail-1.6.0.tar.gz
cd iredmail-1.6.0
sudo ./iRedMail.sh
The installer will prompt you to select your operating system, domain name, admin password, and database settings. Choose Ubuntu and provide the required information.
Once installation completes, access the web admin panel at:
https://email.yourcompany.com:8443
Verification and Security Hardening
After installation, perform the following steps to verify and secure your system:
- Log in to the iredMail admin panel using
[email protected]and your set password. - Create new user accounts and assign email addresses.
- Test sending and receiving emails using clients like Thunderbird or Outlook.
- Enable SSL/TLS using Let's Encrypt for encrypted connections.
- Install and configure Fail2Ban to block brute-force attacks.
Verify that core services are running correctly:
sudo /etc/init.d/postfix status
sudo /etc/init.d/dovecot status
Professional Alternative to Google Workspace
Compared to Google Workspace, iredMail offers several advantages:
| Feature | Google Workspace | Self-Hosted iredMail |
|---|---|---|
| Cost | Monthly subscription | One-time setup, low operational cost |
| Data Control | Limited | Full control |
| Security | Google-managed | Customizable to your needs |
| Scalability | Fixed by plan | Upgrade hardware as needed |
This solution is ideal for businesses that want to keep internal data in-house, reduce long-term costs, and maintain maximum control. iredMail is suitable for both small and large organizations, especially when integrating with internal systems such as CRM, ERP, or internal management tools.
For more on self-hosted solutions, see: Deploy and Run Local LLM AI on VPS with Ollama and Open WebUI.
Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
