Blog

How to Migrate WordPress From Shared Hosting to VPS

Migrate WordPress From Shared Hosting to VPS

Many WordPress websites begin on shared hosting because it’s affordable and easy to manage. As traffic increases, plugins become more advanced, or an online store starts receiving more visitors, shared hosting can struggle to keep up. Slow loading times, resource limits, unexpected downtime, and restricted server control are common signs that it’s time to upgrade to a Virtual Private Server (VPS).

Migrating a WordPress website from shared hosting to a VPS may seem technical at first, but with the right preparation, it becomes a straightforward process. Creating a complete backup, configuring the new server correctly, transferring your website files and database, and updating DNS settings are the key steps that help ensure a smooth migration without losing data or affecting your visitors.

This step-by-step guide explains how to migrate WordPress from shared hosting to a VPS safely and efficiently. You’ll learn how to prepare your website, move files and databases, configure your VPS, test everything before going live, and avoid the most common migration mistakes. By the end, you’ll have a faster, more secure, and scalable WordPress website running on your new VPS.


What Does Migrating WordPress From Shared Hosting to a VPS Mean?

Migrating WordPress from shared hosting to a VPS means moving your entire website, including WordPress files, databases, themes, plugins, media uploads, and server settings. from a shared hosting environment to a Virtual Private Server (VPS). Unlike shared hosting, where multiple websites use the same server resources, a VPS provides dedicated CPU, RAM, storage, and greater control over your hosting environment.

Most website owners consider this upgrade when shared hosting can no longer deliver the speed, stability, or flexibility their growing website requires. A VPS allows you to install your preferred software stack, optimize server performance, manage security settings, and handle higher traffic without being affected by other websites on the same physical server.

While the migration process involves transferring website files, exporting and importing the database, updating configuration files, and pointing your domain to the new server, it doesn’t have to result in downtime or data loss. With proper planning and testing, your visitors can continue accessing your website while the migration is completed smoothly.

Shared Hosting vs VPS Hosting

FeatureShared HostingVPS Hosting
Server ResourcesShared with multiple usersDedicated CPU, RAM & Storage
PerformanceCan fluctuate during peak usageConsistent and predictable performance
Root AccessNot availableFull root access available
ScalabilityLimited upgrade optionsEasily upgrade CPU, RAM & Storage
SecurityShared server environmentBetter isolation and stronger security
CustomizationLimited server configurationComplete server control
Best ForSmall blogs and beginner websitesGrowing websites, WooCommerce stores, SaaS apps, and business projects

Why Website Owners Upgrade to a VPS

As a website grows, hosting requirements change. A VPS provides more computing power, greater flexibility, and better long-term reliability than traditional shared hosting. This makes it suitable for websites that need faster loading speeds, stable performance during traffic spikes, and complete control over the hosting environment.

Common reasons to move from shared hosting to a VPS:

  • Faster page loading and improved Core Web Vitals
  • Dedicated CPU and RAM for consistent performance
  • Better handling of traffic spikes
  • Full root access for custom server configuration
  • Improved security and server isolation
  • Greater flexibility for WordPress optimization
  • Easy resource upgrades as your website grows

Signs Your Website Has Outgrown Shared Hosting

Shared hosting works well for new websites, but it has limitations. As your WordPress website attracts more visitors, installs additional plugins, or runs resource intensive applications like WooCommerce, the shared server environment may struggle to deliver consistent performance. If your website is becoming slower despite regular optimization, upgrading to a VPS is often the next logical step.

Instead of waiting for frequent downtime or performance issues, it’s better to identify the warning signs early. Moving to a VPS before your website reaches its limits helps maintain a better user experience, improves search performance, and gives you the flexibility to grow without unexpected resource restrictions.

Common Signs It’s Time to Upgrade

SignWhy It Matters
Slow Website SpeedPages take longer to load because server resources are shared with many websites.
Frequent Resource Limit ErrorsCPU, RAM, or I/O limits are reached regularly, affecting website performance.
Growing Website TrafficHigher visitor numbers require dedicated resources to maintain consistent speed.
WooCommerce Performance IssuesOnline stores need more processing power for carts, checkouts, and database queries.
Limited Server ControlShared hosting restricts PHP settings, server software, and advanced configurations.
Higher Security RequirementsBusiness websites often need stronger isolation, custom firewalls, and server level security.
Multiple Websites to ManageRunning several websites becomes easier with a scalable VPS environment.
Planning Future GrowthA VPS allows seamless upgrades without migrating to another hosting platform later.

Should You Upgrade Now?

If your website experiences several of these issues regularly, continuing on shared hosting may limit its performance and growth. A Linux VPS provides dedicated CPU, RAM, NVMe SSD storage, full root access, and greater flexibility, allowing your WordPress website to handle increasing traffic while maintaining fast loading speeds and reliable uptime.


Benefits of Migrating WordPress to a VPS

Moving WordPress from shared hosting to a VPS gives you greater control over your hosting environment while improving website performance, security, and scalability. Since your server resources are no longer shared with hundreds of other websites, your WordPress installation can handle higher traffic and resource intensive tasks more efficiently.

A VPS also gives you the flexibility to optimize your server according to your website’s requirements. Whether you’re running a personal blog, a WooCommerce store, a business website, or a custom web application, dedicated resources and root access make it easier to maintain consistent performance as your website grows.

Key Benefits of Using a VPS for WordPress

