← Back to Blog

How to Migrate from Shared Hosting to a VPS (2026)

Published May 4, 2026  ·  8 min read  ·  Galaxy Cloud Solutions

Most people put off moving to a VPS because they think it is complicated. It is not. If you can follow instructions and are comfortable with a terminal, you can do this in an afternoon. Here is the actual process.

⚡ Get a VPS from $5/mo — Use code LAUNCH2026 for 50% off

Before You Start

You will need:

Step 1: Back Up Everything on Your Current Host

Before touching anything, download a full backup from your shared host. Most cPanel hosts have a backup tool under Backup or Backup Wizard. Download the full account backup — this includes your files, databases, and email.

If your host does not have a backup tool, manually download your files via FTP and export your databases from phpMyAdmin.

Step 2: Set Up Your Web Server on the VPS

SSH into your new VPS and install a web server. For a WordPress site or most PHP applications, a LEMP stack (Nginx + MySQL + PHP) works well:

sudo apt update
sudo apt install -y nginx mysql-server php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-mbstring php8.3-xml php8.3-zip
sudo systemctl enable nginx mysql php8.3-fpm
sudo systemctl start nginx mysql php8.3-fpm

If you are on Galaxy Cloud Solutions, use the one-click LEMP installer in your dashboard and skip this step entirely.

Step 3: Transfer Your Files

Upload your site files to the VPS. The easiest way is SCP:

scp -r /path/to/your/site ubuntu@your-vps-ip:/var/www/html/yoursite

Then set the correct permissions:

sudo chown -R www-data:www-data /var/www/html/yoursite
sudo chmod -R 755 /var/www/html/yoursite

Step 4: Import Your Database

Create a new database on the VPS and import your backup:

sudo mysql -u root -p
CREATE DATABASE yoursite;
CREATE USER 'youruser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL ON yoursite.* TO 'youruser'@'localhost';
EXIT;
mysql -u youruser -p yoursite < yoursite_backup.sql

Update your site's database connection settings to point to the new database. For WordPress, that is in wp-config.php.

Step 5: Configure Nginx

Create an Nginx config for your site:

sudo tee /etc/nginx/sites-available/yoursite << 'EOF'
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/html/yoursite;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
EOF
sudo ln -s /etc/nginx/sites-available/yoursite /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Step 6: Test Before Switching DNS

Before pointing your domain at the new server, test the site by adding a temporary hosts file entry on your computer. On Mac or Linux, edit /etc/hosts. On Windows, edit C:\Windows\System32\drivers\etc\hosts:

YOUR_VPS_IP yourdomain.com

Open your browser and visit your domain. If the site loads correctly, you are ready to switch DNS.

Step 7: Get SSL

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

Certbot will automatically configure HTTPS and set up auto-renewal.

Step 8: Switch DNS

Log into your domain registrar and update your A record to point to your VPS IP address. DNS propagation takes anywhere from a few minutes to 48 hours depending on your TTL settings. Most of the time it is under an hour.

Once DNS has propagated, remove the hosts file entry you added in Step 6 and verify the live site is loading from the new server.

Step 9: Cancel Your Shared Hosting

Wait a few days after the migration to make sure everything is working before canceling your old host. Better to pay for an extra month than to discover a problem after you have already deleted your backup.

Ready to make the move?

Galaxy Cloud Solutions VPS plans start at $5/mo. Full root access, Cloudflare DDoS protection, and a one-click LEMP installer so you can skip half the steps above. Use code LAUNCH2026 for 50% off your first month.

Get Started