Or copy link
Managing your web projects becomes significantly easier when you integrate Git Version Control directly into your cPanel. Whether you are working with an open-source public repo or a secure private project, this guide will walk you through the setup process step-by-step.
Connecting a public repository is straightforward because it doesn’t require complex authentication.
Step 1: Go to your GitHub repository and copy the HTTPS link.
Step 2: Log in to your cPanel and search for the Git™ Version Control tool.
Step 3: Click on Create.
Step 4: In the “Clone URL” box, paste the HTTPS link you copied. The remaining fields (File Path and Name) will auto-populate.
Step 5: Click Create, and your repository is now linked!
Since private repositories require permission, we use SSH Keys to establish a secure connection between cPanel and GitHub.
Open the Terminal in your cPanel.
Run the following command to generate a new key:
ssh-keygen -t rsa -b 4096
Press Enter to save it in the default location. When asked for a passphrase, leave it blank and press Enter again.
To view your public key, run (replace username with your cPanel username):
username
cat /home/username/.ssh/id_rsa.pub
Copy the entire output (the key starting with ssh-rsa).
ssh-rsa
Log in to your GitHub account.
Go to Settings > SSH and GPG keys.
Click New SSH Key, give it a title (e.g., “My cPanel Server”), and paste your key into the box. Save it.
Go back to your cPanel Terminal and run these commands to ensure cPanel knows how to use the key for GitHub:
touch ~/.ssh/config chmod 600 ~/.ssh/config nano ~/.ssh/config
Inside the editor, paste the following configuration:
Host github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes
Press Ctrl+O, Enter, then Ctrl+X to save and exit.
Ctrl+O
Enter
Ctrl+X
Set the correct permissions for security:
chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub
Test the connection by running:
ssh -T [email protected]
If successful, you will see a “Hi [Username]! You’ve successfully authenticated” message.
Now that the “handshake” is established:
Go to GitHub and copy the SSH Link (not HTTPS) of your private repo.
In cPanel Git™ Version Control, click Create.
Paste the SSH Link in the Clone URL box.
Click Create.
Congratulations! Your private Git repository is now synced with your cPanel hosting.
If you are trying to install or manage an SSL certifica...
If you use MySQL or MariaDB, you might have encountered...
Why Amar Hoster Best in Bangladesh? If you are a busin...
Save my name, email, and website in this browser for the next time I comment.