BenefitHow It Helps Your Website
Dedicated CPU & RAMEnsures your website receives guaranteed resources without being affected by other users.
Faster Website PerformanceNVMe SSD storage and dedicated resources improve page loading speed and server response times.
Full Root AccessInstall custom software, configure PHP, manage firewall rules, and optimize the server as needed.
Better SecurityGreater server isolation, custom security configurations, and stronger protection against vulnerabilities.
Higher ScalabilityUpgrade CPU, RAM, storage, or bandwidth as your traffic increases without changing hosting platforms.
Improved Database PerformanceFaster MySQL or MariaDB processing helps WordPress handle dynamic content more efficiently.
Greater Server FlexibilityChoose your preferred Linux distribution, web server, PHP version, and caching technologies.
Reliable Website UptimeDedicated resources reduce performance fluctuations and improve overall server stability.

Is a VPS Worth It for WordPress?

For websites receiving consistent traffic or running resource intensive plugins, a VPS is usually a worthwhile investment. The combination of dedicated resources, better performance, stronger security, and complete server control provides a stable foundation that supports long term growth without the common limitations of shared hosting.


Prerequisites Before Migrating Your Website

Before migrating your WordPress website to a VPS, spend a few minutes preparing everything you’ll need throughout the process. Having backups, server credentials, and the required software ready helps reduce the risk of migration errors and makes it easier to restore your website if something doesn’t go as planned.

Most migration problems occur because important steps are skipped before the transfer begins. Verifying your hosting account, checking software compatibility, and preparing your new VPS in advance allows you to complete the migration with minimal downtime and ensures your website works correctly after the DNS update.

WordPress Migration Checklist

RequirementWhy It’s Important
Complete Website BackupProtects your WordPress files, themes, plugins, uploads, and configuration before migration.
Database BackupKeeps all posts, pages, users, comments, and website settings safe during the transfer.
Domain & DNS AccessRequired to update your domain’s A record or nameservers after migration.
VPS Server ReadyInstall Linux, Apache or Nginx, PHP, and MySQL or MariaDB before transferring files.
SSH or SFTP AccessAllows secure file transfers and remote server management.
WordPress Admin LoginNeeded to verify plugins, themes, and website functionality after migration.
Compatible PHP VersionPrevents compatibility issues with WordPress, themes, and installed plugins.
Enough Server StorageEnsures your VPS has sufficient space for website files, databases, backups, and future growth.

Expert Tip Before You Start

Avoid making major changes to your website while the migration is in progress. Delay publishing new content, updating plugins, or changing themes until the migration is complete. This helps keep your website files and database synchronized, reducing the chances of missing data or unexpected conflicts after the VPS goes live.


Choose the Right VPS Hosting Provider

Not every VPS hosting provider offers the same level of performance, security, or flexibility. Before purchasing a plan, compare the underlying infrastructure, server resources, support quality, and upgrade options instead of focusing only on the monthly price. A well configured VPS can save you from future migrations while providing a stable environment for your growing WordPress website.

Your hosting provider should make server management easier, not more complicated. Features such as NVMe SSD storage, dedicated CPU and RAM, full root access, automated backups, and responsive technical support become increasingly important as your website traffic and resource requirements continue to grow.

What to Look for Before Buying a Linux VPS

FeatureWhy It Matters
NVMe SSD StorageDelivers faster file access, lower latency, and quicker database performance than traditional SSD storage.
Dedicated CPU & RAMEnsures consistent server performance without sharing critical resources with other users.
KVM VirtualizationProvides better resource isolation, improved stability, and full kernel level control over your VPS.
Full Root AccessLets you install software, configure services, manage security, and customize the server environment.
Daily or Weekly BackupsHelps restore your website quickly if files become corrupted or accidental changes occur.
Free Dedicated IPv4Simplifies website hosting, remote access, and server configuration while improving compatibility.
Scalable ResourcesAllows CPU, RAM, storage, and bandwidth upgrades without moving your website again.
24/7 Technical SupportExperienced support engineers can quickly assist with server configuration and migration issues whenever needed.

Our Recommendation

If you’re looking for a reliable provider for your WordPress migration, YouStable is worth considering. Its Linux VPS plans include dedicated CPU and RAM, NVMe SSD storage, KVM virtualization, full root access, free dedicated IPv4, weekly backups, instant deployment, and 24/7 expert support. These features make it a practical option for WordPress websites, WooCommerce stores, business applications, and development projects that need consistent performance and room to grow.


How to Migrate WordPress From Shared Hosting to a VPS

Step 1: Purchase and Set Up Your VPS

The first step is selecting a Linux VPS that matches your website’s current requirements while leaving enough room for future growth. Consider factors such as CPU cores, RAM, NVMe SSD storage, bandwidth, and data center location before placing your order. Choosing the right VPS at the beginning helps avoid another migration as your website continues to grow.

After purchasing the VPS, deploy your preferred Linux operating system, such as Ubuntu, Debian, AlmaLinux, or Rocky Linux. Most hosting providers allow you to install the operating system within minutes through their control panel. Once the installation is complete, note your server’s public IP address, root username, and SSH password, as you’ll need them throughout the migration process.

Website TypeRecommended VPS Configuration
Personal Blog1 vCPU • 2–4 GB RAM • 50 GB NVMe SSD
Business Website2 vCPU • 4–8 GB RAM • 100 GB NVMe SSD
WooCommerce Store4 vCPU • 8–16 GB RAM • 200 GB NVMe SSD
High Traffic Website8+ vCPU • 16+ GB RAM • 400 GB+ NVMe SSD

Before Moving to the Next Step

Once your VPS is active, verify that you can access the server using the provided IP address and SSH credentials. A successful SSH connection confirms that the server is ready for software installation and the remaining WordPress migration process.

Step 2: Connect to the VPS Using SSH

After your VPS is deployed, the next step is connecting to it using SSH (Secure Shell). SSH provides a secure way to access and manage your Linux server remotely, allowing you to install software, transfer files, configure services, and complete the WordPress migration from the command line.

Most VPS providers send the server IP address, root username, and temporary password immediately after activation. Keep these credentials safe, as they’ll be required throughout the migration process. If you’re connecting for the first time, you’ll also be asked to verify the server’s fingerprint before the secure connection is established.

