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

Mail-in-a-Box lets you become your own mail service provider in a few easy steps.


Mail-in-a-Box is an open source software bundle that makes it easy to turn your Ubuntu server into a full-stack email solution for multiple domains.Mail-in-a-Box is designed to handle SMTP, IMAP/POP, spam filtering, webmail, and even DNS as part of its all-in-one solution.

System Requirements

To setup Mail server using Mail-in-a-Box, you must have the following requirements.

  • Ubuntu 14.04 64bit VPS (Fresh installation).
  • 768MB RAM or more. 1GB is recommended.
  • 30GB or more Hdd free space.
  • Add proper MX records in your DNS server.
  • If your mail server is behind a firewall/Router, you should allow the following ports: 22 (SSH), 25 (SMTP), 53 (DNS; must be open for both tcp & udp), 80 (HTTP), 443 (HTTPS), 587 (SMTP submission), and 993 (IMAP).


Following are the key features of Mail-in-box

  • Automatic DNS configuration
  • Spam filtering.
  • Greylisting.
  • Backups to Amazon S3, static website hosting.
  • Free TLS (SSL) certificates from Lets Encrypt.
  • Host mail for multiple users and multiple domain names.

Installation Instructions

SSH into your new VPS. Use the IP address that you took note of earlier.

$ ssh This email address is being protected from spambots. You need JavaScript enabled to view it..0

Your root user password can be found in the Vultr control panel, in the Overview section.

Copy and paste the following into your terminal.

$ curl -s https://mailinabox.email/setup.sh | sudo bash

Several Ubuntu packages will now be installed for you. Eventually, you'll be asked a few installation questions:

  • Your email address This will default to something like This email address is being protected from spambots. You need JavaScript enabled to view it.. Change that to whatever you prefer.
  • Hostname This should default to the hostname that you have already set up for your VPS, for example box.example.com. Leave this as-is.
  • Configuring tzdata Select your timezone.
  • Password Finally, you'll be asked to enter a new password. This will be used for your new email account, as well as logging into the admin interface.

Once installation is complete, you'll be presented with a success message, and a website link to the admin interface.

Your Mail-in-a-Box is running.

Please log in to the control panel for further instructions at:

You will be alerted that the website has an invalid certificate. Check that
the certificate fingerprint matches: