Amar Host Helpdesk Amar Host Helpdesk
  • Helpdesk Article
  • Forums
My Account
Amar Host Helpdesk Amar Host Helpdesk
My Account
  • Helpdesk Article
  • Forums
  • banner shape
  • banner shape
  • plus icon
  • plus icon

How to Connect GitHub Repositories to cPanel: Public & Private Guide

Updated on February 14, 2026
3 minutes
Hosting,cPanel
Share

How to Connect GitHub Repositories to cPanel: Public & Private Guide

Or copy link

Clipboard Icon
66 Views

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.

1. Connecting a Public Repository

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.

How to Connect GitHub Repositories to cPanel

  • 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!

How to Connect GitHub Repositories to cPanel

2. Connecting a Private Repository (SSH Method)

Since private repositories require permission, we use SSH Keys to establish a secure connection between cPanel and GitHub.

Phase A: Generate SSH Keys in cPanel

  1. Open the Terminal in your cPanel.

  2. Run the following command to generate a new key:

    Bash

    ssh-keygen -t rsa -b 4096
    
  3. Press Enter to save it in the default location. When asked for a passphrase, leave it blank and press Enter again.

  4. To view your public key, run (replace username with your cPanel username):

    Bash

    cat /home/username/.ssh/id_rsa.pub
    
  5. Copy the entire output (the key starting with ssh-rsa).

How to Connect GitHub Repositories to cPanel

Phase B: Add the Key to GitHub

  1. Log in to your GitHub account.

  2. Go to Settings > SSH and GPG keys.

  3. Click New SSH Key, give it a title (e.g., “My cPanel Server”), and paste your key into the box. Save it.

Phase C: Configure the SSH Connection

Go back to your cPanel Terminal and run these commands to ensure cPanel knows how to use the key for GitHub:

Bash

touch ~/.ssh/config
chmod 600 ~/.ssh/config
nano ~/.ssh/config

Inside the editor, paste the following configuration:

Plaintext

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.

Phase D: Final Permissions & Testing

Set the correct permissions for security:

Bash

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub

Test the connection by running:

Bash

ssh -T [email protected]

If successful, you will see a “Hi [Username]! You’ve successfully authenticated” message.

3. Final Step: Clone the Private Repo

Now that the “handshake” is established:

  1. Go to GitHub and copy the SSH Link (not HTTPS) of your private repo.

  2. In cPanel Git™ Version Control, click Create.

How to Connect GitHub Repositories to cPanel

  1. Paste the SSH Link in the Clone URL box.

  2. Click Create.

Congratulations! Your private Git repository is now synced with your cPanel hosting.

Tags : cPanel github

Related Post

7 minutes cPanel

7 cPanel Settings You Must Change Right Now F

7 cPanel Settings You Must Change Right Now For 3X Fast...

6 minutes Hosting

Why Amar Hoster Best in Bangladesh?

Why Amar Hoster Best in Bangladesh? If you are a busin...

7 minutes cPanel

cPanel Essential Guide: Master Web Hosting Ma

cPanel Essential Guide: Master Web Hosting Management w...

Leave a Comment Cancel reply

Recent Posts

How to Connect GitHub Repositories to cPanel: Public & Private Guide
3 minutes February 14, 2026
SMTP Integration Guide with AmarHost
4 minutes January 19, 2026
How to Access Amarhost Shared Hosting via SSH using PuTTY
3 minutes January 19, 2026
VIP Member at AmarHost
Become a VIP Member at AmarHost and Unlock Exclusive Deals & Discounts
3 minutes January 9, 2026

Recent Comments

    Categories

    • AlmaLinux
    • Cloudflare
    • cPanel
    • Domain
    • Domain Guide
    • Getting Started
    • Hosting
    • Hosting Guide
    • Hosting Offer
    • Laravel
    • Script
    • Server
    • Server Guide
    • SMTP
    • Website & Apps
    • Webuzo
    • WHM
    • WordPress

    Tags

    .COM Domain Affordable Domains Affordable Pricing AlmaLinux Amar Hoster Buy .COM CDN Cheap Domains Cloudflare Cloudflare tutorial cPanel cPanel Email database DNS setup Domain Names Domain Registration Domain Transfer Email Configuration Email Deliverability Hosting Provider https://www.amar.host/affordable-com-domain-registration-starting-at-1099-tk-with-amar-hoster/ Installation guide Local Hosting PHPMailer Port 465 Port 587 Register Domain security Server setup setup guide SMTP Settings SPF and DKIM SSD Hosting SSL TLD Registration Transactional Email VPS hosting Web Hosting Web Hosting Guide website performance website security website speed whm WordPress SMTP WP Mail SMTP
    April 2026
    SMTWTFS
     1234
    567891011
    12131415161718
    19202122232425
    2627282930 
    « Feb    
    Leaf Illustration

    © 2025 All Rights Reserved by Amar Host