Connect to Your VPS from Different Operating Systems

Operating SystemRecommended SSH ClientConnection Method
WindowsPuTTY or Windows TerminalSSH using server IP, username, and password
macOSTerminalBuilt in SSH support
LinuxTerminalBuilt in SSH support

Connect Using the SSH Command

Open your terminal and run:

ssh root@your_server_ip

Replace your_server_ip with your VPS’s public IP address.

For example:

ssh root@192.168.1.100

When prompted:

  • Type yes to accept the server fingerprint.
  • Enter your VPS password.
  • Press Enter to log in.

After a successful login, you’ll see the Linux command prompt, indicating that your server is ready for configuration.

Common SSH Connection Problems

ProblemSolution
Permission deniedVerify the correct username and password or use your SSH private key.
Connection timed outCheck that your VPS is running and the server IP address is correct.
Port 22 blockedEnsure SSH is enabled and the firewall allows port 22.
Host key verification failedRemove the old SSH fingerprint and reconnect to the server.

Before Continuing

Once you’re successfully connected through SSH, it’s a good practice to update your Linux server and install the latest security patches before configuring the web server. Starting with an updated system helps improve stability, security, and compatibility throughout the WordPress migration process.

Step 3: Install the Required Server Software

A newly deployed Linux VPS doesn’t include everything required to run a WordPress website. Before transferring your files, you’ll need to install a web server, PHP, a database server, and a few additional packages. Together, these components create the environment WordPress needs to function properly.

Most WordPress websites run on either the LEMP stack (Linux, Nginx, MySQL/MariaDB, PHP) or the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP). Both are reliable, but many administrators prefer Nginx for its efficient resource usage and better performance under higher traffic, while Apache remains a popular choice for its flexibility and wide compatibility.

Essential Software for WordPress

SoftwarePurpose
Nginx or ApacheServes your WordPress website to visitors.
PHPProcesses WordPress code and executes PHP scripts.
MySQL or MariaDBStores posts, pages, users, settings, and website data.
SSL (Let’s Encrypt)Encrypts website traffic and enables HTTPS.
Git & CurlUseful for downloading files and managing applications.
Unzip UtilityExtracts compressed WordPress files and backups.

Update Your Linux Server

Before installing any software, update your server packages.

For Ubuntu or Debian, run:

sudo apt update && sudo apt upgrade -y

For AlmaLinux, Rocky Linux, or CentOS, run:

sudo dnf update -y

Updating your server installs the latest security patches and software updates, reducing compatibility issues during the migration process.

Install Nginx, PHP, and MariaDB (Ubuntu/Debian)

If you’re using Ubuntu or Debian, install the required packages with:

sudo apt install nginx mariadb-server php php-fpm php-mysql unzip curl git -y

This installs:

  • Nginx Web Server
  • PHP & PHP-FPM
  • MariaDB Database Server
  • PHP MySQL Extension
  • Git
  • Curl
  • Unzip

Verify the Installation

After installation, confirm that all major services are running correctly.

sudo systemctl status nginx
sudo systemctl status mariadb
php -v

If the services show an active (running) status and PHP returns its installed version, your VPS is ready for the next stage of the migration.

Before Moving Ahead

At this point, your VPS has the basic software required to host a WordPress website. The next step is creating a new database and database user, which WordPress will use to store website content, settings, plugins, themes, and user information.

Step 4: Create a New Database for WordPress

WordPress stores all of its content inside a database, including posts, pages, users, comments, plugin settings, and website configurations. Before importing your existing website, you’ll need to create a new database and assign a dedicated database user with the required permissions on your VPS.

Using a separate database user for each website is considered a security best practice. It limits unnecessary privileges and makes database management much easier, especially if you plan to host multiple WordPress websites on the same VPS.

Log in to MariaDB

Connect to your MariaDB server using the following command:

sudo mysql

Once connected, you’ll see the MariaDB command prompt.

Create a New Database

Replace wordpress_db with your preferred database name.

CREATE DATABASE wordpress_db;

A dedicated database keeps your WordPress data organized and prevents conflicts with other applications hosted on the same server.

Create a Database User

Replace wp_user and StrongPassword123! with your own secure username and password.

CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongPassword123!';

Choose a long, unique password containing uppercase letters, lowercase letters, numbers, and special characters to improve database security.

Grant Database Permissions

Allow the new user to manage the WordPress database.

GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';

This gives the database user permission to read, write, update, and delete data required for normal WordPress operations.

Apply the Changes

Reload the MariaDB privilege table.

FLUSH PRIVILEGES;

This command activates the new permissions immediately without restarting the database server.

Exit MariaDB

After everything is configured successfully, leave the MariaDB console.

EXIT;

Database Information You’ll Need Later

Keep the following details in a safe place because they’ll be required when editing the wp-config.php file during the migration.

SettingExample
Database Namewordpress_db
Database Usernamewp_user
Database PasswordYourStrongPassword
Database Hostlocalhost

Before Moving to the Next Step

Your VPS is now ready to accept your existing WordPress website. The next step is creating a complete backup of your current shared hosting account, including website files and the MySQL database, so nothing is lost during the migration process.

Step 5: Back Up Your Existing WordPress Website

Before making any changes to your hosting environment, create a complete backup of your WordPress website. A backup acts as a safety net, allowing you to restore your website quickly if something goes wrong during the migration. Even when the migration is planned carefully, having a recent backup is always recommended before moving files or updating DNS records.

A complete WordPress backup includes more than just your website files. It should also contain the database, themes, plugins, media uploads, and configuration files. Restoring only one of these components can result in a broken website, missing content, or database connection errors after the migration.

What Should You Back Up?

