How to Deploy from a GitHub Repository in cPanel Print

  • Updated on 15-Nov-2026
  • 0

How to Deploy from a GitHub Repository in cPanel

Can I deploy from GitHub on cPanel hosting? Yes. "Git Version Control" in cPanel copies (clones) your GitHub repository into your hosting account and brings in later changes with one button. A public repository needs nothing else. A private repository needs a deploy key, which takes a few minutes to set up.

Clone a public repository

  1. In cPanel open "Git Version Control" and click Create.
  2. Keep Clone a Repository switched on.
  3. Clone URL: your repository's address, for example https://github.com/yourname/yourapp.git.
  4. Repository Path and Repository Name are filled in for you, for example repositories/yourapp. Note the path: it is where your files will be.
  5. Click Create. cPanel clones the repository in the background; a small one is there within seconds.

If cPanel shows "Your system administrator must enable shell access to allow you to view clone URLs", you can ignore it. It concerns copying from your hosting account, not cloning from GitHub.

Clone a private repository

GitHub must be able to recognise your hosting account. That is done with a deploy key: an SSH key without a password. cPanel's own key generator always asks for a password, which Git cannot use, so create the key in the terminal:

  1. Ask us to enable SSH on your account. It is free and done within one working day: open a support ticket.
  2. Open "Terminal" in cPanel, or connect by SSH, and run:
    ssh-keygen -t ed25519 -N "" -C "deploy" -f ~/.ssh/id_ed25519 cat ~/.ssh/id_ed25519.pub
    The second command shows the public half of the key, one line that begins with ssh-ed25519. Copy that line.
  3. On GitHub open your repository, then Settings, Deploy keys, Add deploy key. Paste the line and save.
  4. In cPanel follow the steps for a public repository, but use the SSH form of the address as the Clone URL: [email protected]:yourname/yourapp.git.

cPanel accepts GitHub's host key by itself on the first clone.

Run the code as a Node.js app

Set the app up as in How to deploy a Node.js app in cPanel, and give the Repository Path, for example repositories/yourapp, as the Application root.

  • Keep node_modules out of the repository. cPanel installs the packages itself with Run NPM Install, and the install stops if that folder is present.
  • For Next.js, most repositories leave out the built .next folder, and the build does not run on shared hosting. Build on your computer and upload the .next folder into the same place. See How to deploy a Next.js app in cPanel.

Bring in later changes

  1. Push your changes to GitHub as usual.
  2. In cPanel open "Git Version Control", click Manage beside the repository, open the Pull or Deploy tab and click Update from Remote.
  3. For a Node.js app, open "Setup Node.js App" and click RESTART. If package.json changed, click Run NPM Install first.
Tested: on our cPanel servers on 13 and 15 November 2026: a public repository cloned over HTTPS and updated from the remote, a private repository cloned with a deploy key, and the key command run inside a hosting account.

Still stuck? Open a support ticket or start a live chat. See the plans on our Node.js hosting page.

Related: Fix the Git error "Not possible to fast-forward, aborting" and Terminal access in cPanel.


Was this answer helpful?

« Back