Fork me on GitHub


Take back control of your email with this easy-to-deploy mail server in a box.

What is it?

Mail-in-a-Box lets you become your own mail service provider in a few easy steps. It’s sort of like making your own gmail, but one you control from top to bottom.

Technically, Mail-in-a-Box turns a fresh cloud computer into a working mail server. But you don’t need to be a technology expert to set it up.

Here’s how you can get a Mail-in-a-Box running:


Current Version

v0.20 / September 23, 2016

install start here!

release notes


Need Help?

  1. Check the maintenance guide.
  2. Ask on the forum. Other users may be able to help.
  3. Found a bug? Open an issue on github.
  4. Or try our Slack chatroom.
installs yesterday. installs per week Aug 2014-present shown below.

What’s inside the box?

Each Mail-in-a-Box provides webmail and an IMAP/SMTP server for use with mobile devices and desktop mail software. It also includes contacts and calendar synchronization.

Roundcube Webmail
ownCloud Contacts
A Control Panel

The box also includes automatic DNS configuration, spam filtering, greylisting, backups to Amazon S3, static website hosting, and free TLS (SSL) certificates from Let’s Encrypt. Your box can host mail for multiple users and multiple domain names.

It implements modern mail protocols (SPF, DKIM, and DMARC) and the latest security best practices, including opportunistic TLS, strong ciphers, and HSTS. When enabled, DNSSEC (with DANE TLSA) provides a higher level of protection against active attacks. Exchange ActiveSync is also available as a beta feature.

How do I get it?

The setup guide walks you through getting your own box set up. Users report it taking just a few hours to get to a fully operational system. And see the video above!

If you are an expert and have a domain name and a completely fresh Ubuntu 14.04 machine running in the cloud, you basically just run on that machine:

curl -s | sudo bash

You will be asked to enter the email address you want and a few other configuration questions. Consult the setup guide for complete details. See the README on github for advanced instructions.

Please note that the goal of this project is to provide a simple, turn-key solution. There are basically no configuration options and you can’t tweak the machine’s configuration files after installation. If you are looking for something more advanced, try iRedMail or Modoboa.

Note: Mail-in-a-Box’s maintainer works on Mail-in-a-Box in his limited free time. Your mileage may vary.

Why build this?

Mass electronic surveillance by governments revealed over the last several years has spurred a new movement to re-decentralize the web, a movement to empower individuals to be their own service providers again.

Although the core protocol of email, SMTP, is inherently decentralized, in practice email has become highly centralized because it is so damn difficult to implement the dozens of modern protocols that surround it. Mail-in-a-Box takes care of all of that, and no more.

This is important not just for privacy, but for the ability for the web to evolve and improve as it always has: through the ability of everyone to see how it works, tinker, and propose innovative changes.


If you need help, please check the maintenance guide and then ask on the forum. If you think you have found a problem in Mail-in-a-Box or don’t get a response on the forum, then open an issue on github.

We will post announcements and security advisories to our twitter account @mailinabox, the announcements section of the discussion forum, and our Slack chat (see above).

Do not tweet questions: Always start on the forum so others can benefit from seeing your question too.


Mail-in-a-Box is based on Ubuntu 14.04 LTS 64-bit and uses very-well-documented shell scripts and a Python management daemon to configure the system. Take a look at the system architecture diagram and security practices.

Development takes place on github at

Note that the goals of this project are to . . .

  • Make deploying a good mail server easy.
  • Promote decentralization, innovation, and privacy on the web.
  • Have automated, auditable, and idempotent system configuration.
  • Not make a totally unhackable, NSA-proof server (but see our security practices).
  • Not make something customizable by power users.

Additionally, this project has a Code of Conduct, which supersedes the goals above. Please review it when joining our community.

Mail-in-a-Box is dedicated to the public domain using CC0.

Joshua Tauberer (@JoshData) began this project in 2013 and is the primary maintainer. Thank you to all of the contributors!


This project was inspired in part by the "NSA-proof your email in 2 hours" blog post by Drew Crawford, Sovereign by Alex Payne, and conversations with @shevski, @konklone, and @GregElin.

Mail-in-a-Box is similar to iRedMail and Modoboa.

Mail-in-a-Box is based on Postfix, Dovecot, Z-Push, Roundcube, ownCloud, Apache SpamAssassin, Postgrey, Nginx, @konklone’s nginx config, and more.