To install WHM (Web Host Manager), you need to install cPanel/WHM on a Linux-based server. WHM is bundled with cPanel and is used for managing multiple cPanel accounts on a server. Here’s a step-by-step guide on how to install WHM on your VPS or dedicated server:
Requirements for Installing WHM/cPanel
- Operating System:
- CentOS 7/8, CloudLinux, AlmaLinux, or Rocky Linux (cPanel supports only Linux-based operating systems).
- Server Specifications:
- At least 2 GB of RAM (4 GB recommended).
- 20 GB of disk space minimum.
- Fresh server installation (without any pre-installed services like Apache, MySQL, PHP).
- cPanel License:
- You need a cPanel/WHM license. You can either purchase one from the cPanel website or use a free trial (usually 15 days).
- Root Access:
- You’ll need root access to your server, meaning you should be able to use SSH to log in as the root user.
Step-by-Step Installation Process for WHM/cPanel
1. Log in to Your Server via SSH
First, use an SSH client (like PuTTY or your terminal on Linux/macOS) to connect to your server.
- On Windows:
- Use PuTTY.
- Enter your server IP address and login with the root username and password.
- On Linux/macOS:
Open your terminal and run:
bash
Copy code
ssh root@your_server_ip
2. Set the Hostname
Before installing cPanel/WHM, set your server’s hostname. This is the name your server will use when identifying itself. It must be a fully qualified domain name (FQDN), like server.yourdomain.com.
To set the hostname, run:
bash
Copy code
hostnamectl set-hostname server.yourdomain.com
3. Update Your Server
Ensure your server is up-to-date by running:
bash
Copy code
yum update -y
4. Disable Network Manager
cPanel requires that Network Manager be disabled. Run the following commands to disable and stop it:
bash
Copy code
systemctl stop NetworkManager
systemctl disable NetworkManager
5. Install Perl
cPanel requires Perl to run. Install it using:
bash
Copy code
yum install perl -y
6. Install WHM/cPanel
To install cPanel/WHM, you need to download the installation script. Use the following commands:
Change to the /home directory:
bash
Copy code
cd /home
Download the cPanel installation script:
bash
Copy code
curl -o latest -L https://securedownloads.cpanel.net/latest
Run the installation script:
bash
Copy code
sh latest
This process will take some time depending on your server’s speed (usually between 30 minutes to an hour). The installer will automatically set up the WHM/cPanel software and configure necessary services like Apache, MySQL, and PHP.
7. Log into WHM for the First Time
Once the installation is complete, you can log into WHM to configure your server and cPanel accounts.
Open a browser and go to the following URL (replace your_server_ip with your server's IP address):
arduino
Copy code
https://your_server_ip:2087
- You will see a security warning. Accept the security certificate to proceed to the login page.
- Use the root username and password to log in.
8. Configure Initial Setup in WHM
Once logged into WHM, you’ll need to complete the initial configuration, which includes:
- License Activation:
- You will be prompted to enter your cPanel license. If you don’t have one, you can request a free trial from cPanel.
- Setup Networking:
- Enter your nameservers or use your hosting provider’s default nameservers.
- Create Hosting Packages:
- You can create predefined hosting packages (with specific resource allocations) for the cPanel accounts you manage.
9. Install Additional Configurations
Once the installation is complete and WHM is running, you can configure additional settings like:
- Security: Set up a firewall (e.g., CSF), brute force detection (cPHulk), and automatic backups.
- PHP and MySQL: Configure server settings like PHP versions and MySQL databases.
Conclusion
By following these steps, you can successfully install WHM/cPanel on your VPS or dedicated server. Once installed, you can log into WHM, configure server settings, and start creating cPanel accounts to manage your websites.
