Deploying Your Project from GitHub with Git in Plesk
Learn how to connect a GitHub repository to your domain in Plesk. Many AI tools can save your project straight to GitHub, and Plesk can then copy it to your hosting account for you, so you do not have to upload files by hand each time.
Steps
- Log in to Plesk via your Zeniar Portal
- Select Websites & Domains from the left-hand menu
- Click Git under Dev Tools. If you have more than one domain, expand the domain you'd like to update first
- Click Add Repository
- Under Website files source, select Remote repository
- In Repository URL, paste the address of your GitHub repository. For a private repository, use the SSH address, which starts with git@github.com:
- For a private repository, copy the SSH public key that Plesk displays. In GitHub, open your repository, go to Settings, then Deploy keys, click Add deploy key and paste the key
- Set Deployment mode to Automatic
- Check that Deployment directory is the folder your website runs from, usually httpdocs
- Click Create
- Visit your domain in a web browser to check that your project loads
Important: Deploying replaces files in the deployment directory with the files from your repository. Back up anything in that folder you want to keep before you click Create.
Please note: When you make changes to your project in GitHub later, open Git in Plesk and click Pull now to bring the changes across.
Note: Do not add the deploy key with write access. Plesk only needs to read your repository.
Please note: Git is not included with WordPress hosting plans. If you cannot see Git under Dev Tools, your plan does not include it.
Your project is now deployed from your GitHub repository to your domain.
After Each Deployment
- If composer.json changed, install the dependencies again. See Installing PHP Dependencies with Composer in Plesk
- For Node.js projects, run NPM install and Restart App. See Building and Running a Node.js App in Plesk
- Keep passwords and API keys out of your repository. See Storing API Keys and Secrets Safely on Your Hosting