ComponentWhy It’s Important
WordPress FilesIncludes themes, plugins, uploads, and core WordPress files required to run the website.
MySQL DatabaseStores posts, pages, users, comments, settings, and WooCommerce data.
wp-config.phpContains database credentials and important WordPress configuration settings.
.htaccess FilePreserves custom redirects, permalink rules, and security configurations (Apache servers).
Custom SSL or Configuration FilesRequired if your website uses custom server or security settings.

Ways to Back Up a WordPress Website

There are several reliable methods to create a backup before migration. Choose the one that matches your hosting environment and technical experience.

  • cPanel Backup Wizard – Creates a full account backup directly from your hosting dashboard.
  • File Manager – Download website files manually as a compressed ZIP archive.
  • FTP or SFTP – Transfer all website files to your local computer using an FTP client like FileZilla.
  • phpMyAdmin – Export your WordPress database as an SQL file.
  • WordPress Backup Plugins – Tools like UpdraftPlus, Duplicator, or WPvivid simplify the backup process for beginners.

Verify Your Backup Before Continuing

After downloading your backup, confirm that both the website files and database have been saved successfully. Open the backup folder, verify the ZIP archive isn’t corrupted, and ensure the exported SQL file is complete. Keeping a copy on your local computer and another in cloud storage provides an additional layer of protection before starting the migration.

Before Moving to the Next Step

Once your backup has been verified, you’re ready to transfer your WordPress website to the VPS. The next step is uploading all website files to the new server, preserving the same folder structure so WordPress continues working correctly after the migration is complete.

Step 6: Upload Your WordPress Files to the VPS

After preparing your VPS and creating a complete backup, the next step is transferring your WordPress files to the new server. These files include your themes, plugins, media uploads, WordPress core files, and configuration files. Keeping the original directory structure unchanged is important because WordPress depends on these files to function correctly after the migration.

Most users transfer files using SFTP, SCP, or rsync because they’re secure and reliable. If you’re using a control panel, you can also upload the backup archive through its File Manager. Once the transfer is complete, extract the files inside your website’s document root so the web server can access them properly.

Common Ways to Upload WordPress Files

MethodBest ForSecurity
SFTPBeginners and regular website migrations⭐⭐⭐⭐⭐
SCPFast command line file transfers⭐⭐⭐⭐⭐
rsyncLarge websites and incremental transfers⭐⭐⭐⭐⭐
Control Panel File ManagerUsers with a hosting panel installed⭐⭐⭐⭐☆

Upload Files Using SCP

If your WordPress backup is stored on your local computer, you can upload it with:

scp wordpress-backup.zip root@your_server_ip:/var/www/html/

Replace:

  • wordpress-backup.zip with your backup file.
  • your_server_ip with your VPS IP address.

The archive will be copied securely to your server.

Extract the Backup Archive

After logging into your VPS through SSH, move to your website directory and extract the backup.

cd /var/www/html
unzip wordpress-backup.zip

This restores all WordPress files, including the wp-content directory, themes, plugins, uploads, and configuration files.

Set the Correct File Permissions

After extracting the files, assign the proper ownership so your web server can read and manage them correctly.

For Ubuntu with Nginx or Apache:

sudo chown -R www-data:www-data /var/www/html

Then apply the recommended permissions.

sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo find /var/www/html -type f -exec chmod 644 {} \;

Correct ownership and permissions help prevent common issues such as 403 Forbidden, upload failures, and plugin update errors.

Before Moving to the Next Step

Your WordPress files are now available on the VPS, but the website won’t load until the database is imported. The next step is importing your existing MySQL or MariaDB database so WordPress can reconnect to all of your posts, pages, users, settings, and website content.

Step 7: Import the WordPress Database

After transferring your WordPress files, the next step is importing your existing database into the VPS. The database contains everything that makes your website dynamic, including posts, pages, users, comments, plugin settings, WooCommerce orders, menus, and WordPress configurations. Without importing it successfully, your website will display a database connection error or load as a fresh WordPress installation.

Before importing the database, confirm that you’ve already created a new database and database user on your VPS. Also, keep your exported .sql backup file ready, as you’ll import this file into the database created in the previous step.

Import the Database Using the Command Line

If your database backup is named wordpress.sql, run the following command:

mysql -u wp_user -p wordpress_db < wordpress.sql

Replace:

  • wp_user with your database username.
  • wordpress_db with your database name.
  • wordpress.sql with your exported SQL backup.

When prompted, enter your database password and wait for the import process to finish.

Verify That the Database Was Imported Successfully

After the import is complete, log in to MariaDB.

sudo mysql -u wp_user -p

Select your WordPress database.

USE wordpress_db;

Display all database tables.

SHOW TABLES;

If the import was successful, you’ll see familiar WordPress tables such as:

  • wp_posts
  • wp_users
  • wp_options
  • wp_comments
  • wp_terms
  • wp_postmeta

The exact table prefix may differ if you changed it during the original WordPress installation.

Common Database Import Problems

ProblemSolution
Access Denied ErrorVerify the database username, password, and assigned permissions.
Unknown DatabaseMake sure the database was created before importing the SQL file.
SQL File Too LargeImport the database through SSH instead of phpMyAdmin for better reliability.
Import InterruptedCheck available disk space and verify the SQL backup isn’t corrupted.

Before Moving to the Next Step

At this stage, both your WordPress files and database are stored on the VPS. The only thing left is connecting WordPress to its new database by updating the wp-config.php file with the correct database credentials. Once that’s done, your website will be ready for server configuration and final testing before going live.

Step 8: Update the wp-config.php File

After importing your WordPress database, you’ll need to update the wp-config.php file with the new database details. This file acts as the connection bridge between your WordPress website and the MySQL or MariaDB database running on your VPS. If the information inside this file doesn’t match your new server, WordPress won’t be able to retrieve your website’s content.

