Mail-in-a-Box
Self-HostedSelf-hosted email server in a box
Overview
Mail-in-a-Box is a self-hosted, all-in-one email solution that simplifies setting up a full-featured mail system. It includes IMAP/SMTP, webmail, CalDAV/CardDAV (calendar/contacts), spam filtering, and automated DNS config (DKIM, SPF, DMARC) for deliverability. Deployment uses a single shell script on Ubuntu (20.04/22.04) with a domain. It offers backup tools and an admin interface to manage accounts and server settings, putting you in control of your email data.
Self-Hosting Resources
Below is a reference structure for docker-compose.yml.
⚠️ Do NOT run blindly. Replace placeholders with official values.
version: '3'
services:
mail_in_a_box:
image: <OFFICIAL_IMAGE_NAME>:latest
container_name: mail-in-a-box
ports:
- "8080:<APP_INTERNAL_PORT>"
volumes:
- ./data:/app/data
restart: unless-stopped Key Features
- All-in-one email, calendar, and contacts server
- Automated DKIM, SPF, DMARC setup for email deliverability
- Webmail access and CalDAV/CardDAV integration
Frequently Asked Questions
? Is Mail-in-a-Box hard to install?
No—Mail-in-a-Box uses a single shell script to automate installation on an Ubuntu server. You need a VPS with Ubuntu (20.04/22.04) and a domain name; run the setup command to get your server up quickly.
? Is it a good alternative to Gmail Workspace?
Yes, if you prioritize data privacy and control. Unlike Gmail Workspace, it’s self-hosted, but it requires more maintenance (server updates, deliverability checks) than a managed SaaS service.
? Is it completely free?
Yes—Mail-in-a-Box is open-source (MIT License) with no software fees. You only pay for the VPS and domain name to host your server.
Top Alternatives
People Also Ask about Mail-in-a-Box
Tool Info
Pros
- ⊕ Privacy-focused (self-hosted email data control)
- ⊕ No recurring subscription fees
- ⊕ Simplified one-command installation
Cons
- ⊖ Requires Ubuntu server maintenance
- ⊖ Technical knowledge for initial setup and troubleshooting
- ⊖ Email deliverability may need ongoing monitoring (e.g., IP reputation)