If you manage your code in GitHub or GitLab, you can use Plesk's Git extension to continuously deploy your updates to the server without needing FTP.
Connecting a Git Repository
- Go to Websites & Domains and click the Git button.
- Select your repository type (Local if you want to push to Plesk, or Remote if you want Plesk to pull from GitHub/GitLab). For this example, choose Remote.
- Paste the Clone URL of your repository (e.g., `git@github.com:youruser/yourrepo.git`).
- If your repository is private, Plesk will generate an SSH Public Key. You MUST copy this key and add it to your GitHub/GitLab Deployment Keys in order to grant Plesk read access!
- Select the branch to deploy (usually `main` or `master`).
- Click OK.
Enabling Auto-Deployment via Webhooks
You don't want to click a button in Plesk manually every time you push code! After setting up the repository in Plesk, go to the Repository Settings. You will see a Webhook URL.
Copy this URL, log into GitHub, go to your repository's Settings > Webhooks, and add it. Now, every time you run `git push`, GitHub will ping Plesk, and Plesk will instantly pull the latest code and deploy it to your `httpdocs` directory!