Learn how to install CentOS Web Panel (CWP) and apply essential security configurations for a secure and efficient server environment.
π οΈ 2. Installing CentOS Web Panel (CWP)
βοΈ Step 1: Access Your Server via SSH
ssh root@your_server_ip
βοΈ Step 2: Set Hostname
# Set a hostname
hostnamectl set-hostname server.example.com
# Verify the hostname
hostname -f
βοΈ Step 3: Install Required Packages
# Install wget and curl
yum install wget curl -y
βοΈ Step 4: Download and Run the CWP Installer
For CentOS 7:
cd /usr/local/src
wget http://centos-webpanel.com/cwp-el7-latest
sh cwp-el7-latest
For CentOS 8 / Rocky Linux / AlmaLinux:
cd /usr/local/src
wget http://centos-webpanel.com/cwp-el8-latest
sh cwp-el8-latest
βοΈ Step 5: Reboot the Server
reboot
βοΈ Step 6: Access the CWP Admin Panel
Open your browser and navigate to:
https://your_server_ip:2031
Default Login:
- Username: root
- Password: Your serverβs root password
π 3. Essential Post-Installation Security Tips
π οΈ 1. Change Default Root Password
passwd
π οΈ 2. Enable Firewall Protection (CSF/LFD)
# Install CSF if not installed
yum install csf -y
# Enable CSF and LFD
csf -e
systemctl enable lfd
Allow Essential Ports:
- HTTP/HTTPS: 80, 443
- SSH: 22 (or a custom port)
- CWP Panel: 2030 (HTTP), 2031 (HTTPS)
π οΈ 3. Change the Default SSH Port
# Open SSH config file
nano /etc/ssh/sshd_config
# Modify the default port (e.g., from 22 to 2222)
Port 2222
# Restart SSH service
systemctl restart sshd
π οΈ 4. Enable Two-Factor Authentication (2FA)
Go to CWP Admin Panel β Security Center β 2FA Authentication.
π οΈ 5. Configure Regular Backups
tar -czvf /backup/cwp_backup_$(date +%F).tar.gz /home /var/lib/mysql /etc