how can i change port of WHM from 2086 to another port


cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider

how can i change port of WHM from 2086 to another port

thanks for helping

best regardis

i need that information
Is there a specific reason you are needing to change only the non-SSL port for WHM? Are you needing to change any other ports used by cPanel and WHM, including those for access to Webmail or cPanel Web Disk (WebDAV)?

Out of curiosity, are you only needing to prevent or block access to WHM via its non-SSL port, perhaps to require use of SSL ports?

It is not currently possible to modify the port numbers used to access WHM; however, if you would like an enhancement making that possible I would consider posting a detailed and constructive feature request in the following forums area where the idea can gain more attention: Feature Requests for cPanel and WHM - cPanel Forums


Active Member
May 25, 2007
if you just want the port closed and you do not want attacked then you can do this...

You have to loop it back for cpanel first before closing it to the world or you will have errors and you will get emails about it

iptables -A INPUT -s -p tcp -m tcp --dport 2087 -j ACCEPT
iptables -A INPUT -s -p udp -m udp --dport 2087 -j ACCEPT
iptables -A INPUT -s -p tcp -m tcp --dport 2086 -j ACCEPT
iptables -A INPUT -s -p udp -m udp --dport 2086 -j ACCEPT

Place your ip in between this rule so you can get in
iptables -A INPUT -s -j ACCEPT <-- replace with your ip our you will not be able to use the service
iptables -A INPUT -s -j ACCEPT <-- Cpanel Corp
iptables -A INPUT -s -j ACCEPT <-- Your Data Center Tech Support

iptables -A INPUT -p tcp --dport 2086:2087 -j DROP
iptables -A INPUT -p udp --dport 2086:2087 -j DROP

This will block the service to the outside and drop all incoming connections except to cpanel = localhost

so this has to be set to the local host ip what ever your using in your box.

hey dont forget to save

/etc/init.d/iptables save

This would only let you use the service, you might want to put cpanels ips in there as well and your data centers ips too.
Last edited: