How to Set Up a Mail Server on a cPanel VPS?

Younger generations may consider it cumbersome and old-fashioned, but email continues to be one of the main forms of official communication. Big and small businesses use it to keep in touch with partners and clients, carrying out some pretty important negotiations through this medium.

Enterprises need a reliable service powering their email inboxes, and for many, the best solution is a mail server running on a cPanel VPS.

Today, we’ll see how webmasters can configure one…

What is a Mail Server?

There are several components in the mechanism responsible for delivering emails.

First, you read and compose your emails on an email client – a mobile, desktop, or web-based application responsible for displaying your inbox contents and relaying your messages down the communication chain.

The email client contacts the mail server – a physical or virtual machine that runs a suite of software applications and uses a selection of protocols and authentication methods to send and receive emails.

The mail server you use may be managed by a third party. For example, it is entirely possible to host your custom domain’s emails on Google’s infrastructure and manage them through the Gmail interface.

Alternatively, you can set up the mail server yourself or have it configured by your hosting provider. But which is the best option?

The Benefits of Having Your Own Mail Server

A couple of changes to your domain DNS records are enough to let you set up your emails through Gmail. Users are familiar with the interface, and quite often, they are already aware of what they need to do to configure it for desktop and mobile users. As a result, many site administrators prefer to use Google’s service.

However, you need to consider that Gmail operates under a Software-as-a-Service (SaaS) model, meaning you pay a monthly fee for every single user you add.

You’re not in complete control over your inboxes, either. For example, if you want to take your existing email accounts and move them to a different provider, you can’t just transfer them over to a new server. You have to recreate the inboxes from scratch.

By contrast, a cPanel VPS gives you full control over the entire service. You have the server to yourself, and you can create and manage as many email inboxes as you want without paying an extra penny over the cPanel VPS cost. You can run your website and your emails on the same server, and if you decide to switch hosts – doing it is as easy as backing up the account and restoring it at the new location.

Controlling an entire server probably sounds like a challenge to the more inexperienced users. The truth is, thanks to cPanel, the task isn’t that difficult. That said, being familiar with some of the basic principles of email communication can certainly help you ensure your messages will be delivered without any hiccups.

Understanding Email Basics

We’ve already established what email clients and mail servers do. However, there’s a lot more going on, and the relentless fight against spammers and abusers has made the mechanism a lot more complicated than it used to be. Here are some of the components involved in the seemingly simple process of sending an email.

DNS

DNS stands for Domain Name System and is one of the founding stones of the internet as we know it today. When you type the URL you want to visit – your browser employs the DNS to learn which server it needs to get in touch with to display the right content. 

It also helps mail servers figure out the correct destination of the email they’re trying to send.

Something called reverse DNS (or rDNS) is just as essential when it comes to email deliverability.

DNS ties a domain to an IP, and a reverse DNS ties an IP to a domain. Theoretically, you can hack into a server with no domains and no rDNS records and use it in a spam campaign. To prevent this, most providers reject emails coming from IPs missing rDNS.

SPF

SPF or Sender Policy Framework is a DNS record that determines which IP your emails should be coming from. The recipient server can check the sending IP of the incoming email and block the message if it doesn’t match.

DKIM

DomainKeys Identified Mail (DKIM) is an email authentication method designed to minimize email spoofing. If enabled, DKIM allows the sender to affix a signature (invisible to the user), which guarantees the message has not been modified and is coming from the right place.

DMARC

Domain-based Message Authentication, Reporting, and Conformance (or DMARC) is the authentication protocol that makes the existence of SPF and DKIM possible.

By publishing a DMARC record in your domain’s DNS settings, you effectively tell the recipient that you use DKIM and SPF.

Utilizing DMARC, you can also be alerted of an uptick in DKIM and SPF fails, indicating a potential attack. That way, you will be able to easily take protective actions and minimize the damage to your domain’s reputation.

Sending IP

Hackers can spoof the sender’s email address, but they can’t spoof the sending server’s IP.

Thousands of messages with fake senders can pass through a single IP. To combat this, security companies create and maintain blacklists of IPs utilized by spammers. If you try to send an email from one of these IPs – it will likely end up in the recipient’s junk folder.

This could be a serious problem for shared hosting users because the server IP is used by all the accounts hosted on it. If it gets blacklisted – the email communication of hundreds of users will be disrupted.

This is precisely why a VPS is a much better solution, especially if a reliable email service is essential for your business. With a Virtual Private Server, you get a dedicated IP that you employ as the only owner.

SMTP/POP3/IMAP

POP3 (or Post Office Protocol version 3) and IMAP (Internet Message Access Protocol) are the two protocols that let email clients retrieve and display your inbox’s contents. Virtually all email clients support them, and the best thing is they can work over an encrypted connection.

IMAP is by far the preferred option in recent years. Utilizing it, your email account contents are synchronized across all your devices. By contrast, POP3 downloads your emails on your computer or phone and later deletes them from the server. All in all, POP3 can only be a suitable solution if you use a single device and need more storage space on the server.

SMTP (Simple Mail Transfer Protocol) is the communication protocol mail servers, and transfer agents use to send and receive messages. It has been in use for years now, and it’s at the heart of every email communication.

