Get a free website with any plan

See how
APPLICATIONS

Deploying from GitHub with cPanel Git Version Control

Last updated

IN SHORT

Deploying from GitHub on Flashcloud shared plans uses cPanel Git Version Control on a pull-only setup. cPanel pulls commits over HTTPS from a public repository to the server. To move files into your live document root, you must include a valid .cpanel.yml file in your repository root and manually trigger deployment in cPanel.

Git deployment on Flashcloud shared plans works on a pull-only model. Because shell access is turned off on the Start plan, the server does not give you an incoming Git clone URL, and you cannot run git push directly to your hosting account from your local machine. Instead, cPanel pulls commits over HTTPS from a public GitHub repository down to the server.

To put files live, you must include a valid .cpanel.yml file in your repository root, commit your finished production files, pull the changes in cPanel, and click the deployment trigger. This guide covers how to set up this workflow and avoid common deployment failures.

The pull-only workflow and built assets

The Git integration in cPanel acts as a remote working copy, not a continuous integration pipeline. The server does not run build scripts such as npm run build, composer install, or static site bundlers when you pull code. It strictly moves repository files into your working folders.

If your project relies on compiled assets (such as React, Vite, Vue, or Hugo), you must build your production assets locally or in GitHub Actions before deploying. Commit the built output directly to your branch, or push the compiled files to a dedicated release branch on GitHub. What you pull into cPanel must already be servable by LiteSpeed.

For more architectural context on hosting repositories, see our guide to Git Version Control in cPanel: create and clone repos and the broader overview of Deploying with Git.

Set up .cpanel.yml in your repository

cPanel uses a YAML file named .cpanel.yml located in the root of your repository to understand where your files should go. Without this file, cPanel will download your commits into a storage directory on the server, but it will never copy them to the web root where visitors can see them.

Create a file named .cpanel.yml in your repository root. The syntax must look like this:

---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp index.html $DEPLOYPATH
    - /bin/cp -R css/ $DEPLOYPATH
    - /bin/cp -R js/ $DEPLOYPATH

Replace username with your actual cPanel username. Adjust the target path based on the domain you are deploying:

  • Main website: The web root is /home/username/public_html/.
  • Subdomains: On Flashcloud, a subdomain document root is located at /home/username/subdomain/ (a folder sitting next to public_html, not inside it).

You can also copy an entire folder of built files. For example, if your repository contains a production folder named dist/, your tasks can copy the contents of that folder straight to your deployment path:

---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R dist/* $DEPLOYPATH

Commit this file to GitHub. The branch must stay clean. If there are syntax errors or missing paths in .cpanel.yml, the deployment action in cPanel will fail.

Clone your GitHub repo in cPanel

Once your repository contains your site files and .cpanel.yml, clone it through the cPanel interface:

  1. Log in to the Flashcloud portal at portal.flashcloud.com.
  2. Navigate to Services, select your hosting plan, and click the cPanel one-click login tile.
  3. Under the Files section, open Git Version Control. (If you use the Meridian theme, you can use the top search bar to open it).
  4. Click the Create button on the right.
  5. Leave the Clone a Repository toggle enabled.
  6. Paste the HTTPS URL of your public GitHub repository into the Clone URL field (for example, https://github.com/account/project.git).
  7. The form automatically fills the Repository Path and Repository Name fields based on the URL. Leave the repository path outside of your public directory (for example, repositories/project). Storing the repository outside the document root ensures your Git history, configuration files, and .cpanel.yml are never exposed over the web.
  8. Click Create.

cPanel will clone the repository from GitHub into the designated server directory. Small repositories land in moments; large ones take longer, and the list refreshes when the clone is done.

Pull updates and trigger deployment

Because the server does not listen for incoming pushes, you must update your files whenever you push a new commit to GitHub:

  1. Open Git Version Control in cPanel.
  2. Find your repository in the list and click Manage.
  3. Switch to the Pull or Deploy tab.
  4. Under the Update from Remote heading, click Update from Remote. This pulls the latest commits from your GitHub branch into the repository copy on the server.
  5. Once the pull completes successfully, scroll to the Deploy HEAD Commit heading and click Deploy HEAD Commit.

Clicking Deploy HEAD Commit executes the commands listed in your .cpanel.yml file. If the file is valid, your latest assets will copy into your document root immediately.

Troubleshooting deployment issues

If your files do not update on the live site, check these points:

  • Disabled "Deploy HEAD Commit" button: cPanel disables this button if it cannot find .cpanel.yml in the root of the pulled branch, or if there is a syntax error in the YAML formatting. Verify that your YAML indentation uses standard spaces, not tabs.
  • Uncommitted changes: The "Deploy HEAD Commit" action requires a clean branch. If server-side processes edited or created untracked files in the repository path, cPanel will prevent updates to avoid overwriting them.
  • Wrong destination path: Confirm whether you deployed to public_html/ or a subdomain directory. Remember that subdomains sit parallel to public_html, not inside it.
  • Private repositories: Without shell access on shared plans, cPanel cannot establish SSH authentication prompts for private repositories. The clone URL must be public over HTTPS.
  • LiteSpeed caching: If files copied successfully but your browser shows older content, open your portal dashboard, go to Services, and review your caching settings, or purge the cache through your application.

If the deployment log reports command errors that you cannot resolve, open a ticket through the portal by going to Support → New ticket. Our support team can review file permissions and help identify path issues on your account.

Common questions

Can I run git push directly to my Flashcloud account?

No. Flashcloud shared plans use a pull-only workflow, and shell access is disabled on the Start plan. You must push your code to GitHub first, then pull the commits into cPanel over HTTPS.

Why is the Deploy HEAD Commit button disabled in cPanel?

Your repository lacks a valid .cpanel.yml file in its root or has YAML syntax errors. The button also locks if untracked changes exist on the server copy. Ensure your file uses space indentation and the pulled branch remains clean.

Will cPanel run npm build or install my project dependencies?

No. The cPanel Git tool does not run build scripts or dependency installers like npm or composer. You must build your production files locally or with GitHub Actions and commit the compiled assets before pulling.

Can I clone a private GitHub repository?

No. Shared plans without shell access cannot handle SSH prompts for private repositories. You must use a public GitHub repository clone URL over HTTPS.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.