Configuring a cloud-based secure multi-domain web and e-mail server



As I’ve mentioned previously, I own an HP MediaSmart server. Up until recently I’ve used it to host both my domain as well as my wife’s domain. If you’ve seen, you’ll see that we’re currently in the process of downsizing, reducing our possessions and living a simpler, more harmonious lifestyle. That being said, I knew I was likely taking my server off-line (it’s a HUGE power hog) and needed a replacement solution.

We’ve used cloud servers at my current employer for several years, hosting several sites with e-mail and web services without issue. I just didn’t want to pay the high prices (upwards of $100/mo minimum) to replace something I *could* do for the cost of electricity, so I set out to find an affordable alternative – and I did.


In this article I will explain how to provision, configure and secure a linux cloud-based server to host multiple domains, providing both web and e-mail services. I use Linode for my hosting provider, as they seemed to be the least expensive provider I could find. I’ve also used RackSpace, and can recommend their service, although the price point is a little high.

I’ll give a brief overview of the entire process, then explain each step in detail.

  1. Provision cloud server (creates a linux host with a fixed IP and SSH access)
  2. Set system hostname, network configuration
  3. Install system updates
  4. Add system user, grant sudo access
  5. Secure SSH service (hacking attempts against your server are already happening)
  6. Implement and configure the firewall
  7. Install Virtualmin (provides easy configuration of multi-domain host)
  8. Add first domain to host
  9. Add first e-mail user to host
  10. Secure mail service
  11. Install and configure WordPress
  12. Install and configure Roundcube web-mail
  13. Create SPF Record
  14. Install and configure Fail2Ban (bans IP addresses from server access based on failed attempts)

This article is based upon the documentation and guides available at and other sites. I’ll provide links to the guides I used when appropriate, but I’m covering every step here as the guides may not align exactly with CentOS 7.

Let’s get started by provisioning our cloud server.

2 thoughts on “Configuring a cloud-based secure multi-domain web and e-mail server

    • Awesome! To be perfectly honest, i went with postfix because it’s been the default I’ve seen installed with Virtualmin. Why did you choose to go with exim?

Leave a Reply

Your email address will not be published. Required fields are marked *