This guide walks you through setting a hostname, securing SSH, disabling unnecessary services, installing cPanel, and performing basic server tuning and testing.
1. π§Ύ Set the Hostname
hostnamectl set-hostname hostname.domain.com
hostnamectl
reboot
2. π§ OS Info (Optional Check)
cat /etc/*release
3. π Secure SSH & Create SSH Key
Edit the SSH config:
nano /etc/ssh/sshd_config
Update or add:
PermitRootLogin no
PasswordAuthentication no
Restart SSH:
systemctl restart sshd
Generate SSH key:
ssh-keygen
4. π Set Up Initial Server Profile
mkdir /root/cpanel_profile/
touch /root/cpanel_profile/cpanel.config
nano /root/cpanel_profile/cpanel.config
Example config:
mysql-version=11.4
5. βοΈ Disable SELinux (Optional)
vi /etc/selinux/config
Change:
SELINUX=enforcing β SELINUX=disabled
Then:
reboot
6. π Remove Unwanted Services for cPanel
yum -y remove NetworkManager cloud-init
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl enable network.service
systemctl start network.service
7. π§° Install Utilities
yum -y install wget nano iperf3
iperf3 -c iperf.as42831.net -p 5300-5400
8. π Install cPanel
Standard:
cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest --skip-cloudlinux
DNS-only:
curl -o latest-dnsonly -L https://securedownloads.cpanel.net/latest-dnsonly
sh latest-dnsonly
9. π Install KernelCare (Optional)
curl -s https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
/usr/bin/kcarectl --register replacekey
10. π Install CSF & ConfigServer Tools
cd ~
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz && cd csf && sh install.sh
cd ~
wget https://download.configserver.com/cmm.tgz
tar -xzf cmm.tgz && cd cmm && sh install.sh
cd ~
wget https://download.configserver.com/cmq.tgz
tar -xzf cmq.tgz && cd cmq && sh install.sh
cd ~
wget https://download.configserver.com/cse.tgz
tar -xzf cse.tgz && cd cse && sh install.sh
11. β±οΈ Performance Testing
π Disk I/O Test
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
dd if=test of=/dev/null bs=1M count=1024
dd if=/dev/zero of=/home/test bs=64k count=16k conv=fdatasync
dd if=/home/test of=/dev/null bs=1M count=1024
π Network Speed Test (Generic)
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
python3 speedtest-cli
python3 speedtest-cli --secure
π Speed Tests by Provider
π₯ HETZNER:
wget -O /dev/null https://fsn1-speed.hetzner.com/10GB.bin
wget -O /dev/null https://nbg1-speed.hetzner.com/10GB.bin
wget -O /dev/null https://ash-speed.hetzner.com/10GB.bin
π© TURNKEYINTERNET:
wget -O /dev/null https://speedtest-ny.turnkeyinternet.net/10000mb.bin
π¦ TELE2:
wget -O /dev/null http://speedtest.tele2.net/10GB.zip
π¨ UKSERVERS:
wget -O /dev/null https://speed-test.ukservers.com/10GB.test
π§ OVH:
wget -O /dev/null https://proof.ovh.net/files/10Gb.dat
wget -O /dev/null https://eri.proof.ovh.net/files/10Gb.dat
wget -O /dev/null https://bhs.proof.ovh.ca/files/10Gb.dat
12. π§ WHM Tweak Settings
whmapi1 set_tweaksetting key=rpmup_allow_kernel value=1
whmapi1 set_tweaksetting key=show_reboot_banner value=1
whmapi1 set_tweaksetting key=requiressl value=0
whmapi1 set_tweaksetting key=alwaysredirecttossl value=0
13. π Set Timezone to London
timedatectl set-timezone Europe/London
reboot
β Youβre All Set!
Your server is now:
- Properly named
- Secure via SSH
- Optimized for cPanel
- Ready with essential tools
- Configured for performance testing