How to Configure Your Firewall for cPanel Services in WHM

How to Configure Your Firewall for cPanel Services in WHM


cPanel & WHM installs and manages many different services on your system. Most of these services require an external connection in order to function properly. Because of this, your firewall must allow cPanel & WHM to open the ports on which these services run. This document lists the ports that cPanel & WHM uses, and which services use each of these ports, to allow you to better configure your firewall.


  • We strongly recommend that you only open ports for services that you use.
  • So that you do not lock yourself out of your server, make certain to include a way to log back in to your server when you work with firewall rules. Always maintain console access to your server.



We strongly recommend that you use the SSL version of each service whenever possible.

  • The use of non-SSL services could allow attackers to intercept sensitive information (for example, login credentials).
  • Ensure that valid SSL certificates exist for your services in WHM’s Manage Service SSL Certificates interface (Home >> Service Configuration >> Manage Service SSL Certificates).
Port Service TCP UDP Inbound Outbound Notes
20 FTP We recommend that you use SFTP via SSH, because it is more secure than FTP.
21 FTP
22 SSH
26 SMTP cPanel & WHM only uses this port if you specify it in WHM’s Service Manager interface (Home >> Service Configuration >> Service Manager).
37 rdate
43 whois