---
title: "How to Deploy Your Website from GitHub or GitLab on Plesk"
description: "Deploy your website from a GitHub or GitLab repository with the Plesk Git tool, public or private repository, deploy key, webhook and manual deployment."
category: cloud
subcategory: hebergement-web
icon: tabler:file-text
date: 2026-11-02
author: Winheberg
slug: "deploy-website-github-gitlab-plesk"
order: 156
image: /statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk.webp
tags: [Git, GitHub, GitLab, Plesk, Web Hosting]
keywords: [plesk git, deploy github, deploy gitlab, plesk webhook, deploy key, automatic deployment]
link_fr: "/docs/hebergement-web/deployer-site-github-gitlab-plesk"
---

## Context

If your website lives in a GitHub or GitLab repository, there is no need to upload your files over FTP after every change. Your [Winheberg web hosting](https://winheberg.com/en/cloud/web-hosting) can fetch the repository itself and deploy its content into your website folder, on demand or automatically on every `git push`.

Plesk handles this with a built-in Git tool. It clones the repository, keeps track of the latest commits and copies the files of the chosen branch to the folder of your choice.

This guide covers adding a public or private repository, choosing the deployment folder, automatic deployment by webhook, manual deployment and common errors.

> [!NOTE]
> The Winheberg Plesk panel is displayed in French. Menu, field and button names are quoted below exactly as they appear on screen, followed by their English meaning.

## Prerequisites

- A Winheberg web hosting plan with access to the Plesk panel
- A GitHub or GitLab repository that holds the files of your website, organised the way they must be on the hosting
- For a private repository, the right to edit the repository settings, to add a deploy key

> [!NOTE]
> Git deploys files. The database and the configuration files that hold your passwords, such as `.env` or `wp-config.php`, must be prepared on the hosting and must not be in the repository.

## 1. Open the Git tool

Open your domain from **Sites Web & Domaines** (*Websites & Domains*), then the **Tableau de bord** (*Dashboard*) tab. In the **Outils Dévelop.** (*Dev Tools*) section, click **Git**, then **Ajouter un dépôt** (*Add Repository*).

## 2. Enter the repository

In **Emplacement du code** (*Code location*), keep **Dépôt distant** (*Remote repository*), then paste the address of your repository into **URL du dépôt** (*Repository URL*). Plesk then suggests a **Nom du dépôt** (*Repository name*), which you can keep.

<img src="/statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk-1793621174749-88f69513fb51d9dd3326d95d.webp" alt="Create repository form of the Plesk Git tool" width="790" />

::MdTable{caption="Which address to use" variant="info" striped}
| Repository type | Address to paste | Access |
|---|---|---|
| Public | `https://github.com/account/project.git` | No setting |
| Private, by SSH key | `git@github.com:account/project.git` | Deploy key to add on GitHub or GitLab |
| Private, by HTTPS | `https://gitlab.com/account/project.git` | **Nom d'utilisateur** (*Username*) and access token in **Mot de passe** (*Password*) |
::

### Allow Plesk on a private repository

The safest method is the deploy key, which gives Plesk read-only access to this single repository. Paste the SSH address of the repository, Plesk then shows the **Contenu de la clé publique SSH** (*Public SSH key content*) field. Copy the whole key.

<img src="/statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk-1793621175101-e195b66951f584800ba82f9d.webp" alt="Public SSH key shown by Plesk for a private repository" width="800" />

- On GitHub, open your repository, then **Settings**, **Deploy keys** and **Add deploy key**. Paste the key and leave **Allow write access** unticked
- On GitLab, open your project, then **Settings**, **Repository** and **Deploy keys**. Paste the key and leave write access unticked

## 3. Choose the mode and the deployment folder

In **Paramètres de déploiement** (*Deployment settings*), choose the **Mode de déploiement** (*Deployment mode*).

<img src="/statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk-1793621176151-9b91aa2fa061f51731c75c06.webp" alt="Deployment mode and Server path in the Plesk Git form" width="800" />

::MdTable{caption="Deployment modes" variant="info" striped}
| Mode | Effect |
|---|---|
| **Automatique** (*Automatic*) | Files are deployed as soon as new commits reach Plesk |
| **Manuel** (*Manual*) | Files are only deployed when you click **Déployer maintenant** (*Deploy now*) |
| **Désactivé** (*Disabled*) | Plesk keeps the repository without copying anything to the website |
::

**Chemin serveur** (*Server path*) is the folder that receives the files. It defaults to `/httpdocs`, the folder of your main website.

> [!CAUTION]
> Deployment overwrites the files of the target folder that have the same name as those of the repository. For a first try, deploy to an empty folder or to a test subdomain, and back up your website before targeting `/httpdocs`, with our guide [How to Back Up and Restore Your Website on Plesk](https://winheberg.com/en/docs/hebergement-web/backup-restore-website-plesk)

Click **Créer** (*Create*). Plesk clones the repository and, in **Automatique** mode, deploys the main branch right away. The repository card then shows the branch, the latest commits and the action buttons.

<img src="/statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk-1793621175479-36682f87121d385af77bdfdf.webp" alt="Repository card in the Plesk Git tool with Pull Updates and Deploy Now" width="470" />

## 4. Deploy automatically on every push

For Plesk to fetch your commits as soon as you push, the service that hosts the repository must notify it, through a webhook.

On the repository card, click **Paramètres du dépôt** (*Repository settings*) and copy the **URL webhook** (*Webhook URL*). The **Branche du répertoire** (*Repository branch*) field shows the deployed branch, change it if your live website follows another branch than the main one.

<img src="/statics/images/docs/en/hebergement-web/deploy-website-github-gitlab-plesk-1793621175796-22c88cc01308993f93268fe0.webp" alt="Webhook URL and branch in the settings of a Plesk Git repository" width="800" />

- On GitHub, open **Settings**, then **Webhooks** and **Add webhook**. Paste the address into **Payload URL**, keep **Just the push event** and confirm with **Add webhook**
- On GitLab, open **Settings**, then **Webhooks** and **Add new webhook**. Paste the address into **URL**, tick **Push events** and save

Make a test commit and push it. A few seconds later, it shows up under **Derniers commits** (*Latest commits*) on the repository card in Plesk.

## 5. Deploy by hand

Without a webhook, or in **Manuel** mode, two buttons on the repository card are enough.

- **Exécuter pull** (*Pull updates*) fetches the latest commits from GitHub or GitLab
- **Déployer maintenant** (*Deploy now*) copies the fetched version to the **Chemin serveur**

## 6. Run commands after each deployment

In **Paramètres du dépôt**, the **Activer des actions de déploiement supplémentaires** (*Enable additional deployment actions*) box opens an **Actions de déploiement** (*Deployment actions*) field. Enter one command per line, Plesk runs them in the deployment folder after each deployment.

```bash
mkdir -p cache
rm -rf cache/*
```

> [!NOTE]
> These commands run in a restricted environment, without PHP, Composer or Node.js. Keep them for simple file operations. For PHP dependencies, use the **PHP Composer** tool of the **Tableau de bord**, or commit the `vendor` folder built on your computer.

## Troubleshooting

### ❌ Plesk cannot fetch the repository

Access to the repository is denied or the address is wrong.

- Check the address by opening it in your browser for a public repository
- For a private repository over SSH, check that the key shown by Plesk is listed in the **Deploy keys** of the repository
- For a private repository over HTTPS, use an access token and not your account password, GitHub and GitLab reject the latter

### ❌ The website does not change after a push

The webhook did not notify Plesk, or the deployment did not follow.

- On GitHub, open **Settings**, then **Webhooks** and **Recent Deliveries** to read the answer from Plesk
- Check that you push to the branch set in **Branche du répertoire**
- In **Manuel** mode, click **Déployer maintenant**
- Meanwhile, click **Exécuter pull** then **Déployer maintenant** to update the website

### ❌ The website shows an error after the deployment

The files are in place, but what does not go through Git is missing.

- Check that the configuration file exists on the hosting, for instance `.env` or `wp-config.php`
- Check that the dependencies, such as the `vendor` folder, are there
- Check that the **Chemin serveur** matches the website root, or its `public` subfolder for Laravel
- Read the exact message in the logs, with our guide [How to Read the Error Logs of Your Website on Plesk](https://winheberg.com/en/docs/hebergement-web/website-error-logs-plesk)

## Best practices

- Never commit your passwords, add `.env` and the configuration files to your `.gitignore`
- Prefer a read-only deploy key to your password or to a token that opens all your repositories
- Deploy to a test subdomain first, then to the live website
- Keep a branch for the live website, for instance `main`, and work on other branches

## Need help?

If Plesk cannot fetch your repository or if the deployment fails, open a ticket with our support from your [client area](https://billing.winheberg.com), **Technical** department, filling in the **Related Product** field with the web hosting concerned. Give the repository address, without token or password, and the error message shown.

One `git push`, and your website is up to date 🚀

