You can install cPanel in CentOS 7 using the below steps:
Step 1: Ensure that your server has a standard hostname (Fully Qualified Domain Name), otherwise set it as follows:
# hostnamectl set-hostname cpanel.yourdomain.com
Step 2: cPanel is written in Perl, ensure that you have Perl installed on your server, otherwise run the command below to install it on your system.
# yum install perl
Step 3: You do not have to run any commands to install it, there is an auto installer script built for you. All you must do is download the cPanel installer script with the cURL command, if you don’t have the cURL command installed, first install it like so.
# yum install curl
Step 4: Then download the latest installer script to home directory.
# curl -o latest -L https://securedownloads.cpanel.net/latest
Step 5: Now, run the auto installer script. Note that if you have logged in the server using SSH, we strongly recommend running cPanel auto installer script in screen mode, because it takes 40-60 mins to complete the installation depending on your server resources and Internet connection speeds.
# sh latest
It will take some time to complete the installation process.