Security

Which firewall ports a cPanel/WHM hosting server needs

A complete list of the ports cPanel, WHM, webmail, email, FTP, SSH and DNS use, which ones to open in your firewall, and which you can safely close.

IntermediatecPanel/WHM servers2 min read

A cPanel server runs many services, each on its own port. Your firewall must allow the ones you use and should block the rest. This reference lists the standard ports, what they do and whether you can close them.

Before you start

  • This list is for server owners configuring CSF, firewalld or a provider firewall. Hosting customers can use it to check that their own network does not block these ports.
  • For a general list beyond cPanel, see common server ports.

cPanel, WHM and webmail

PortServiceKeep open?
2083cPanel (SSL)Yes
2082cPanel (non-SSL)Close if you force SSL
2087WHM (SSL)Yes, ideally limited to admin IPs
2086WHM (non-SSL)Close if you force SSL
2096Webmail (SSL)Yes
2095Webmail (non-SSL)Close if you force SSL
2077 / 2078Web Disk (WebDAV)Only if used
2079 / 2080CalDAV / CardDAVOnly if used

Websites

PortService
80HTTP (needed for redirects and AutoSSL validation)
443HTTPS

Email

PortServiceNotes
25SMTP server-to-serverRequired to receive mail
465SMTP over SSLRecommended for mail apps
587SMTP submission (STARTTLS)Alternative for mail apps
993 / 143IMAP SSL / plainPrefer 993
995 / 110POP3 SSL / plainPrefer 995

App settings are explained in cPanel email ports.

FTP, SSH and DNS

PortServiceNotes
21FTP / FTPS controlClose if everyone uses SFTP
30000–35000Passive FTP dataMust match the Pure-FTPd passive range
22SSH and SFTPLimit to trusted IPs or change it
53 TCP/UDPDNSOnly if the server is a nameserver
3306MySQLClose unless remote MySQL is needed

Apply the list to your firewall

  • CSF: edit TCP_IN and TCP_OUT; see open and close ports in CSF.
  • firewalld: add ports to the public zone; see firewalld zones.
  • Outgoing, keep 25, 53, 80, 443, 465, 587 and 113 open so the server can send mail, resolve DNS and download updates and licences.

Tip: If cPanel works on 2083 at home but not at work, the office network blocks the port. Use https://yourdomain.com/cpanel through a proxy subdomain, or open cPanel in one click from the MdmHost dashboard.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.