Back to articles
AI & Cloud

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...

DPTCloud Engineering4 min read
Complete Guide to Building a Self-Hosted Mail Server on VPS with iredMail: Professional Google Workspace Alternative

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:

  • MX record: Point to your email server (e.g., email.yourcompany.com)
  • A record: Map the email domain to your VPS IP
  • SPF, DKIM, and DMARC records 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

DPTCloud Tier III Infrastructure

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.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478