Docroot-based PHP Deploy (CloudPanel)

Create the PHP site once in CloudPanel, then use this panel or Git Bash to deploy/update your project ZIP into its document root.

How to deploy a new domain + ZIP (UI method)

  1. CloudPanel → Sites → Add Site → Create a PHP Site.
    Application: Generic, set your Domain (e.g. laptop.myvpspanels.cloud) and PHP version (e.g. 8.2).
  2. After site is created, open its Settings in CloudPanel and note:
    Domain
    Document Root (e.g. /home/myvpspanels-laptop/htdocs/laptop.myvpspanels.cloud)
    Site User / Linux User (e.g. myvpspanels-laptop)
  3. Open this deploy panel (index.php on your admin subdomain). Fill these fields exactly as in CloudPanel:
    Domain
    Document Root Path
    Linux User
    (Use the Copy/Paste buttons for safety.)
  4. Choose how to provide your project ZIP:
    Upload ZIP → select file from your PC (e.g. laptops.zip)
    Existing ZIP Path → type a name like laptops.zip (inside docroot) or full path like
    /home/myvpspanels-laptop/htdocs/laptop.myvpspanels.cloud/laptops.zip
  5. Enable options as per project:
    Clean docroot before deployment → for fresh deploy
    Install Let's Encrypt SSL → if DNS already points to this server
    Run Composer → for Laravel / heavy PHP apps
    Apply Nginx profile rules → for pretty URLs (hide .php, etc.)
  6. Click Deploy Website. Logs on the right will show every step (clean, unzip, chown, SSL, Nginx reload). On success, final line will be: 🎉 Deployment completed successfully! Visit: https://your-domain
  7. Finally, open your site in browser:
    https://laptop.myvpspanels.cloud

How to deploy from local (Git Bash script)

If you prefer deploying directly from your Windows PC using Git Bash, use deploy-from-local.sh.

  1. Place your ZIP on Desktop, e.g.
    /c/Users/NKM/OneDrive/Desktop/laptops.zip
  2. Make sure CloudPanel site already exists (same steps as left card: Add Site, note docroot + user).
  3. In Git Bash:
    cd "/c/Users/NKM/OneDrive/Desktop"
    
    ./deploy-from-local.sh \
      laptop.myvpspanels.cloud \
      /home/myvpspanels-laptop/htdocs/laptop.myvpspanels.cloud \
      laptops.zip
  4. The script will:
    • Upload laptops.zip to /root/ on the VPS
    • Call /root/deploy-docroot.sh with domain + docroot + ZIP
    • Clean docroot, unzip project, fix permissions, install SSL, and inject Nginx pretty URL profile
  5. When you see this in Git Bash:
    == 🎉 Done → Visit: https://laptop.myvpspanels.cloud ==
    your new PHP site is live.

Pattern for any new domain:
1) Create PHP site in CloudPanel → get DOMAIN, DOCROOT, Linux User
2) Create/update ZIP
3) Run deploy-from-local.sh DOMAIN DOCROOT ZIP or use the UI form on the left.

Deployment Settings

Ready

Must match the domain configured in CloudPanel (and DNS pointing to this server).

Exact docroot of this site as configured in CloudPanel.

Owner of files (CloudPanel Linux user).

For your laptop project, choose Laptop Project (PHP) or Simple PHP.

Project ZIP

Example: laptops.zip

Options

Deployment Logs

No logs yet. Follow the instructions above, fill the form on the left and click Deploy Website.
Tip: Use this panel internally only (IP allowlist, HTTP auth, or VPN).