The wp-config.php file is located in the root directory of your WordPress installation. Before making any changes, create a backup of the original file. This allows you to restore the previous configuration quickly if an editing mistake prevents your website from loading.

Open the wp-config.php File

Navigate to your WordPress installation directory and open the configuration file using the Nano editor.

cd /var/www/html
sudo nano wp-config.php

Update Your Database Credentials

Locate the following section inside the file.

define('DB_NAME', 'database_name');
define('DB_USER', 'database_user');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'localhost');

Replace these values with the database information you created earlier.

Example:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'YourStrongPassword');
define('DB_HOST', 'localhost');

If your database server runs on the same VPS, localhost is usually the correct database host.

Save the Configuration

After updating the database details:

  • Press Ctrl + O to save the file.
  • Press Enter to confirm.
  • Press Ctrl + X to exit Nano.

Your new configuration will take effect immediately.

Verify the Configuration

Before continuing, double check the following settings:

SettingVerify
Database NameMatches the database created on your VPS.
Database UsernameMatches the database user with proper privileges.
Database PasswordEntered correctly without extra spaces.
Database HostUsually localhost unless specified otherwise.
File PermissionsThe web server can read the wp-config.php file.

Incorrect database credentials are the most common reason for the “Error Establishing a Database Connection” message after migration.

Before Moving to the Next Step

Your WordPress installation is now connected to the new database on the VPS. The next step is configuring your web server by creating a virtual host, setting the document root, and enabling the website so it can respond to incoming requests correctly.

Step 9: Configure Your Virtual Host

Now that your WordPress files and database are ready, it’s time to configure your web server so it knows where your website is located. This is done by creating a Virtual Host (Apache) or Server Block (Nginx), which tells the server which domain to serve and where your WordPress files are stored.

If this step is skipped or configured incorrectly, your VPS may display the default web server page instead of your WordPress website. Taking a few minutes to configure your web server correctly ensures your website loads properly after the domain is pointed to the new VPS.

Create an Nginx Server Block

If you’re using Nginx, create a new configuration file for your website.

sudo nano /etc/nginx/sites-available/example.com

Replace example.com with your actual domain name.

Add the Server Configuration

Paste the following configuration into the file.

server {
   listen 80;
   server_name example.com www.example.com;
   root /var/www/html;
   index index.php index.html index.htm;
   location / {
       try_files $uri $uri/ /index.php?$args;
   }
   location ~ \.php$ {
       include snippets/fastcgi-php.conf;
       fastcgi_pass unix:/run/php/php8.3-fpm.sock;
   }
   location ~ /\.ht {
       deny all;
   }
}
Note: If you're using a different PHP version, replace php8.3-fpm.sock with the version installed on your VPS.

Enable the Website

Create a symbolic link to activate the new server configuration.

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Test the Configuration

Before restarting Nginx, verify that the configuration doesn’t contain any syntax errors.

sudo nginx -t

If everything is configured correctly, you’ll see a message indicating that the configuration test was successful.

Restart Nginx

Apply the new configuration by restarting the web server.

sudo systemctl restart nginx

Your server is now configured to serve your WordPress website from the VPS.

Verify Your Virtual Host

CheckExpected Result
Nginx Configuration TestConfiguration syntax is successful.
Website Root DirectoryPoints to your WordPress installation.
Server NameMatches your primary domain and www version.
PHP ProcessingPHP files are handled correctly through PHP-FPM.
Nginx ServiceRunning without errors after restart.

Before Moving to the Next Step

Your web server is now ready to serve your WordPress website. The next step is securing the website with an SSL certificate so visitors can access it over HTTPS, protecting data transferred between the browser and your VPS while improving trust and search engine visibility.

Step 10: Install a Free SSL Certificate

After configuring your web server, the next step is securing your WordPress website with an SSL (Secure Sockets Layer) certificate. SSL encrypts the communication between your website and its visitors, protecting sensitive information such as login credentials, contact form submissions, and payment details. It also enables HTTPS, which improves user trust and is considered a ranking signal by search engines.

The easiest way to install a trusted SSL certificate on a Linux VPS is by using Let’s Encrypt with Certbot. The certificate is free, widely supported by modern browsers, and can be renewed automatically, making it an excellent choice for most WordPress websites.

Install Certbot

If you’re using Nginx on Ubuntu or Debian, install Certbot with:

sudo apt install certbot python3-certbot-nginx -y

This installs both Certbot and the required Nginx plugin needed to request and configure SSL certificates automatically.

Generate the SSL Certificate

Run the following command and replace example.com with your actual domain name.

sudo certbot --nginx -d example.com -d www.example.com

During the setup process, Certbot will:

  • Verify your domain ownership.
  • Download the SSL certificate.
  • Configure Nginx automatically.
  • Redirect HTTP traffic to HTTPS (optional but recommended).

Verify HTTPS

Once the installation is complete, open your website in a browser.

https://yourdomain.com

If the browser displays the padlock icon, the SSL certificate has been installed successfully and your website is now using a secure HTTPS connection.

Test Automatic SSL Renewal

Let’s Encrypt certificates are valid for 90 days, but Certbot can renew them automatically.

To test the renewal process, run:

sudo certbot renew --dry-run

If the test completes successfully, your SSL certificate will renew automatically before it expires.

SSL Installation Checklist

VerificationExpected Result
HTTPS EnabledWebsite opens securely over HTTPS.
SSL CertificateValid and trusted by modern browsers.
Automatic RedirectHTTP automatically redirects to HTTPS.
Padlock IconDisplays correctly in the browser.
Auto Renewal TestCompletes successfully without errors.

Before Moving to the Next Step

Your WordPress website is now protected with SSL and ready for final testing. Before updating your DNS records, verify that every page, image, plugin, and login function works correctly on the VPS. Testing first helps identify configuration issues before visitors are directed to the new server.

