How to Deploy a Website Using Git in Plesk
Plesk allows you to connect to a Git repository and deploy your code automatically or manually to your website directory.
Step 1: Log in to Plesk
Open:
https://your-server-ip:8443
Log in with your admin or domain credentials.
Step 2: Go to Websites & Domains
-
Select your domain
-
Click Git from the list of tools
If you don't see it, go to Extensions > Git and install it
Step 3: Add a Git Repository
Click Add Git Repository, then choose one of the following:
Option 1: Remote Git Repository (e.g., GitHub, GitLab)
-
Set Repository URL (e.g.,
https://github.com/youruser/yourproject.git
) -
Choose Deployment Mode:
-
Automatic Deployment — deploy every time code is pushed
-
Manual Deployment — deploy only when you click “Pull”
-
-
Select the Target Directory (usually
/httpdocs
)
Option 2: Local Git Repository on Server
You can also initialize a bare Git repo in Plesk and push to it from your local computer.
Step 4: Set Up Webhook (for Auto-Deployment, GitHub)
If you use automatic deployment, set up a webhook:
-
Go to GitHub > Repository Settings > Webhooks
-
Add a new webhook with this URL:
https://yourdomain.com/modules/git/public/web-hook.php?uuid=XXXX
Replace the
uuid=XXXX
with your actual UUID from the Plesk Git settings.
Step 5: Deploy or Pull Code
-
For manual deployment, click Pull Updates in the Git interface
-
Files will be copied to your selected directory (e.g.,
/httpdocs
)
Step 6: Test Your Website
Visit your site to confirm the latest version is deployed:
https://yourdomain.com
Optional: Use Git Branches
-
Plesk supports specific branch deployment
-
In the Git settings, select the branch (e.g.,
main
,production
,dev
) -
You can switch branches and redeploy as needed
Summary
Task | Action |
---|---|
Connect Git | Add repository in Git module |
Auto-deploy | Enable auto mode + Git webhook |
Manual deploy | Click "Pull Updates" |
Repo location | Remote (GitHub/GitLab) or Local |
Deployment folder | Set to /httpdocs or custom path |