How to Migrate WordPress from Shared Hosting to VPS

How to Migrate WordPress from Shared Hosting to VPS

Share Article

Last Updated: May 07, 2026

Migrating WordPress from shared hosting to VPS is a major performance upgrade that can cut your page load times in half and handle traffic spikes that would crash a shared server. If your site has outgrown its current host — or you simply want more control — this step-by-step guide walks you through the entire migration process safely.

Why Migrate WordPress from Shared Hosting to VPS?

  • Performance: Dedicated CPU and RAM — no “noisy neighbor” effect
  • Scalability: Upgrade resources on demand without migrating hosts
  • Control: Full root access, custom PHP versions, server configuration
  • Security: Isolated environment
  • Cost efficiency: Cloud VPS from Vultr starts at just $6/month

What You’ll Need Before Starting

  • Access to your current shared hosting control panel (cPanel, Plesk, etc.)
  • A VPS account — we recommend Vultr or DigitalOcean
  • SSH client (Terminal on Mac/Linux, PuTTY on Windows)
  • About 1–2 hours of time

Step 1: Choose and Set Up Your VPS

Sign up for a VPS with at least 1 GB RAM and 25 GB SSD storage. For most WordPress sites, a Vultr Cloud Compute instance ($6/month) or DigitalOcean Droplet ($6/month) is perfect. Choose Ubuntu 22.04 LTS as your operating system.

Step 2: Install the LEMP Stack (Linux, Nginx, MySQL, PHP)

SSH into your new VPS and update the system:

apt update && apt upgrade -y
apt install nginx mysql-server php8.2-fpm php8.2-mysql php8.2-xml php8.2-mbstring php8.2-curl php8.2-zip php8.2-gd -y
systemctl enable nginx mysql php8.2-fpm
systemctl start nginx mysql php8.2-fpm

Step 3: Create a MySQL Database on the VPS

mysql -u root -p
CREATE DATABASE wp_database;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON wp_database.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 4: Export Your WordPress Files and Database

In cPanel, go to phpMyAdmin, select your database, and export as SQL. Then compress your WordPress files and download them. Alternatively use SSH on your old host:

tar -czf wordpress-backup.tar.gz /home/your_user/public_html/

Step 5: Upload Files to Your VPS

mkdir -p /var/www/yourdomain.com/public_html
chown -R www-data:www-data /var/www/yourdomain.com
scp wordpress-backup.tar.gz root@YOUR_SERVER_IP:/var/www/yourdomain.com/public_html/
ssh root@YOUR_SERVER_IP
cd /var/www/yourdomain.com/public_html/
tar -xzf wordpress-backup.tar.gz
chown -R www-data:www-data .

Step 6: Import the Database

mysql -u wp_user -p wp_database < /path/to/your-database-export.sql

Then update your wp-config.php with the new DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST (use localhost).

Step 7: Configure Nginx for WordPress

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/yourdomain.com/public_html;
    index index.php index.html;
    location / { try_files $uri $uri/ /index.php?$args; }
    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }
}
ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx

Step 8: Install Free SSL with Let’s Encrypt

apt install certbot python3-certbot-nginx -y
certbot --nginx -d yourdomain.com -d www.yourdomain.com

Step 9: Test Before Changing DNS

Edit your local /etc/hosts file: YOUR_VPS_IP yourdomain.com and test in the browser.

Step 10: Update DNS and Go Live

Log in to your domain registrar (Namecheap or GoDaddy) and update your A record to point to your new VPS IP address. DNS propagation takes 15 minutes to 48 hours.

Managed Alternative: Skip the Technical Work with Cloudways

Not comfortable with server administration? Cloudways offers a one-click WordPress migration tool that handles everything automatically — including SSL, Nginx optimization, and database import. Starting at $14/month.

Try Cloudways — Managed VPS Migration Made Easy

Frequently Asked Questions

How long does it take to migrate WordPress to VPS?

For an average WordPress site under 5 GB, the migration takes 1–2 hours including setup time. Larger sites may take 3–4 hours.

Will my site go down during the migration?

If done correctly, there is virtually zero downtime. Set up the new VPS completely first, test it, then switch DNS.

Which VPS is best for WordPress migration?

We recommend Vultr for its NVMe SSDs and competitive pricing, or DigitalOcean for its excellent documentation.

Do I need technical skills to manage a VPS?

Basic Linux command line knowledge helps. For a fully managed experience, use Cloudways.

What is the minimum VPS size for WordPress?

A 1 GB RAM / 25 GB SSD VPS handles most small to medium WordPress sites up to about 50,000 monthly visitors.

Can I use cPanel on a VPS?

Yes, though cPanel licenses add $20–$45/month. Free alternatives like CyberPanel or Webmin work well and are significantly cheaper.