How to Set Up a Mail Server on Your cPanel VPS

The exact steps you need to take to set up your own mail server on a cPanel VPS depend on your hosting setup and specific project requirements. Nevertheless, the process can be summarized as three major tasks.

1. Make sure your domain and subdomains resolve properly

Using a subdomain (e.g., mail.domain.com) for the mail server is becoming the norm. To ensure this works correctly, you should first set an MX record for the main domain, which you then point to the subdomain.

That way, email clients and mail transfer agents will exchange messages with the right servers.

In case you need the emails to be hosted on a server different from your website – you’ll also have to set an A record for the subdomain, pointing it to the correct IP. Your domain registrar and the provider that hosts your DNS zone should be able to give you exact instructions on what you need to do.

After altering the domain DNS settings, you may want to allow a day or two for the changes to propagate around the world.

2. Create a cPanel account via WHM

Setting up a mail server on your VPS requires a new cPanel account. You can create it via WHM (or Web Host Manager), cPanel’s server administration platform. Still, bear in mind that cPanel’s new pricing model bases licensing fees on a per-account basis.

You may need to pay additional charges if the number of cPanel accounts included in your plan is insufficient for your project. That’s why you need to make sure you only create new cPanel’s when you need them.

Now that you have the control panel, you must ensure the Enable DKIM on this account and Enable SPF on this account checkboxes are selected. Otherwise, you won’t be able to create a functional mail server.

With the account created, you can now log into the newly created cPanel account, set up inboxes through the Email Accounts tool, and start sending messages right away.

To ensure a more reliable service, however, you have one more task ahead of you.

3. Configure the new mail server

In cPanel’s Email section, you can find a tool called Email Deliverability. It checks the domain DNS configuration and detects issues that may cause your email delivery to fail. More specifically, it looks at DKIM, SPF, rDNS, and the DNS records associated with them.

DKIM and SPF issues are fixed with the help of TXT records, while properly configuring rDNS relies on a PTR record. Luckily, cPanel gives you the exact values you need to enter for those records, and the domain registrar should be able to provide you with the steps you need to take to set them up.

ScalaHosting and VPS Solutions

Shared hosting continues to be popular, especially with owners of small websites and projects in the early stages of development. However, for a business that relies on emails for its communication, a shared solution simply isn’t sufficient.

Virtual Private Servers are infinitely more scalable, meaning your business can grow much more seamlessly. Thanks to the guaranteed resources and dedicated IP, you can enjoy a stable performance without fears of outside intervention.

At ScalaHosting, we believe virtual servers are at the heart of the industry’s future, which is why we’ve been focusing on service innovations. CPanel is the world’s most popular web hosting management platform, and you can use it with our VPS solutions.

However, recent changes to the platform’s pricing policy have bumped up licensing fees considerably, and quite a few website owners are now looking for alternatives.

We’re more than happy to provide one.

SPanel is ScalaHosting’s proprietary all-in-one management platform designed specifically for VPS solutions. It’s available with all our managed virtual servers, and you can use it to run as many projects as you want without paying any licensing fees.

SPanel is 100% compatible with cPanel, and migrating between the two platforms is completely painless. Ease-of-use has always been our priority, so navigating around SPanel’s interface shouldn’t be difficult even for complete beginners.

To simplify the process of creating a mail server, SPanel automatically configures SPF and DKIM for all new accounts. Additional configurations are possible through the DNS Editor, which gives you complete control over your domain DNS zone.

Conclusion

Efficient, reliable email deliverability is still hugely important for both businesses and individuals. You have several options to choose from, but if you want full control over your inboxes, setting up and running your own mail server has no alternative.

This may sound like a daunting and rather expensive undertaking, but the truth is, a well-configured VPS can give you excellent performance at a very reasonable price. Meanwhile, thanks to management platforms like cPanel and SPanel, setting up a mail server requires little more than a basic understanding of how emails work.

FAQ

Q: Which protocol does cPanel use to send and receive emails?

A: cPanel’s mail functionality exists thanks to Exim – a built-in mail transfer agent. Like all other popular mail transfer agents, it uses the Simple Mail Transfer Protocol (or SMTP) to deliver and receive emails.

Q: How do I check my inbox in Webmail?

A: Webmail is a cPanel service that allows you to access your email account through a web-based interface. The login URL is https://yourdomain.com/webmail/, and the credentials are the same as those you’ve set up when creating the email account.

Q: Is a cPanel email server reliable?

A: A simple cPanel account is all that you need to start sending emails. However, to ensure deliverability and improve your domain’s reputation, you have to make sure all DNS records concerning rDNS, SPF, and DKIM are in place.

A dedicated IP that is not on the spam blacklists also helps immensely.

ScalaHosting – How to Set Up a Mail Server on a cPanel VPS?

What is a VPS – Everything you need to know!

Was this article helpful?

What’s your goal today?

1. Find the right Email Hosting solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lightning-fast

We guarantee to make your website load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Make your website lighting fast—or your money back
Slow websites lose visitors and sales. See how you can surf tsunami sized traffic spikes—or any traffic—with ease with ScalaHosting. Fill out the form, and we’ll be in touch!
Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain