πŸ› οΈ Server Configuration Guide: Set Hostname & Initial Setup for cPanel

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
Scroll to Top