When setting up your cPanel & WHM installation, a few items, such as your server's firewall, require configuration. Specific ports need setup for the cPanel & WHM software to function accordingly.
You want to make sure that you select only ports required by the cPanel & WHM software and that the server is configured to add back the firewall rules when the server is rebooted. This way, you can minimize unforeseen events.
Before setting up, we recommend making sure that you have the best practices in place. You want to make sure that you have access to your server at all times, ideally from the system console or other out-of-band access.
To be able to begin setting up, you have a few options available to choose from, depending on your Operating System. Here are the steps to open the ports:
For CentOS 7, CloudLinux 7, and RHEL 7 firewall management. Firewalld packages should be installed by default. In case it's not available, you can install by running the following:
yum install firewalld -y
With cPanel, we have an available script that will apply all the required cPanel firewall rules. On an important note, our configuration script will remove all existing rules from the iptables rules. Make sure that you have made a copy of those before running our script; you can create a backup with a command like this one:
iptables-save > /root/iptables.save
To configure the cPanel firewall rules:
Our documentation is available here to help you to configure your firewall: