Setup web and mail server on 2 different droplets

April 18, 2014 2.1k views
I have already setup nginx web server on a droplet and it's running fine. I have also setup mydomain.com to point to the droplet (Droplet A). Now I would like to run a mail server on a separate droplet (Droplet B). How to configure the DNS / MX records so that Droplet B receive mail for mydomain.com while droplet A serves the web?
1 Answer
Just setup postfix (and dovecot if you wish to connect with a mail client) on a new droplet, make sure its pointing to something like mail.example.com. Create an A record and call it mail.example.com and have the IP of your mail server be located there. Then create a MX record and have it be mail.example.com.

If you want it to be simple, you could try iRedMail, but I would suggest learning how to set everything up by hand so you could get a good understanding how the software works. It is not hard at all :)
Have another answer? Share your knowledge.