Skip to main content
If your website’s code lives in a Git repository, you can pull it straight into your HostCloud hosting instead of uploading files by hand. This guide shows you how with Git Version Control in cPanel.
This guide is for developers. If you just want to upload files, see Upload files with File Manager or FTP.

Step 1: Let your hosting read the repository

Public repository: skip this step. Private repository: your hosting needs an SSH key that your Git service trusts.
1

Create a key in cPanel

Create an SSH key without a passphrase in SSH Access, and authorise it. See Use Terminal and SSH.
2

Add it to your Git service

Copy the public key and add it to your repository as a read-only deploy key, in your Git service’s repository settings.

Step 2: Clone the repository

1

Open Git Version Control

Log in to cPanel, type Git Version Control in the Search Tools box and open it. Click Create.
2

Enter the clone URL

Turn on cloning and paste the repository’s clone URL. Use the SSH form (git@github.com:you/repo.git) for a private repository.
3

Choose the folder

Enter a repository path, for example repositories/mysite. Keep it outside public_html, so your Git files aren’t visible on the web.
4

Create

Give it a name and click Create. cPanel clones the repository.

Step 3: Publish to your website

cPanel copies files to your website using a file called .cpanel.yml in the top folder of your repository. Add one like this, replacing cpanelusername with your cPanel username:
This example copies everything in the repository’s public folder to public_html. Change the folder names to match your project. Commit and push the file.
Deploying overwrites files with the same names in the target folder. Take a backup before your first deploy, especially if public_html already has a website.

Update your site

1

Push your changes

Commit and push to your Git service as usual.
2

Pull them into your hosting

In Git Version Control, click Manage next to your repository, open the Pull or Deploy tab and click Update from Remote.
3

Deploy

Click Deploy HEAD Commit. cPanel runs the tasks in .cpanel.yml.
You can also run git pull and your own build steps in cPanel’s Terminal. See Use Terminal and SSH.
Still stuck? Open a ticket with your domain name and the error shown in Git Version Control.