Set Up WHM on a Fresh AlmaLinux 10 Server

CMS

By Jennifer Webb

Updated on Aug 05, 2026

Set Up WHM on a Fresh AlmaLinux 10 Server

What this setup guide covers

This guide walks you through a fresh WHM setup on AlmaLinux 10, starting with the first SSH login and ending with a working WHM login. It is meant for dedicated servers, where WHM/cPanel belongs on a clean system with full root access, stable networking, and no competing control panel already installed. If you do not have a server yet, start with a dedicated server from HostNExtra dedicated infrastructure.

You will create a safer admin account, update the system, verify the hostname, open the required firewall services, confirm licensing, and make sure WHM is only reachable after the base system is ready. Commands are split for AlmaLinux/Rocky Linux and Ubuntu/Debian only where the steps differ. For this guide, use a fresh AlmaLinux 10 server.

Related reading: Secure SSH on AlmaLinux 10 with Key Authentication and Fail2ban, How to Install Fail2Ban on Ubuntu 26.04, and SPF, DKIM, and DMARC Setup for Reliable Email Delivery.

Prerequisites and first SSH connection

Before you start, make sure you have:

  • A fresh dedicated server running AlmaLinux 10 or Rocky Linux 10.
  • Root SSH access on the server.
  • A domain name or subdomain ready for WHM, such as server.example.com.
  • DNS control for that hostname.
  • At least 2 CPU cores, 4 GB RAM, and enough disk for the operating system, cPanel packages, and future websites. More is better for production use.

Use these placeholders in the commands below:

  • SERVER_IP=203.0.113.10
  • ADMIN_USER=deploy
  • DOMAIN_NAME=server.example.com
  • SSH_PORT=22

From your local computer, connect by SSH as root first:

ssh [email protected]

If your provider uses a custom SSH port, use it in the first connection:

ssh -p 2222 [email protected]

Keep this original root session open until the sudo user is tested and working.

Check the operating system and prepare the server

VPS or dedicated server as root: confirm the installed distribution before making changes.

cat /etc/os-release

Look for AlmaLinux or Rocky Linux and confirm you are on a supported release. If you are on Ubuntu or Debian, stop here and follow a control-panel installation path built for that family; do not mix package manager commands.

Next, set the hostname to a real fully qualified domain name. Replace server.example.com with your chosen hostname:

hostnamectl set-hostname server.example.com

Confirm the change:

hostnamectl status

You should see the new static hostname in the output. WHM expects a proper hostname, and changing it later is possible but unnecessary work.

Update the base system now, before installing panel software:

dnf update -y

This refreshes system packages and cuts down on version drift. Reboot if the kernel or core services were updated:

reboot

Reconnect with SSH after the reboot and continue only when the server comes back cleanly.

Create a non-root admin user and test sudo

Even though WHM installation starts from root, you should still prepare a sudo-capable admin account for routine access. Leave the root session open until the test succeeds.

VPS or dedicated server as root: create the account.

useradd -m -s /bin/bash deploy

Set a temporary password if you need password-based recovery access during setup:

passwd deploy

Add the user to the wheel group on AlmaLinux/Rocky Linux:

usermod -aG wheel deploy

Prepare SSH key access for the new user. On your local computer, copy your public key to the server. If you do not already have a key, create one locally first:

ssh-keygen -t ed25519 -C "[email protected]"

Press Enter to accept the default file location, then add the public key to the server:

ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]

If you use a custom SSH port:

ssh-copy-id -p 2222 -i ~/.ssh/id_ed25519.pub [email protected]

Now fix permissions on the server side. Run these commands as root:

mkdir -p /home/deploy/.ssh
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys

If the authorized_keys file does not yet exist because you used ssh-copy-id, create it by logging in once, or append the key manually. Ownership and permissions matter; SSH will ignore a key file with unsafe permissions.

Open a second local terminal and test the new login:

ssh [email protected]

Then confirm sudo works:

sudo -l

You should see wheel-based sudo privileges. Do not disable root login or password authentication yet. Finish the panel install and testing first.

Set the firewall before opening WHM

WHM and cPanel need specific ports. Do not expose the panel until the server firewall allows the right services and blocks everything else by default.

On AlmaLinux/Rocky Linux, as root, enable firewalld if it is not already running:

systemctl enable --now firewalld
systemctl status firewalld --no-pager

Open SSH and the cPanel/WHM service ports. The minimum ports commonly needed for initial access are 22, 80, 443, 2082, 2083, 2086, and 2087. Check your licensing and service requirements before opening more.

firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-port=2082/tcp
firewall-cmd --permanent --add-port=2083/tcp
firewall-cmd --permanent --add-port=2086/tcp
firewall-cmd --permanent --add-port=2087/tcp
firewall-cmd --reload
firewall-cmd --list-all

