How to Install cPanel on a VPS Server

If you’re running a VPS on Ubuntu 24.04 and need a reliable way to manage websites, email, and server resources, cPanel & WHM is one of the most popular solutions. This guide walks you through a terminal-only cPanel installation — no graphical tools required. By the end, you’ll have a working Ubuntu VPS cPanel setup ready for production or staging environments.

How to Install cPanel on a VPS Server.

Prerequisites for Installing cPanel on Ubuntu 24.04

Before starting the installation, confirm that your VPS meets the official cPanel installation requirements. Running cPanel on a system with insufficient resources can lead to failed installs or poor performance.

Minimum VPS Specifications

  1. Operating System: Ubuntu 24.04 (clean installation recommended).
  2. Processor: 1.1 GHz (dual-core or higher preferred).
  3. Memory (RAM): 2 GB minimum, 4 GB or more recommended.
  4. Disk Space: at least 20 GB available, 40 GB+ for production servers.
  5. Network: stable internet connection with a static public IP address.

Additional Prerequisites

  1. Root Access: you’ll need full root privileges via SSH.
  2. Hostname: a valid Fully Qualified Domain Name (FQDN) is required.
  3. Clean Environment: avoid preinstalled web services (Apache, Nginx, MySQL) that may conflict with cPanel.

Meeting these Ubuntu VPS requirements ensures a smooth installation process and reduces troubleshooting later. With the right VPS cPanel prerequisites in place, you’ll be ready to proceed with the setup.

Installing cPanel on on Ubuntu VPS: Step-by-Step Guide

This guide walks you through the full process of setting up cPanel on Ubuntu using only terminal commands. From preparing your server to completing the WHM wizard, each step ensures your VPS is ready for reliable hosting in a production or staging environment.

Step 1: Update and Prepare the System

Before installing cPanel, you need to make sure your Ubuntu 24.04 VPS is up to date and free of conflicting software. Start with a full package refresh to pull in the latest security patches and bug fixes:

apt update && sudo apt upgrade -y

This command ensures your VPS is running the newest stable versions of core components. Next, remove any services that might conflict with cPanel, such as Apache or Nginx:

apt remove apache2 nginx -y

Taking the time to prepare your VPS for cPanel reduces the chance of dependency issues during installation. With a clean, patched system, you’ll have a secure and reliable foundation for the upcoming setup.

Step 2: Set the Correct Hostname and Network Configuration

cPanel requires your VPS to use a fully qualified domain name (FQDN) as its hostname. Without it, installation or licensing may fail. To configure the hostname on Ubuntu 24.04, run (replace the ‘yourdomain.com’):

sudo hostnamectl set-hostname server.yourdomain.com

Next, update /etc/hosts so the VPS’s static IP maps correctly to your chosen hostname:

sudo nano /etc/hosts

Add a line (replace the IP):

ip.address server.yourdomain.com server

Most VPS plans provide one. If your IP changes between reboots, set a static address in your provider panel; cPanel licensing requires a stable IP. This completes the Ubuntu network config for cPanel and ensures smooth licensing.

Step 3: Download and Run the cPanel Auto-Installer Script

With your Ubuntu VPS prepared, the next step is to use the official cPanel install script. This script handles most of the heavy lifting — checking dependencies, configuring services, and deploying both cPanel and WHM. Here’s how to run it safely:

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

Step 4: Complete Initial Setup via WHM (Post-Installation)

When the installer finishes, your server is ready to be managed through WHM (WebHost Manager). Open a browser and connect to:

http://your-server-ip:2087

Log in with your root username and password. The first time you access WHM, the initial setup wizard will launch. Follow the prompts step by step:

  1. Provide a contact email for important server alerts.
  2. Configure DNS resolvers and set default nameservers.
  3. (Optional) Create a reseller account if you plan to host multiple clients.
  4. Accept the license agreement and terms.
  5. Enable SSL to secure logins and traffic.
  6. Set time zone and locale to match your region.

Completing this WHM configuration ensures your server is fully integrated with cPanel. At this stage, you can start creating accounts, adding domains, and hosting sites.

Managing Your Server with cPanel & WHM

By installing cPanel on Ubuntu, you’ve laid the groundwork for efficient server administration. With WHM, it’s easy to create hosting accounts, configure DNS, allocate resources, and monitor performance — all from a user-friendly control panel VPS environment. The main advantage of this setup is balance: cPanel simplifies day-to-day management without taking away the flexibility of a self-managed server. Keep in mind, though, that regular updates, security patches, and backups are vital to protect your infrastructure. With this foundation in place, you can confidently manage your cPanel VPS and scale it to support multiple websites or clients. It’s a robust solution for developers and businesses alike.

DN

The author

Dmitriy Novitsky

Dmitriy Novitsky, Chief Technology Officer at VPS.one, is a seasoned expert in VPS hosting. With years of experience, he shares valuable insights and technical knowledge to help users optimize their hosting performance and stay ahead in the tech world.

How to Install Docker on Debian VPS.

How to Install Docker on Debian VPS

How to Install PHP on Ubuntu.

How to Install PHP on Ubuntu

How to Install Plesk on Ubuntu 24.04.

How to Install Plesk on Ubuntu 24.04