Step 11: Test Your Website Before Going Live

Before pointing your domain to the new VPS, make sure the migrated WordPress website is working as expected. Testing the website first gives you an opportunity to identify missing files, database issues, broken links, or configuration errors without affecting your visitors. It’s much easier to fix problems while your live website is still running on the old shared hosting account.

A complete migration isn’t finished just because the files and database have been transferred. Spend a few minutes checking the most important website functions to ensure everything works properly before updating your DNS records. This simple step helps minimize downtime and prevents unexpected issues after the migration goes live.

Important Things to Test

What to CheckExpected Result
HomepageLoads correctly without errors or missing content.
WordPress LoginAdministrator dashboard opens successfully.
Pages & PostsContent displays properly with correct formatting.
Images & MediaAll images, videos, and downloads load normally.
Contact FormsForm submissions work and emails are delivered successfully.
Plugins & ThemesEvery installed plugin and theme functions as expected.
WooCommerce StoreProducts, cart, checkout, and payment process work correctly.
Website SpeedPages load quickly without server or PHP errors.

You can use these tools to confirm that your website is performing properly after the migration.

  • Google PageSpeed Insights – Analyze loading speed and Core Web Vitals.
  • GTmetrix – Check page performance and loading time.
  • Pingdom Website Speed Test – Measure server response and page speed.
  • Google Search Console URL Inspection – Verify page accessibility after the migration.
  • Browser Developer Tools – Identify broken resources or JavaScript errors.

Before Moving to the Next Step

Once you’re confident that everything is working correctly on the VPS, you’re ready to update your domain’s DNS records. After the DNS changes propagate, visitors will automatically start accessing your WordPress website from the new VPS instead of the old shared hosting account.

Step 12: Point Your Domain to the VPS

After confirming that your WordPress website is working correctly on the VPS, the final step is directing your domain to the new server. This is done by updating your domain’s DNS (Domain Name System) records. Once the changes are complete and DNS propagation finishes, visitors will automatically access your website from the VPS instead of your previous shared hosting account.

Before updating your DNS settings, keep your old hosting account active for at least 48 hours. Although many DNS changes are completed within a few hours, global propagation can sometimes take longer depending on your DNS provider and internet service provider.

DNS Records You May Need to Update

DNS RecordPurposeExample
A RecordPoints your domain to the VPS IP address.example.com → 192.168.1.100
WWW RecordConnects the www version of your domain.www.example.com → 192.168.1.100
NameserversDirects DNS management to another provider (only if required).ns1.provider.com

Update Your Domain’s A Record

Log in to your domain registrar or DNS provider.

Then:

  • Open the DNS Management section.
  • Locate the existing A Record.
  • Replace the old hosting IP address with your new VPS IP address.
  • Save the changes.

If your website uses the www version, update that record as well.

Verify DNS Propagation

After updating your DNS records, allow some time for the changes to propagate across the internet.

You can verify the DNS update using tools such as:

  • DNS Checker
  • WhatsMyDNS
  • Google Public DNS

When these tools display your new VPS IP address worldwide, the migration is complete and visitors will begin reaching your website through the new server.

Before Moving to the Next Step

Once DNS propagation is complete, browse your website from different devices and networks to confirm that every page loads from the VPS. After verifying everything is working correctly, you can safely cancel your old shared hosting account if it’s no longer needed.

Step 13: Verify Everything After Migration

After your domain starts pointing to the VPS, perform one final inspection before considering the migration complete. Although your website may appear to be working, hidden issues such as broken links, incorrect redirects, email delivery failures, or plugin conflicts can still exist. A complete verification helps ensure your visitors experience a stable, secure, and fully functional website.

This final review is also a good opportunity to confirm that your new VPS is delivering the performance improvements you expected. Testing website speed, SSL, server logs, and important WordPress features now can prevent future troubleshooting and help you identify small issues before they affect your users.

Post Migration Verification Checklist

What to VerifyExpected Result
Homepage & Internal PagesEvery page loads correctly without errors.
HTTPS & SSL CertificateSecure padlock appears and all pages use HTTPS.
WordPress Admin PanelDashboard opens normally and settings are accessible.
Images & Media FilesAll media loads without broken links.
Plugins & ThemesInstalled plugins and themes work as expected.
Forms & Email DeliveryContact forms send emails successfully.
WooCommerce FunctionalityCart, checkout, and payment process work correctly.
404 Pages & RedirectsInternal links and redirects function properly.
Website PerformancePage speed and server response remain stable.
Automatic BackupsBackup schedule is active and working correctly.

Final Health Check

Before cancelling your old hosting account, browse your website from different devices, browsers, and internet connections. Check important pages, test login functionality, submit a contact form, and verify that emails, images, and downloadable files are working correctly. If everything performs as expected, your WordPress migration has been completed successfully.

Migration Complete

Your WordPress website is now running on a VPS with dedicated resources, improved performance, and greater flexibility. At this stage, you can safely keep monitoring your server for a few days, enable regular backups, and continue optimizing your VPS to get the best possible performance from your new hosting environment.


Essential Tasks After WordPress VPS Migration

Successfully migrating your WordPress website is only part of the process. Once the website is live on your VPS, spend some time securing the server, improving performance, and enabling automatic backups. These post migration tasks help reduce security risks, improve loading speed, and keep your website stable as traffic grows.

A newly migrated VPS should never be left with its default configuration. Simple improvements such as enabling a firewall, configuring automatic backups, installing caching, and monitoring server performance can make a significant difference in long term reliability. Completing these tasks now helps you avoid unnecessary downtime and future maintenance issues.

