Mailcow Installation Guide: Build Your Own Email Server on Ubuntu 22.04 / 24.04
WITH SCREENSHOT PLACEHOLDERS • inboxline.com
Mailcow is a powerful, all-in-one email server platform that lets you run your entire email infrastructure on your own VPS with full control, security, and flexibility. Built using modern Docker technology, Mailcow combines Postfix, Dovecot, Rspamd, SOGo, DKIM, DMARC, and other essential components into one clean and easy-to-manage system. Whether you are sending business emails, transactional alerts, or outbound marketing campaigns, Mailcow ensures reliable delivery and professional performance.
Unlike shared hosting email or free providers, Mailcow gives you complete ownership of your IP reputation, sending limits, and mailbox management. This means your email deliverability stays in your hands—no shared IP issues, no restrictions, and no hidden limitations. Because everything runs on your dedicated VPS, you get stronger inbox placement, high security standards, and much better control over DNS authentication such as SPF, DKIM, and DMARC.
From a technical point of view, Mailcow is extremely stable and modular. Each service runs in its own Docker container, making upgrades, backups, and maintenance simple and safe. It supports API access, rate-limiting, anti-spam controls, encryption, access policies, and detailed logging—features usually found only in enterprise-level email systems.
For businesses, agencies, and email professionals, Mailcow offers the perfect balance between deliverability, performance, and cost efficiency. You can create unlimited mailboxes, manage multiple domains, set up SMTP accounts for your outbound tools, and maintain complete privacy over your communication data. Compared to cPanel email or shared-hosting mail, Mailcow provides far better inbox results and eliminates the risk of IP reputation issues caused by other users.
In simple terms, Mailcow allows you to build a professional-grade email sending infrastructure completely under your control—ideal for outbound email marketing, transactional emails, company communication, and long-term deliverability management.
1. Server Details
- IP: 157.250.202.241
- OS: Ubuntu 22.04
- Domain: mailcow.inboxlines.com
- Hostname: mailcow.inboxlines.com
2. Update Server & Set Hostname
ssh root@157.250.202.241
apt update && apt upgrade -y
hostnamectl set-hostname mailcow.inboxlines.com
nano /etc/hosts
157.250.202.241 mailcow.inboxlines.com
3. Install Required Packages
apt install -y curl wget git apt-transport-https ca-certificates gnupg lsb-release
4. Install Docker & Docker Compose
curl -fsSL https://get.docker.com | sh
apt install docker-compose -y
docker-compose –version
5. Download Mailcow & Generate Config
cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh (enter FQDN: mailcow.inboxlines.com)
6. Start Mailcow Services
docker-compose pull
docker-compose up -d
docker ps
Note : If you face any error like this during the docker-compose pull run this command
Edi the file : mailcow.conf
# vim mailcow.conf
Find these lines:
HTTP_PORT=80
HTTP_BIND=
HTTPS_PORT=443
HTTPS_BIND=
Replace them with correct values: Use these values exactly
HTTP_PORT=80
HTTP_BIND=0.0.0.0
HTTPS_PORT=443
HTTPS_BIND=0.0.0.0
This tells Mailcow:
- Bind HTTP to all IPv4 interfaces
- Bind HTTPS to all IPv4 interfaces
- Correctly generate ports section in docker-compose
Save and exit:
cd /opt/mailcow-dockerized
set -a
. ./mailcow.conf
set +a
Try again:
docker compose pull
docker compose up -d
Open your browser and visit:
https//hostname
https://mailcow.inboxlines.com/admin
Default Login Credentials:
Username: admin
Password: moohoo
7. DNS Configuration Guide
Add these DNS Records in Cloudflare/GoDaddy/Namecheap:
Type | Name | Value |
A | mailcow | 157.250.202.241 |
MX | inboxlines.com | mailcow.inboxlines.com (Priority 10) |
TXT | SPF | v=spf1 a mx ip4:157.250.202.241 ~all |
TXT | DKIM | Generated in Mailcow UI |
TXT | _dmarc | v=DMARC1; p=none; rua=mailto:postmaster@inboxlines.com |
8. DKIM Configuration
1. Login → Configuration → ARC/DKIM
2. Select your domain
3. Generate DKIM key
4. Copy TXT record
5. Add in DNS
9. SMTP Configuration (For Outbound Email Tools)
SMTP Host: mailcow.inboxlines.com
Port: 587 (STARTTLS)
Username: full email address
Password: mailbox password
10. Outbound Deliverability Optimisation
• Warm-up domain slowly
• Keep bounce rate < 2%
• Avoid spam words
• Keep healthy sending patterns
• Set SPF, DKIM, DMARC correctly
11. Restart Mailcow
cd /opt/mailcow-dockerized
docker-compose down
docker-compose up -d
Mailcow is not just an email server, it’s a complete, open-source email infrastructure designed for high deliverability, performance, and full control. By hosting Mailcow on your own VPS, you gain independence from shared hosting limitations, protect your domain reputation, and ensure better inbox placement for every outbound email. It offers built-in features like DKIM, SPF, and DMARC authentication, spam filtering, and a user-friendly web interface, making it the ideal choice for professionals who want a private, secure, and scalable mail server.
At Inboxline, we specialise in email deliverability consulting, Mailcow setup services, and outbound email infrastructure optimisation. Our experts can help you configure DNS records, improve domain reputation, and achieve top-tier deliverability for your marketing and transactional campaigns.


