How to Deploy a Node.js App from GitHub Using cPanel’s Git Tool
cPanel's Git Version Control tool lets you clone your Node.js app straight from GitHub into your account and pull updates later — a cleaner workflow than uploading files by hand. Combined with Setup Node.js App, it makes deployment repeatable.
Step 1: Get your repository ready
Make sure your repo has a package.json, your startup file, and a .gitignore that excludes node_modules and any .env. For a private repo, you will need to set up access (such as a deploy key).
Step 2: Clone it in cPanel
- In cPanel, open Git Version Control — see using Git in cPanel.
- Click Create, enter your repository's clone URL, and set the target directory (your application root).
- cPanel clones the repository into that folder.
Step 3: Set up the Node app
In Setup Node.js App, point the application root at the cloned folder, set the startup file, choose your Node version, and install dependencies. Start the app.
Step 4: Pulling updates
When you push new code to GitHub, return to Git Version Control and Pull the latest changes. Then re-run NPM Install if dependencies changed, and restart the app (touching tmp/restart.txt works well in a deploy step).
Frequently asked questions
Does cPanel pull updates automatically?
By default you pull manually from the Git tool. Some setups support deployment on pull via a .cpanel.yml file, which can automate steps like restarting after an update.
Can I clone a private repository?
Yes, but you must set up authentication — typically a deploy key added to the repository — so cPanel is authorised to clone and pull. Public repos need no credentials.
Do I commit node_modules to the repo?
No — exclude it with .gitignore and run NPM Install on the server after cloning or pulling, so dependencies are built for the server.
Was this article helpful?