How to deploy a website from GitHub or GitLab with Git
On this page
Git Deployment copies a branch of your repository into a folder of your account — when you click a button, or automatically on every push. It works with GitHub, GitLab, Bitbucket and any Git server.
Connect a repository
- Log in to the control panel (
https://<server>:2083). - Open Git Deployment in the menu (section Files).
- Click Connect repository (the form is already open if you have none).
- Repository — the clone address, for example
[email protected]:me/site.git(private) orhttps://github.com/me/site.git(public). - Branch — default
main. - Deploy into (folder in your home) — default
public_html. The folder must be empty (a new domain's placeholderindex.htmlis fine), or already a clone of this repository. - After deploy, run (optional) — one command line, for example
composer install --no-dev && php artisan migrate --force. - Click Connect.
You see Repository connected. For a private repository, add the deploy key below to it, then Deploy.
Private repository: add the deploy key
- On the repository's card, click Copy next to Deploy key.
- In GitHub: repository → Settings → Deploy keys → Add deploy key. In GitLab: Settings → Repository → Deploy keys. Paste the key and leave write access off.
- Use the
git@…(SSH) address of the repository.
Deploy
Click Deploy now. The card shows Last deploy with the status, the commit and the time; the page refreshes while it runs. Open Output of the last deploy to see every step, including the output of your after-deploy command.
Deploy automatically on every push
- On the card, click Copy next to Auto deploy. The address looks like
https://server.example.com:2083/hooks/git/…. - In the repository settings, add a webhook with that address for push events (GitHub: Settings → Webhooks → Add webhook, content type does not matter).
Every push to any branch triggers a deploy of the configured branch.
Good to know
- The folder follows the repository exactly. Each deploy resets the folder to the latest commit of the branch: changed tracked files are overwritten and files that are not in the repository are deleted — except
.envand files listed in.gitignore. Keep uploads and settings in ignored files. - Up to 25 repositories per account, one per folder.
- Change the Branch or the after-deploy command on the card and click Save.
- Disconnect removes the connection; the deployed files stay.
Common questions
The deploy failed with "The folder is not empty". What can I do?
Move the files out of the folder with the File Manager, or choose an empty folder, then click Deploy now.
The deploy failed with "Permission denied (publickey)". Why?
The repository is private and the deploy key is not added to it, or you used an https:// address. Add the key and use the git@… address.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to run a Node.js, Python or Ruby application
Host an Express, Next.js, Flask, Django, FastAPI or Rails app on your domain: start command, $PORT, environment variables, dependencies and logs.
- How to add an SSH key and connect to your account with SSH
Create an ed25519 key, add the public key in SSH Access, and sign in with ssh or sftp. Explains SFTP-only plans and which key types are accepted.
- How to use the terminal in your browser (SSH without a client)
Open a command line for your hosting account in the browser with Terminal, what you can run there, and the time and session limits that apply.