How to Migrate WordPress to Hetzner Cloud in Under an Hour
A complete step-by-step guide to moving your WordPress site from shared hosting to a Hetzner Cloud VPS with CloudPanel. Faster, cheaper, better.
Introduction
Migrating your WordPress site from shared hosting to a VPS sounds intimidating, but it really is not. The entire process can be done in under an hour, and the performance gains are immediate. If you have not already read about the reasons to make the switch, check out our guide on why you should ditch cPanel and shared hosting. This article is the practical companion - a step-by-step walkthrough that gets your site running on Hetzner Cloud with CloudPanel.
Let's get started.
What You'll Need
- A Hetzner Cloud account (free to sign up, you only pay for what you use)
- Your current shared hosting login (cPanel, Plesk, or similar)
- An FTP/SFTP client or SSH access to your current host
- About 30 to 60 minutes of time
- A domain you control, so you can update DNS records later
Step 1 - Set Up Your Hetzner VPS
First, create your new server. Head to the Hetzner Cloud Console and sign up if you have not already.
- Click Add Server in the Cloud Console.
- Choose a location close to your audience (Falkenstein, Nuremberg, or Helsinki for Europe; Ashburn or Hillsboro for the US).
- Select Ubuntu 22.04 as your operating system.
- Pick the CX22 plan: 2 shared vCPUs, 4 GB RAM, 40 GB SSD. This costs roughly 4 EUR per month and handles most WordPress sites with ease.
- Under SSH Keys, add your public key. If you do not have one yet, generate it with
ssh-keygen -t ed25519on your local machine. - Give your server a recognizable name and click Create & Buy Now.
Once the server is created, note the IP address. You will need it in the next steps.
Step 2 - Install CloudPanel
CloudPanel is a free, lightweight server control panel that makes managing WordPress sites on a VPS simple. It handles Nginx, PHP-FPM, MySQL, and SSL certificates for you.
- SSH into your new server:
ssh root@YOUR-SERVER-IP - Install CloudPanel with the official one-liner. Check the CloudPanel installation docs for the latest command. It typically looks like this:
curl -sSL https://installer.cloudpanel.io/ce/v2/install.sh | sudo bash - Wait a few minutes for the installation to complete.
- Access CloudPanel at
https://YOUR-SERVER-IP:8443in your browser. - Create your admin account with a strong password.
That is it. Your server is now ready to host WordPress sites.
Step 3 - Create Your WordPress Site in CloudPanel
With CloudPanel installed, setting up a new WordPress site takes about 30 seconds.
- In CloudPanel, click Add Site and select WordPress.
- Enter your domain name (e.g.
yourdomain.com). - Choose a PHP version (8.2 or 8.3 recommended).
- Click Create.
CloudPanel will automatically:
- Create a MySQL database and user
- Configure Nginx with optimized settings for WordPress
- Set up a PHP-FPM pool
- Install WordPress
Make a note of the database credentials that CloudPanel generates. You will need them if you are doing a manual migration.
Step 4 - Export Your WordPress Data
Now you need to get your existing WordPress data off the old shared hosting server. There are two approaches.
Option A: Use a Migration Plugin (Recommended for Beginners)
This is the easiest method. Install one of these plugins on your old WordPress site:
- UpdraftPlus - great for backup and restore workflows
- All-in-One WP Migration - single-file export, very simple
- Duplicator - creates a complete site package with installer
Export your entire site using the plugin. Download the backup file to your computer.
Option B: Manual Export (More Control)
If you prefer doing things manually or your site is too large for plugin-based migration:
- Export your database: Log into cPanel on your old host, open phpMyAdmin, select your WordPress database, and click Export. Choose SQL format and download the file.
- Download your files: Connect to your old host via FTP or SFTP and download the entire
wp-contentfolder. This contains your themes, plugins, uploads, and other custom files.
Option A is faster and less error-prone. Option B gives you more control and works better for very large sites.
Step 5 - Import to Your New Server
If You Used a Migration Plugin
- Log into the fresh WordPress installation on your new server (use the server IP or a temporary URL).
- Install the same migration plugin you used for the export.
- Use the plugin's import/restore function to upload your backup file.
- The plugin will handle the database, files, and URL replacements automatically.
If You Did a Manual Export
- Import the database: Open phpMyAdmin in CloudPanel, select the database that was created for your site, and import your SQL file.
- Upload files: Connect to your new server via SFTP and upload the
wp-contentfolder to your WordPress installation directory, replacing the default one. - Update wp-config.php: Make sure the database name, username, and password in
wp-config.phpmatch the credentials CloudPanel generated. - Run search-replace: If your domain is changing or you are moving from HTTP to HTTPS, use WP-CLI to update all URLs in the database:
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables
WP-CLI comes pre-installed with CloudPanel's WordPress setup, so you can run this command directly on the server.
Step 6 - Update DNS
Your site is now running on the new server, but your domain still points to the old one. Time to fix that.
- Log into your domain registrar (Namecheap, Cloudflare, GoDaddy, or wherever you manage DNS).
- Find the DNS settings for your domain.
- Update the A record to point to your Hetzner server's IP address.
- If you have a
wwwsubdomain, update that A record or CNAME as well. - Set the TTL (Time to Live) as low as possible before migrating. A 300-second TTL means DNS changes propagate within 5 minutes.
Once DNS propagates, CloudPanel will automatically provision a free SSL certificate via Let's Encrypt. This usually happens within minutes.
Pro tip: Lower your TTL a day or two before the migration so the old, longer TTL has time to expire. This makes the actual switchover much faster.
Step 7 - Post-Migration Checklist
Your site is live on the new server. Before you call it done, run through this checklist:
- Browse every page and verify content loads correctly.
- Check images and media files. Missing images usually mean the
wp-content/uploadsfolder was not transferred completely. - Test contact forms and any plugins that send email. You may need to configure SMTP settings on the new server.
- Set up automated backups. CloudPanel has built-in backup scheduling. Configure daily backups and keep at least 7 days of history.
- Enable caching. Install OPcache (usually enabled by default) and consider Redis for object caching on high-traffic sites.
- Update hardcoded URLs. Search your theme files and plugin settings for any references to the old domain or old server paths.
- Test on mobile. Make sure responsive layouts and mobile-specific features work as expected.
- Verify SSL. Check that HTTPS works correctly and there are no mixed-content warnings.
Performance Comparison
The difference after migrating is dramatic. Here is what you can typically expect:
- Before (shared hosting): Server response times of 800ms to 4 seconds. Slow admin dashboard. Occasional timeouts during traffic spikes.
- After (Hetzner CX22): Server response times under 200ms. Snappy admin experience. Consistent performance regardless of traffic.
These are not theoretical numbers. On shared hosting, you compete with hundreds of other sites for the same CPU and RAM. On a Hetzner VPS, those resources are yours. The CX22 plan at roughly 4 EUR per month often outperforms shared hosting plans that cost three to four times as much.
Page load times drop. Core Web Vitals improve. Your visitors get a faster experience, and search engines notice.
Wrapping Up
That is the entire process. In under an hour, you have gone from a sluggish shared hosting environment to a fast, affordable VPS that you fully control. The Hetzner CX22 with CloudPanel is a powerful combination - modern infrastructure at a fraction of the cost of traditional managed hosting.
The migration itself is straightforward. The hardest part is usually waiting for DNS to propagate. Everything else is just following the steps, and now you have a server that can grow with your projects.
If you have not read it yet, check out our companion article on why you should ditch cPanel and switch to Hetzner for the full breakdown of costs and benefits.