About Mail-in-a-Box
Mail-in-a-Box helps individuals take back control of their email by providing a one-click, easy-to-deploy mail server in a box. It turns a fresh Ubuntu 22.04 LTS 64-bit machine into a working mail server by installing and configuring the required components. There are no user-configurable setup options, so it is designed to just work.
The installed components include Postfix for SMTP, Dovecot for IMAP, Nextcloud for CardDAV and CalDAV, z-push for Exchange ActiveSync, and Roundcube webmail. It adds spam filtering with SpamAssassin and greylisting with Postgrey, DNS with SPF, DKIM, DMARC, DNSSEC, DANE TLSA, MTA-STS and SSHFP records set automatically, and TLS certificates from Let's Encrypt. Backups use duplicity, with ufw, fail2ban and munin for protection and monitoring.
Project goals include making a good mail server easy to deploy, promoting decentralization and privacy, and keeping configuration automated, auditable and idempotent. It deliberately does not aim to be customizable by power users. Mail-in-a-Box is written in Python, released into the public domain under CC0-1.0, and has a Code of Conduct for contributors.
Key features
- One-click mail server on Ubuntu 22.04
- Postfix SMTP and Dovecot IMAP
- Roundcube webmail and Nextcloud contacts
- Automatic SPF, DKIM, DMARC and DNSSEC setup
- Let's Encrypt TLS certificate provisioning
- Backups, fail2ban and health monitoring
Good fit for
- Self-hosting personal or family email
- Small organizations running their own mail
Mail-in-a-Box: questions and answers
- What is Mail-in-a-Box used for?
- Mail-in-a-Box turns a fresh Ubuntu server into a complete self-hosted mail server with webmail, DNS, spam filtering and automatic TLS. It is a good fit for self-hosting personal or family email and small organizations running their own mail.
- Is Mail-in-a-Box open source?
- Yes. Mail-in-a-Box is open source under the CC0-1.0 licence. Its source code is on GitHub at mail-in-a-box/mailinabox and is written mainly in Python.
- Is Mail-in-a-Box free?
- Yes. Mail-in-a-Box is open source, so the software itself is free to use.
- Can I self-host Mail-in-a-Box?
- Yes. Mail-in-a-Box can be self-hosted on your own server or infrastructure; there is no official hosted version.
- What is Mail-in-a-Box an alternative to?
- Mail-in-a-Box is an open-source alternative to Gmail, Google Workspace, Fastmail and Proton Mail. Other open-source alternatives to Gmail include Mailu, Stalwart and Mailcow.
- Is Mail-in-a-Box actively maintained?
- Yes. The most recent commit to Mail-in-a-Box was on 8 November 2026, and the latest release is v77, published on 26 September 2026. The project has 15k stars on GitHub, with 26 added in the last 30 days.
Open-source alternatives to Mail-in-a-Box
See all
Mailu
Email Clients & Servers
Insular email distribution - mail server as Docker images
OSSvs Gmail★ 7.6k
Stalwart
Email Clients & Servers
All-in-one Mail & Collaboration server. Secure, scalable and fluent in every protocol (IMA
OSSvs Google Workspace★ 16k
Mailcow
Email Clients & Servers
mailcow: dockerized - 🐮 + 🐋 = 💕
GPL-3.0vs Google Workspace★ 14k
Forward Email
Email Clients & Servers
Privacy-focused encrypted email for everyone. All-in-one alternative to Gmail + Mailchimp
OSSvs Fastmail★ 1.7k
docker-mailserver
Email Clients & Servers
Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus,
MITvs Gmail★ 20k
Tuta
Email Clients & Servers
Tuta is an email service with a strong focus on security and privacy that lets you encrypt
GPL-3.0vs Gmail★ 8.2k
SaaS alternatives to Mail-in-a-Box
See all
Gmail
Email Clients & Servers
Google email service with search, filters, labels and spam protection
SaaS
Google Workspace
Productivity
Cloud suite with email, docs, calendar, meetings and storage for businesses
SaaS
Fastmail
Email Clients & Servers
Paid email provider with custom domains, calendars and contacts
SaaS
Proton Mail
Email Clients & Servers
Encrypted email service from Proton with calendar, contacts and custom domains
SaaS
Zoho Mail
Email Clients & Servers
Business email hosting from Zoho with custom domains, calendar and admin tools
SaaS
Yahoo Mail
Email Clients & Servers
Free web and mobile email service with large storage and filtering
SaaS

StartMail
Posteo
mailbox.org
Runbox
Hushmail
IceWarp
SmarterMail
Axigen
Titan Email
Rackspace Email
AOL Mail
GMX Mail
Mail.com
iCloud Mail
SMTP2GO