Migrating from cPanel Shared Hosting to a VPS: Complete Guide
Outgrowing shared hosting is a milestone for any website. When your traffic increases, your site needs more resources, or you need more control over your server environment, upgrading from cPanel shared hosting to a Virtual Private Server (VPS) is the natural next step. This guide walks through the entire process — from choosing a VPS to making the final DNS switch.
Signs You Have Outgrown Shared Hosting
- Your website loads slowly despite optimisation efforts
- You receive "resource limit reached" errors from your host
- You need PHP extensions or software that your shared host does not support
- Your site crashes during traffic spikes
- You need root access for custom server configuration
- You want to host multiple websites with more isolation
Step 1: Choose Your VPS Provider
Popular VPS providers include DigitalOcean, Vultr, Linode, AWS EC2, and Hetzner. For most websites migrating from shared hosting, a VPS with 2 GB RAM, 1-2 CPU cores, and 50 GB SSD storage is a good starting point. This comfortably handles sites with up to 50,000 monthly visitors.
Step 2: Set Up the VPS
Unlike shared hosting, a VPS starts as a blank server. You need to install and configure the web stack yourself. The most common setup includes:
- Operating system: Ubuntu 22.04 LTS or AlmaLinux 8 (CentOS replacement)
- Web server: Nginx (recommended) or Apache
- Database: MySQL 8 or MariaDB 10.6+
- PHP: PHP 8.1 or higher with required extensions
- SSL: Certbot for Let's Encrypt certificates
Alternatively, install a control panel like Virtualmin (free) or cPanel (paid) to get a familiar management interface.
Step 3: Back Up Everything on cPanel
Before starting the migration, create a full backup from cPanel:
- Go to cPanel > Backup > Generate Full Backup
- Download the backup file
- Also separately download your databases via phpMyAdmin (as SQL files)
- Note your PHP version, extensions, and any custom .htaccess rules
Step 4: Transfer Files to the VPS
Upload your website files to the VPS using SCP, SFTP, or rsync. Place them in the web root directory configured in your web server (typically /var/www/yourdomain for Nginx).
Step 5: Import the Database
Create a new database and user on the VPS, then import your SQL backup. Update your application's database configuration file with the new credentials.
Step 6: Configure the Web Server
Set up a virtual host (Nginx) or virtual host (Apache) configuration for your domain. Ensure the document root, PHP version, and any rewrite rules match your cPanel setup.
Step 7: Test Before Switching DNS
This is the most critical step. Use HostCheck to preview your website on the VPS by entering your domain and the VPS IP address. Check every page, test forms, verify images load correctly, and confirm that your CMS admin panel works. Fix any issues before proceeding.
What Usually Breaks After Leaving cPanel
The move from cPanel to a VPS often fails in the same places: mail was still tied to the old host, hidden .htaccess rules were not carried over, PHP extensions differed from the previous environment, or the new virtual host did not answer correctly for both the root domain and the www version. None of those problems are obvious from a file transfer alone, which is why a real preview against the target IP matters so much.
If you are replacing Apache with Nginx on the VPS, pay special attention to URL rewrites, redirects, and any application that depended on Apache-specific behaviour. A site may look correct on the homepage while article pages, login routes, or form handlers fail because rewrite logic was not translated properly.
A Better Sign-Off Order Before Cutover
After generating a HostCheck preview, work through the site in a fixed sequence: homepage, navigation, one representative content page, the contact form, the CMS admin area, and finally the most commercially important page on the site. Then verify logs, outgoing mail, and any scheduled job that matters to the business. That order surfaces the highest-risk problems before the cutover window starts.
Step 8: Set Up SSL
Run Certbot to generate a Let's Encrypt SSL certificate for your domain. You may need to use the DNS-01 challenge method if DNS has not been switched yet.
Step 9: Switch DNS
Update your domain's A record to point to the VPS IP address. With a low TTL (set this 24 hours before), the change should take effect within minutes for most visitors.
Post-Migration Checklist
- Set up automatic security updates
- Configure a firewall (UFW for Ubuntu) and close unused ports
- Move cron jobs and background tasks to the new server
- Confirm outbound email works and that the server is not still relaying through the old host
- Check logs for PHP, web server, and database errors during the first 24 hours
- Keep the old shared hosting account online until traffic and email have fully drained
Conclusion
A cPanel-to-VPS migration is not just a file copy. It is a platform change, which means the real work is in replicating behaviour, testing the target properly, and only then switching DNS. If you validate the site against the VPS before cutover, confirm mail routing separately, and keep the old server available as a fallback, you can make the move with far less risk and downtime. Use HostCheck to preview the VPS version of the site before you commit the DNS change.