Blog / Migration
Migrating cPanel, PHP, Node & Django Apps to the Cloud, Safely and Without Downtime
Outgrowing shared cPanel hosting is a good problem, until the migration goes sideways and takes your site down or leaves security holes wide open. Here is how to move PHP, Node and Django apps to the cloud, migrate the domain with zero downtime, and harden everything on the way.
1. Audit what cPanel is actually running
Before moving anything, list it all, this is where the surprises hide:
- Sites & stacks: WordPress/Laravel (PHP), Node apps, Python/Django apps, their versions.
- Databases: MySQL/MariaDB or Postgres, sizes and users.
- Cron jobs, mail, and SSL certs configured in cPanel.
- DNS records and the current TTLs.
2. Move the apps to a proper server or containers
Re-host onto a cloud VPS or containers, so each app runs cleanly instead of sharing one crowded box:
- PHP (WordPress/Laravel): Nginx + PHP-FPM, or a Docker image, with the right PHP version.
- Node.js: run under a process manager (PM2) or a container, behind Nginx as a reverse proxy.
- Python/Django: Gunicorn or Uvicorn behind Nginx, static files on S3/CDN, env-based settings.
# Nginx reverse proxy for a Node or Django app
server {
server_name app.example.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}3. Migrate the data
Dump databases (mysqldump / pg_dump), move uploads and media to the new server or S3, and keep a final sync for cut-over so nothing written in the last hour is lost.
4. Domain & DNS migration, with zero downtime
- Lower the DNS TTL (e.g. to 300s) a day before, so the switch propagates fast.
- Bring the new server up on a temporary hostname and test the sites fully.
- Issue TLS certificates (Let's Encrypt or ACM) on the new server before switching.
- Do a final data sync, then point the A/CNAME records to the new server.
- Keep the old host running until traffic has fully moved, rollback is just switching DNS back.
5. Close the vulnerabilities you inherited
Old shared hosting almost always carries security debt. Fix it as part of the move:
- Outdated runtimes: upgrade end-of-life PHP/Node/Python versions, they stop getting security patches.
- No or weak HTTPS: force TLS everywhere and redirect HTTP to HTTPS.
- Exposed admin panels: lock down phpMyAdmin, wp-admin and dashboards by IP or auth.
- SSH hardening: key-only login, no root, a firewall that opens only 80/443/22.
- Secrets in code: move DB passwords and API keys into environment variables or a secrets manager.
- Stale dependencies: update plugins and packages, and turn on automated patching.
A migration is the best time to fix security, you are touching everything anyway. Move and harden in one pass instead of promising to "clean it up later".
Key takeaways
- Audit every site, database, cron and DNS record before moving.
- Re-host PHP, Node and Django apps cleanly behind Nginx or in containers.
- Lower TTL, test on a temp host, issue TLS, then switch DNS, zero downtime.
- Keep the old host in sync so rollback is just a DNS change.
- Upgrade runtimes, enforce HTTPS, lock down panels and SSH, kill secrets in code.
Moving off cPanel or shared hosting?
I migrate PHP, Node and Django sites to the cloud, handle the domain and DNS cut-over with zero downtime, and harden security in the same pass. Book a free call and I'll plan it with you.
Get a free DevOps audit →