Expected result: the services and ports appear in the active zone. If you later add mail or DNS hosting on the same server, you will need additional ports, but do not open them until you actually use those services.

Install WHM/cPanel on a fresh AlmaLinux 10 server

cPanel installation starts from root and should be done only on a clean, supported system. Do not install it on a server that already runs a web stack you want to keep.

VPS or dedicated server as root: download and launch the installer.

cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest

The installer runs for a while and downloads the required packages. Watch for failures related to DNS, disk space, or unsupported packages. If the install stops, read the log before retrying:

tail -n 50 /var/log/cpanel-install.log

After installation, confirm that cPanel services are present:

systemctl status cpanel --no-pager
ss -tulpn | grep 2087

Port 2087 should be listening for WHM over HTTPS. If it is not, review the installer output and service logs before continuing.

Log in to WHM and complete the first-run checks

From your local computer, open WHM in a browser:

https://203.0.113.10:2087

Or use your hostname if DNS is already pointed correctly:

https://server.example.com:2087

Because the server is fresh, the browser may warn about the default certificate. That is normal until you assign a trusted certificate. Sign in as root with your SSH password or root auth method.

In WHM, complete the initial wizard steps, then check:

  • The server hostname matches the FQDN you set.
  • The primary nameserver entries are correct if you will host DNS.
  • The contact email is valid.
  • The default resolver settings make sense for your network.

If you plan to host websites, point your domain's A record to the server IP and create accounts only after the hostname and nameserver settings are correct.

Secure access after testing

Once the new sudo user works and WHM is reachable, you can harden access carefully. If you want to reduce SSH risk, do it in this order: keep the root session open, confirm key login for deploy, edit SSH settings, validate syntax, reload SSH, and test a second session before closing root.

On AlmaLinux/Rocky Linux, check the SSH config syntax before reload:

sshd -t

If the command returns no output, the syntax is valid. Only then reload SSH:

systemctl reload sshd

Open a new terminal and confirm both key-based login and sudo still work:

ssh [email protected]
sudo whoami

You should see root from sudo. If login fails, use the original root session to undo the last SSH change immediately.

Verify the panel, services, and reboot persistence

Run these checks from the server as root or from the sudo user with sudo access:

systemctl is-enabled cpanel
systemctl status cpanel --no-pager
ss -tulpn | grep -E '(:2086|:2087|:80|:443)'
reboot

After reboot, reconnect with SSH and check again:

systemctl status cpanel --no-pager
firewall-cmd --list-all

Then load WHM again in a browser and confirm the login page appears. That confirms service startup, firewall persistence, and panel reachability after reboot.

Troubleshooting common setup problems

WHM will not open on port 2087
Check whether the service is listening:

ss -tulpn | grep 2087

If nothing appears, inspect the service and installer logs:

systemctl status cpanel --no-pager
tail -n 100 /var/log/cpanel-install.log

Start with the log message that explains the failure, then correct DNS, disk, or package issues before retrying.

SSH key login fails for the deploy user
Check file ownership and permissions:

ls -ld /home/deploy /home/deploy/.ssh
ls -l /home/deploy/.ssh/authorized_keys

If permissions are too open, fix them:

chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys

Firewall changes do not persist
Check whether firewalld is active:

systemctl status firewalld --no-pager

If it is inactive, enable it and reapply the rules:

systemctl enable --now firewalld
firewall-cmd --reload

Rollback procedure

If the installation fails or you decide to start over on this fresh server, roll back in a controlled way. First stop using the panel, then remove it only if you are sure you do not need the data on the machine.

As root, back up any important files you want to keep, then stop the panel:

systemctl stop cpanel

Check the service state:

systemctl status cpanel --no-pager

If you are abandoning the install, contact your provider or cPanel support flow for the removal path on your environment. For a clean rebuild, it is usually safer to reinstall the operating system on a dedicated server than to partially unwind a failed panel deployment.

FAQs

Should I install WHM on a VPS?
For production hosting, use a dedicated server. WHM and cPanel are better suited to a clean, isolated machine with predictable resources and full administrative control.

Can I add websites after the setup?
Yes. After the panel is reachable and the hostname is correct, you can create accounts, set DNS, issue SSL certificates, and migrate sites into the new environment.

What should I read next?
If this setup is part of a broader hosting plan, the most useful follow-ups are email authentication, monitoring, and backup planning. See the email authentication guide and the monitoring tutorial for the next operational steps.

If you are building a new client hosting environment, start with a dedicated server from HostNExtra and complete the WHM setup on a fresh AlmaLinux 10 install.