![]() |
|
Guide CyberPanel Git Deployment: Deploy from GitHub (and the Option That Deleted Our Site) - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel) +---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials) +----- Forum: CyberPanel Websites & OpenLiteSpeed Guides (https://adminsforum.com/Forum-cyberpanel-websites-openlitespeed-guides) +----- Thread: Guide CyberPanel Git Deployment: Deploy from GitHub (and the Option That Deleted Our Site) (/Thread-guide-cyberpanel-git-deployment-deploy-from-github-and-the-option-that-deleted-our-site) |
CyberPanel Git Deployment: Deploy from GitHub (and the Option That Deleted Our Site) - JAY - 10-26-2026 CyberPanel Git Deployment: Deploy from GitHub (and the Option That Deleted Our Site) Deploying from Git means your website's files come from a repository (GitHub, GitLab, Bitbucket) instead of FTP uploads. You push a change, the server pulls it, done. CyberPanel has a Manage Git page for this. We tested it on our test subdomain Code: blog.cyber.adminslab.comCode: octocat/Spoon-KnifeCode: index.htmlCode: styles.cssCode: README.mdStep 1: Open Manage Git Websites > List Websites > Manage (or List Child Domains > Manage for a subdomain), then Manage Git at the top. The address is Code: https://YOUR-SERVER-IP:8090/websites/yourdomain.com/manageGITPick the folder (for us Code: /home/cyber.adminslab.com/blogStep 2: Attach Existing Repo, and what went wrong The dialog asks for Git Host, Username (the repo owner) and Repo Name, and shows a Deployment Key (an SSH public key CyberPanel generates for the site user). In the dialog we filled in github.com, the owner and the repo name, and clicked Attach: First try: Code: fatal: destination path '/home/cyber.adminslab.com/blog' already exists and is not an empty directory.Code: index.htmlWith Override Data ticked we tried again: Second try: Code: [email protected]: Permission denied (publickey).Code: [email protected]:owner/repo.gitAnd then we looked at the server: The folder was gone. Override Data deleted the site's document root before cloning; the clone then failed, and nothing was put back. The subdomain answered 404 until we fixed it. So, before you use Attach Existing Repo:
Step 3: The simple way that worked: git clone over HTTPS For a public repo you don't need any key: clone over HTTPS from SSH. The target folder must not exist yet (or be empty), so move the old document root away first: Code: cd /home/yourdomain.com
mv public_html public_html.old
sudo -u SITEUSER git clone https://github.com/owner/repo.git public_htmlCode: sudo -u SITEUSERCode: cyber2602As the site user, from the parent folder of the document root: The site came back right away with the repo's Code: index.htmlCode: <title>Spoon-Knife</title>Two things we checked afterwards:
Step 4: Private repositories: the deploy key For a private repo, HTTPS needs a token. The cleaner way is the deploy key CyberPanel already made. It's the site user's SSH key: Code: cat /home/yourdomain.com/.ssh/SITEUSER.pubCode: /home/cyber.adminslab.com/.ssh/cyber2602.pubCode: sudo -u SITEUSER git clone [email protected]:owner/private-repo.git public_htmlStep 5: Deploy updates Once the folder is a Git repo, Manage Git recognises it no matter how it was cloned: our HTTPS clone showed up with its 3 commits and the buttons Pull, Push, Commit, Create New Branch, Edit .gitignore, Git Logs and Remove. To test an update we pushed a new commit with one new file, Code: hello.txtThen Pull in Manage Git: Changes applied: a fast-forward to the new commit. On the server the new file belonged to the site user ( Code: -rw-r--r-- cyber2602 cyber2602 hello.txtOne oddity: when there's nothing new, the panel shows it as a failure: Operation Failed! Pull not required. with Code: Already up to date.From SSH the same update is one line: Code: cd /home/yourdomain.com/public_html && sudo -u SITEUSER git pull --ff-onlyCode: --ff-onlyCode: composer install --no-devCode: php artisan migrate --forceGood habits
More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions. |