Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Use Git With Plesk

This guide shows how to connect a Git repository to your website in Plesk, so your code can be pulled onto the server.

Plesk2 min read13 steps5 screenshots

What is Git?

Git is a tool that keeps track of changes in your code. A repository, or repo, is the project folder Git watches. Sites like GitHub and GitLab store repos online. With Git, you can update your website by pulling the newest code, instead of uploading files by hand.

Not every Plesk server has the Git extension. If you do not see it, ask Hostvento support whether it is on your plan.

Steps

  1. Log in to Plesk.
  2. Click Websites & Domains and find your domain.
    Git 1
  3. Click Git.
  4. Click Add Repository.
    Git 3
    Git 4
    Git 5
  5. Choose Remote Git hosting if your code lives on a site like GitHub.
  6. Paste the repository address into Repository URL. It looks like git@github.com:name/project.git or https://github.com/name/project.git.
  7. Plesk shows a public SSH key for private repositories. An SSH key is a long text that works like a secret ID card. Copy it and add it to your GitHub or GitLab account under its deploy keys or SSH keys settings.
  8. Choose the Deployment mode. Automatic means Plesk updates the site when you push new code. Manual means you pull it yourself.
  9. Set the Server path, which is the folder where the code will go. For a normal site, this is httpdocs.
  10. Click OK. Plesk pulls the code.
  11. Open your website to check it.

Update the site later

  1. Go back to the Git page for your domain.
  2. Click Pull Updates beside the repository.

Warning: If the server path already holds files, they may clash with the code. Take a backup first. Use an empty folder where you can.

Tip: For automatic deploys, copy the webhook address Plesk shows. Add it to your GitHub repo's webhook settings. Then each push updates your site.

Quick recap

  • Git tracks code. Plesk can pull it onto your site.
  • Use Websites & Domains, then Git, then Add Repository.
    Git 6
  • Add Plesk's SSH key to your Git host for private repos.
  • Use Pull Updates or a webhook to deploy changes.