After a fresh installation on a CentOS server and following all the standard steps, it is not connecting to WHM on port 2087.
CentOS has default iptables (firewall) rules that block access to cPanel ports when out of the box.
You can flush them using the following command :
Also, remove them from /etc/sysconfig/iptables to prevent them from re-appearing on a system reboot or service restart.
This should fix the issue!
Source : cPanel Forum
Also read these posts:-