Back to Blog
Guide8 min read2026-05-01

Migrating from Shared Hosting to Cloud: Complete Guide

Everything you need to know to move your site or app from a shared hosting provider to a modern cloud PaaS — without losing traffic or data.

Migrating from Shared Hosting to Cloud: Complete Guide

Shared hosting made the web accessible, but it has real ceilings: limited CPU, no custom runtimes, no background workers, and one bad neighbor can throttle your entire site. Moving to a cloud PaaS gives you isolated containers, autoscaling, and proper CI/CD — without needing to manage servers yourself. This guide covers the full migration journey from shared hosting to the cloud.

Understanding What You're Leaving Behind

Shared hosting environments typically give you:

  • PHP and MySQL via cPanel/Plesk
  • FTP or SFTP file access
  • A public_html directory as your web root
  • Shared server resources with other customers
  • Limited or no SSH access
  • No ability to run background processes

Moving to a cloud PaaS means you gain full control over your runtime, the ability to deploy any Docker container, proper environment variables, and git-driven deployments.

Step 1: Audit Your Current Stack

Before migrating, understand exactly what you're running:

# On shared hosting via SSH (if available)
php --version
mysql --version

# Check which PHP extensions your app uses
php -m | sort

# List files larger than 10MB that might need special handling
find public_html -size +10M -type f

Document your PHP version, MySQL version, and any Apache/Nginx configuration (like .htaccess rewrites) that your app depends on.

Step 2: Export Your Database

This is the most critical step. Log into phpMyAdmin or use SSH:

# Via SSH on shared host
mysqldump   --host=localhost   --user=your_db_user   --password   --single-transaction   --routines   --triggers   your_database_name > database-backup.sql

# Verify the export has data
wc -l database-backup.sql
grep -c "INSERT INTO" database-backup.sql

Download database-backup.sql to your local machine via SFTP. This is your safety net — keep it in a secure location.

Step 3: Download Your Application Files

# Sync files from shared host to local machine
rsync -avz --progress   user@yourhost.com:~/public_html/   ./my-app/

# Or use scp
scp -r user@yourhost.com:~/public_html ./my-app

Once local, initialize a git repository so you can connect to GitHub (required for PandaStack deployments):

cd my-app
git init
git add .
git commit -m "Initial commit: migrated from shared hosting"
gh repo create my-app --public --source=. --push

Step 4: Write a Dockerfile for Your App

Shared hosting usually runs PHP. Here's a Dockerfile that replicates a typical LAMP-style setup:

FROM php:8.2-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli

COPY . /var/www/html/
RUN chown -R www-data:www-data /var/www/html

EXPOSE 80

For WordPress specifically, use the official image as a base and add your theme/plugins:

FROM wordpress:6.5-apache
COPY wp-content/ /var/www/html/wp-content/

Note: For managed WordPress, PandaStack offers a built-in managed WordPress deployment that handles updates, backups, and scaling — no Dockerfile needed.

Step 5: Provision a MySQL Database on PandaStack

Navigate to [dashboard.pandastack.io](https://dashboard.pandastack.io) → DatabasesCreate MySQL. PandaStack supports MySQL, PostgreSQL, Redis, and MongoDB. After creation, import your backup:

# Import your shared hosting database backup
mysql   --host=your-pandastack-db-host   --user=pandastack_user   --password   --ssl-mode=REQUIRED   pandastack_db < database-backup.sql

# Verify tables imported correctly
mysql -h your-pandastack-db-host -u pandastack_user -p pandastack_db   -e "SHOW TABLES; SELECT COUNT(*) FROM your_main_table;"

Step 6: Deploy via GitHub

Push your Dockerfile to GitHub, then connect it to PandaStack:

npm install -g @pandastack/cli
panda login
panda init

# Configure environment variables (never hardcode credentials)
panda env set DB_HOST=your-pandastack-db-host
panda env set DB_NAME=pandastack_db
panda env set DB_USER=pandastack_user
panda env set DB_PASS=your-secure-password

PandaStack auto-deploys on every push to your connected GitHub branch, so updates are as simple as git push.

Step 7: Test Everything Before Going Live

# Test your new deployment URL
curl -I https://your-app.pandastack.io
curl https://your-app.pandastack.io/health

# Check database connectivity from the app
curl https://your-app.pandastack.io/api/db-check

Step 8: Update DNS

Once verified, log into your domain registrar and update your A or CNAME records to point to PandaStack. Keep your old shared hosting active for 24-48 hours during DNS propagation in case you need to roll back.

The cloud gives your app room to breathe. You'll gain faster deployments, isolated resources, and a workflow that scales with your team. See [docs.pandastack.io](https://docs.pandastack.io) for the full platform reference.

Ready to deploy?

Start free on PandaStack — no credit card required.

Start free on PandaStack

More in Guide

Browse all Guide articles →

See also