TaskWhy It Matters
Enable Automatic BackupsCreates regular recovery points in case of accidental data loss or server issues.
Configure a FirewallRestricts unauthorized access and protects your VPS from unwanted connections.
Install Fail2BanBlocks repeated failed login attempts and helps prevent brute force attacks.
Enable Server CachingImproves page loading speed and reduces server resource usage.
Configure Redis or Object CacheAccelerates dynamic WordPress pages and database queries.
Enable OPcacheSpeeds up PHP execution by caching compiled scripts in memory.
Monitor Server ResourcesTracks CPU, RAM, disk usage, and uptime to identify performance issues early.
Keep Software UpdatedRegularly update Linux, PHP, WordPress, themes, and plugins to improve security and stability.

Continue Monitoring Your Website

Even after a successful migration, monitor your website for the next few days. Review server logs, track uptime, test important website functions, and watch resource usage during peak traffic. Regular monitoring helps detect potential issues early and ensures your VPS continues delivering fast, secure, and reliable performance as your website grows.


Common WordPress Migration Problems and Their Solutions

Even when every migration step is followed carefully, small configuration issues can appear after moving WordPress from shared hosting to a VPS. Most problems are related to database settings, file permissions, DNS propagation, or web server configuration rather than the migration itself. The good news is that these issues are usually easy to identify and resolve with a few simple checks.

If your website doesn’t load correctly after migration, don’t panic or start the migration from scratch. Work through the issue one step at a time by checking your server configuration, WordPress settings, and DNS records. In most cases, the problem can be resolved within a few minutes.

Common Problems and Solutions

ProblemPossible CauseRecommended Solution
Error Establishing a Database ConnectionIncorrect database name, username, password, or host.Verify the database credentials inside wp-config.php and confirm the database server is running.
500 Internal Server ErrorIncorrect server configuration, PHP issue, or invalid file permissions.Review the Nginx or Apache configuration, restart services, and check the server error logs.
White Screen of DeathPHP memory limit, incompatible plugin, or theme conflict.Increase the PHP memory limit and temporarily disable plugins or switch to a default WordPress theme.
404 Errors After MigrationPermalink rules were not refreshed after migration.Open Settings → Permalinks in WordPress and click Save Changes without modifying anything.
Mixed Content WarningsSome website resources still load over HTTP.Update old HTTP URLs to HTTPS and verify your SSL configuration.
Permission Denied ErrorsIncorrect file or directory ownership.Reset the recommended ownership and permissions for WordPress files and folders.
DNS Changes Not VisibleDNS propagation is still in progress.Wait for propagation to complete and verify the new IP address using a DNS lookup tool.
Emails Not SendingServer mail configuration or SMTP settings are missing.Configure an SMTP plugin or use a trusted email delivery service for reliable email sending.

Troubleshooting Tips

If the issue continues after applying the recommended solution, review your web server logs and PHP error logs before making additional changes. Error logs usually identify the exact file, plugin, or configuration causing the problem, allowing you to resolve the issue much faster than guessing.


Shared Hosting vs VPS Hosting

Both Shared Hosting and VPS Hosting can run a WordPress website, but they serve different requirements. Shared hosting is a practical option for beginners, personal blogs, and small websites with limited traffic because multiple users share the same server resources. As your website grows, however, those shared resources can become a limiting factor, especially during traffic spikes or when running resource intensive plugins.

A VPS provides dedicated CPU, RAM, and storage, giving your WordPress website more consistent performance and greater flexibility. You also gain full root access, stronger security, and the ability to customize your server environment. If your website is growing steadily or supports business operations, upgrading to a VPS offers a more reliable foundation for long term performance.

Shared Hosting vs VPS Hosting Comparison

FeatureShared HostingVPS Hosting
Server ResourcesShared with multiple websitesDedicated CPU, RAM, and storage
PerformanceMay vary during peak trafficStable and consistent performance
Root AccessNot availableFull root access included
Server CustomizationLimited configuration optionsComplete server level control
Website SecurityShared hosting environmentBetter isolation and stronger security
ScalabilityLimited upgrade flexibilityEasily upgrade resources as needed
Traffic HandlingSuitable for low to moderate trafficHandles growing and high traffic websites efficiently
Best ForPersonal blogs, portfolios, and small websitesBusiness websites, WooCommerce stores, SaaS platforms, and growing projects

Which Hosting Option Should You Choose?

If you’re launching your first website with minimal traffic, shared hosting is usually enough to get started. However, once your website begins attracting more visitors, requires better performance, or needs greater server control, migrating to a VPS becomes a practical long term investment. Dedicated resources, improved scalability, and stronger security make a VPS the better choice for websites that are expected to grow over time.


Best WordPress Migration Plugins

Migrating WordPress manually gives you complete control over the process, but it isn’t the only option. If you prefer a simpler workflow, several migration plugins can automate file transfers, database exports, and website restoration. These tools are especially helpful for beginners or users who don’t want to work with SSH commands and server configurations.

Each migration plugin offers different features, limitations, and supported hosting environments. Some are designed for small WordPress websites, while others handle larger websites, WooCommerce stores, and multisite installations more efficiently. Choosing the right plugin depends on your website size, technical experience, and migration requirements.

Best WordPress Migration Plugins Compared

PluginBest ForFree VersionOur Rating
DuplicatorComplete website backups and manual migrations✅ Yes⭐⭐⭐⭐⭐
Migrate GuruLarge WordPress websites with minimal downtime✅ Yes⭐⭐⭐⭐⭐
All in One WP MigrationBeginner friendly website transfers✅ Yes*⭐⭐⭐⭐☆
WPvivid Backup PluginBackups, migration, and website cloning✅ Yes⭐⭐⭐⭐☆
UpdraftPlus PremiumScheduled backups with migration features❌ Premium Migration⭐⭐⭐⭐☆

Note: The free version of All in One WP Migration has an import size limitation. Larger websites may require the premium extension.

Which Plugin Should You Choose?

