Firewall Configuration for cPanel & WHM Services

This guide provides a complete reference for configuring firewall rules for cPanel & WHM servers. It includes all required ports, inbound/outbound rules, security recommendations, license callback behavior, WebPros service IPs, and practical examples for CSF, iptables, and nftables.

cPanel Firewall PortsWHM Firewall ConfigurationCSF iptables nftables

~2 min read • Updated Feb 18, 2026

1. Introduction


cPanel & WHM relies on many services that require external connectivity, including WHM, cPanel, Webmail, FTP, SMTP, IMAP, DNS, and licensing. If your firewall (CSF, firewalld, iptables, or your hosting provider’s firewall) blocks these ports, access to the panel, email, websites, and even the cPanel license system will fail.


Golden Rules:

  • Only open the ports you actually use.
  • Always keep emergency access (KVM/Console) available.
  • If you install a third‑party firewall (CSF/APF), WHM’s Host Access Control rules are ignored.

2. Required Ports for cPanel & WHM


The table below lists the essential ports, protocols, direction, and important notes.


PortServiceTCPUDPDirectionLocal Only?Description
1CPANOutboundNoUsed for Perl module updates
7RazorOutboundNoSpamAssassin spam checks
20FTP DataInboundNoUse SFTP instead; FTP is insecure
21FTP ControlInboundNoSFTP recommended
22SSHInboundNoRequired for secure server access
25SMTPIn/OutNoEmail sending/receiving
53DNSIn/OutNoRequired for DNS, AutoSSL
80HTTPInboundNoRedirect users to HTTPS
443HTTPSInboundNoMain SSL port
465SMTP SSLInboundNoSecure email sending
587SubmissionInboundNoClient email submission
993IMAP SSLInboundNoSecure email retrieval
995POP3 SSLInboundNoSecure POP3
2083cPanel SSLInboundNoMain cPanel port
2087WHM SSLInboundNoMain WHM port
2096Webmail SSLInboundNoMain Webmail port
2089License CheckOutboundNoRequired for cPanel license validation

3. License Callback Mechanism


To update license status instantly, cPanel attempts outbound connections on these ports (in order):


  • 2082 – cPanel
  • 2083 – cPanel SSL
  • 2086 – WHM
  • 2087 – WHM SSL
  • 2096 – Webmail SSL

At least one of these must be open outbound.


4. Required IPs for WebPros Features


4.1 SEO Scanner IPs



78.138.117.141
78.138.117.142
78.138.117.168
78.138.117.169
78.138.117.179
78.138.117.180
78.138.117.214
78.138.117.215

4.2 Site Quality Monitoring


Uses AWS IP ranges. Retrieve the full list:


curl https://ip-ranges.amazonaws.com/ip-ranges.json

5. Firewall Configuration Examples


5.1 CSF (Recommended for cPanel)



tcp|in|d=2087|s=0.0.0.0/0
tcp|in|d=2083|s=0.0.0.0/0
tcp|in|d=2096|s=0.0.0.0/0
tcp|in|d=993|s=0.0.0.0/0
tcp|in|d=465|s=0.0.0.0/0
tcp|in|d=22|s=0.0.0.0/0

5.2 nftables (AlmaLinux / Rocky / CloudLinux)



nft add rule inet filter input tcp dport 2087 accept
nft add rule inet filter input tcp dport 2083 accept
nft add rule inet filter input tcp dport 2096 accept

5.3 iptables (Ubuntu or older systems)



iptables -A INPUT -p tcp --dport 2087 -j ACCEPT
iptables -A INPUT -p tcp --dport 2083 -j ACCEPT

6. Conclusion


Proper firewall configuration ensures stable operation of cPanel & WHM services, prevents unexpected outages, and maintains secure access. This guide provides all essential ports, required IPs, and practical examples for the most common firewall systems.


Written & researched by Dr. Shahin Siami