How to Setup Your Own Email Server in 5 Minutes

Setup your own personal mail server

Have you ever wanted to quickly setup your own dedicated mail server? Setting up a personal email server is very easy to do. We’ll show you everything you need to quickly deploy your own mail server on a ServerMania Hybrid, Cloud, or Dedicated Server using the popular Mail In A Box platform.

Why Create Your Own Mail Server?

There are many reasons why you should setup your own mail server:

  • Privacy: When you setup your own mail server, you know that you are the only mailbox on that server sending mail. This means that you can be confident that the privacy of the server is optimal.
  • Security: Managing your own mail server means that you can maintain the highest level of security. When other mail users are on the same server, you never know what security policies may be compromised.
  • Reliability: When you create your own mail server, you never have to worry about other users sending abusive mail on the server. This ensures reliability and uptime can be easily maintained.

Mail Server System Requirements

  • A Hybrid, Cloud, or Dedicated Server with ServerMania – this will need to be a server dedicated to running the mail server
  • Ubuntu Operating System
  • 25Gb Disk Space
  • 1GB of RAM

Mail Server Components

This guide will quickly and automatically setup every required component required to create your own mail server:

  • SMTP (postfix)
  • IMAP (dovecot)
  • CardDAV/CalDAV (Nextcloud)
  • Exchange ActiveSync (z-push)
  • Webmail (Roundcube)
  • Static website hosting (nginx)
  • Spam filtering (spamassassin)
  • Greylisting (postgrey)
  • DNS (nsd4) with SPF, DKIM (OpenDKIM), DMARC, DNSSEC, DANE TLSA, and SSHFP records automatically set
  • Backups (duplicity)
  • Firewall (ufw), intrusion protection (fail2ban), and system monitoring (munin)

Mail Server Installation Instructions

We’ll begin by logging into root via SSH to your server:

ssh root@IP-Address

Update all server packages:

apt-get update

Install git, which will be used to download the mail server install script:

apt-get install git

Download the mail server installation files:

git clone https://github.com/mail-in-a-box/mailinabox

Change into the script directory:

cd mailinabox

Start the installation script:

sudo setup/start.sh

During the install, enter the email address and domain that the mail server will be based upon. You will then select geographic area and nearest city.

Once the install is complete, we will finish the process by running the configuration script:

sudo mailinabox

We’ll complete the installation by rebooting the server:

reboot

Installation of your personal mail server is now complete.

Configure Domain Settings

You will need to configure a few components at your domain name registrar in order to connect your domain to your mail server:

  • Update the glue records for ns1.yourdomain.com and ns2.yourdomain.com to point to the main IP of your server
  • Set the nameservers of the domain to ns1.yourdomain.com and ns2.yourdomain.com

Mail Server Management

Now that installation is complete, you can now login to the mail server control panel at: https://IP-Address/admin

This page includes a variety of checks that ensure your mail server is configured properly. It also contains instructions on accessing webmail and configuring a mail client like Outlook.

Conclusion

You have now setup your own mail server. It really was pretty easy, wasn’t it? Need help? Contact our support team for assistance.

Rate This Article

(34 out of 66 people found this article helpful)

Leave A Comment?

You must be logged in to post a comment.