If you’re comfortable managing a VPS through SSH, a manual migration gives you greater flexibility and complete control over your server. However, if you want a faster and more beginner friendly approach, Duplicator and Migrate Guru are reliable choices for most WordPress websites. They simplify the migration process while reducing the chances of missing important files or database content during the transfer.


WordPress Migration Checklist

Before cancelling your old hosting account or announcing the migration, complete one final review of your website. A simple checklist helps confirm that every important step has been completed successfully and reduces the chances of overlooking small issues that could affect your visitors after the migration.

Even if your website appears to be working normally, spending a few extra minutes verifying backups, security, DNS settings, and website functionality can save hours of troubleshooting later. Use the checklist below as a final confirmation before considering your WordPress migration complete.

Final WordPress Migration Checklist

TaskStatus
Complete backup of website files created
WordPress database exported successfully
Linux VPS deployed and configured
Web server (Nginx or Apache) installed
PHP and MySQL/MariaDB configured
WordPress files uploaded to the VPS
Database imported successfully
wp-config.php updated with new database details
SSL certificate installed and HTTPS verified
Website tested before updating DNS
DNS records updated correctly
Homepage, images, and internal pages verified
Contact forms and email delivery tested
Plugins and themes working properly
Automatic backups enabled
Firewall and basic server security configured
Website performance tested after migration
Old hosting account kept active during DNS propagation

Final Recommendation

Once every item in this checklist has been completed, continue monitoring your website for the next 24–48 hours. During this period, verify website speed, uptime, SSL, email delivery, and visitor activity before closing your previous hosting account. A short observation period helps ensure the migration has been completed successfully and your WordPress website is running smoothly on its new VPS.


Expert Tips for a Smooth WordPress Migration

Migrating a WordPress website becomes much easier when the process is planned carefully instead of being rushed. Small preparation steps, such as reducing DNS propagation time, checking server compatibility, and testing the website before updating the domain, can prevent unexpected downtime and make the transition much smoother.

Many migration issues are caused by simple oversights rather than technical problems. Following a few proven best practices helps protect your website data, improves reliability, and ensures visitors experience little to no disruption while your website moves from shared hosting to a VPS.

Practical Tips for a Successful Migration

Expert TipWhy It Helps
Reduce DNS TTL Before MigrationSpeeds up DNS propagation after updating your domain records.
Keep the Old Hosting ActiveAllows visitors to access your website while DNS changes propagate worldwide.
Avoid Updating Plugins During MigrationPrevents file mismatches and database inconsistencies between both servers.
Test the Website Before Updating DNSHelps identify issues before visitors reach the new VPS.
Use the Same PHP VersionReduces compatibility issues with WordPress, themes, and plugins.
Monitor Server LogsMakes it easier to identify configuration or PHP errors after migration.
Enable Automatic Backups ImmediatelyProvides a recovery point if unexpected issues occur later.
Monitor Performance for Several DaysConfirms that the VPS is stable under normal website traffic.

Final Advice Before Completing the Migration

Don’t rush to cancel your previous hosting account as soon as the website goes live. Keep it active until DNS propagation is complete and you’ve confirmed that every page, image, form, plugin, and email function is working correctly on the VPS. A careful review during the first 48 hours helps ensure your migration is successful and your visitors enjoy a faster, more reliable WordPress website.

Also Read: Best Free Web Hosting Providers


FAQs

1. Can I migrate WordPress from shared hosting to a VPS without downtime?

Yes, it’s possible to migrate WordPress with little or no noticeable downtime. The safest approach is to complete the migration on your VPS, test the website thoroughly, and update your DNS records only after confirming everything is working correctly. Keeping your old hosting account active during DNS propagation also helps prevent interruptions for visitors.

2. Do I need technical knowledge to migrate WordPress to a VPS?

Basic knowledge of WordPress, SSH, and Linux commands can be helpful, but it isn’t always required. Many hosting providers offer free migration services, and migration plugins can simplify the process for beginners. If you prefer complete control over your server, a manual migration is the better option.

3. How long does it take to migrate WordPress to a VPS?

The migration itself usually takes 30 minutes to a few hours, depending on your website size and internet speed. However, DNS propagation may take up to 24–48 hours before all visitors are directed to the new VPS.

4. Will migrating to a VPS improve WordPress performance?

Yes. A VPS provides dedicated CPU, RAM, and storage resources, which generally result in faster page loading, improved server response times, and more stable performance than shared hosting. The overall improvement also depends on proper server optimization and website configuration.

5. Can I migrate my WooCommerce store to a VPS?

Yes. WooCommerce websites often benefit from VPS hosting because online stores require more server resources to manage products, customer accounts, shopping carts, and checkout processes. Before migrating, create a complete backup and avoid processing major store updates during the migration.

6. Which Linux operating system is best for WordPress VPS hosting?

Ubuntu is one of the most popular choices because of its stability, extensive documentation, and broad software compatibility. Debian, AlmaLinux, and Rocky Linux are also reliable options, depending on your server management preferences.

7. Should I use Apache or Nginx for WordPress?

Both web servers work well with WordPress. Apache is easier for beginners and offers excellent compatibility, while Nginx is known for handling higher traffic efficiently and using server resources more effectively. The right choice depends on your website’s requirements and server configuration.

8. What should I do after migrating WordPress to a VPS?

After the migration, verify that your website, SSL certificate, forms, plugins, and email functionality are working correctly. It’s also recommended to enable automatic backups, configure a firewall, monitor server performance, and keep your operating system and WordPress installation updated to maintain security and stability.

About the author

Sanjeet Chauhan

Sanjeet Chauhan is a passionate blogger and SEO expert, dedicated to helping websites grow organically. He crafts practical strategies, shares actionable tips, and provides insights that boost traffic, improve rankings, a& elevate online presence effectively.

Leave a Comment