# Zactonz Git

> Deploy GitHub repositories to cPanel accounts automatically, with webhooks or a manual sync.

- **Type:** WHM plugin (cPanel & WHM)
- **Version:** 1.0.1, released 17 Sep 2026
- **Requires:** WHM 106+, Git 2.18+, Root access
- **Licence:** Free & open source
- **Download:** https://github.com/zactonz/zctzgit/archive/refs/tags/v1.0.1.tar.gz
- **Source:** https://github.com/zactonz/zctzgit
- **Documentation:** https://developers.zactonz.com/cpanel-whm/zctzgit/

## Overview

Zactonz Git connects GitHub repositories to directories on a cPanel server. Once a repository is configured, every push to GitHub can be deployed automatically through a webhook, or pulled on demand from the cPanel interface. It is built for production hosting: no third-party dependencies, private-repository support with access tokens, and a clean interface inside the cPanel Jupiter theme.

### What it does

- **Automatic deployment** from GitHub on every push, via a per-repository webhook URL.
- **Manual sync** with one click when you want to control timing.
- **Private repositories** through GitHub access tokens.
- **Any target directory** inside the account, such as `public_html` or a subfolder.
- **Multiple repositories** per account, each with its own branch and path.
- **No dependencies** beyond Git itself.

### How it fits together

The plugin installs into WHM as root and exposes a tool under the **Files** group in each cPanel account. Account owners add repositories from there; the plugin clones the repository into the chosen path and records a webhook URL. When GitHub calls that URL, the plugin runs `git pull` in the target directory and records the time of the last sync.

### Licensing

Zactonz Git is free and open source. You may use it on your own servers, modify it, and resell or white-label it under your own brand. It is distributed as-is, without warranty; review the code before running it in production.

### Contributing

Bug reports and pull requests are welcome. Reach the original authors through [zactonz.com](https://zactonz.com).

## Requirements

Check these before installing. The installer confirms it is running as `root` and stops if it is not; the rest of this page is your responsibility to verify.

### Compatible environments

- CentOS 7 / 8
- AlmaLinux 8 / 9
- Rocky Linux
- CloudLinux OS
- Any server running WHM/cPanel with the **Jupiter** theme

### Required software

| Component | Minimum |
|---|---|
| WHM / cPanel | 106 or newer |
| Git | 2.18 or newer |
| PHP | 7.2 or newer |
| Web server | Apache or LiteSpeed |

The webhook receiver is served from the account's document root and relies on `.htaccess`, so automatic deployment requires Apache or LiteSpeed. Manual **Sync now** works on any web server.

### Required access

- **Root SSH** (or WHM's Terminal feature) to run the installer. Regular cPanel users cannot install WHM plugins.
- **GitHub access**: public repositories need nothing; private repositories need a personal access token with read access to the repository.
- The PHP `exec` function must be enabled for the account so the plugin can run `git`.

### Network

The server needs outbound HTTPS to `github.com` to clone and pull. If GitHub webhooks are used for automatic deployment, GitHub must be able to reach the account's domain over HTTPS.

### A note on stored tokens

An access token for a private repository is stored twice on the server: encrypted in the account's `~/.zctzgit` directory, and in plaintext inside the repository's `.git/config`, where Git keeps the remote URL. Since 1.0.1 the plugin writes a deny rule into `.git` and restricts its permissions, which stops Apache and LiteSpeed serving it. NGINX ignores `.htaccess`, so on NGINX add a server-level rule blocking `.git` before deploying a private repository into a document root.

Issue tokens with the narrowest scope that works — read access to the single repository — and rotate them if a server is ever exposed.

## Installation

The plugin ships as a `.tar.gz` archive containing the cPanel Jupiter interface files, the PHP backend, and `install.sh` / `uninstall.sh` scripts. Installation takes about a minute.

> Run every command on this page as `root`, over SSH or from **WHM › Terminal**.

### Quick install

```bash
cd /root && mkdir -p zctzgit && curl -fsSL https://github.com/zactonz/zctzgit/archive/refs/tags/v1.0.1.tar.gz | tar -xz -C zctzgit --strip-components=1 && cd zctzgit && bash install.sh
```

GitHub names its archives after the tag, so `--strip-components=1` puts the files straight into `zctzgit/` whichever version you download. Check [Releases](https://github.com/zactonz/zctzgit/releases) for the current tag.

The installer copies the plugin into cPanel's plugin directories, registers it with the Jupiter theme and prints a summary when it finishes.

### Step by step

1. **Download and extract the package** into the root home directory.

   ```bash
   cd /root
   mkdir -p zctzgit
   curl -fsSL https://github.com/zactonz/zctzgit/archive/refs/tags/v1.0.1.tar.gz | tar -xz -C zctzgit --strip-components=1
   cd zctzgit
   ```

2. **Run the installer.**

   ```bash
   bash install.sh
   ```

3. **Confirm the install.** Log in to any cPanel account and look for **Zactonz Git** under the **Files** group. If the icon does not appear straight away, have the user log out and back in so the theme cache refreshes.

### Updating

Run the quick-install command again with the new tag in the URL. The installer replaces the plugin files in place and clears files left by the previous version. Configured repositories live in each account's home directory and are kept.

Release notes for every version are on the [changelog](https://developers.zactonz.com/changelog/).

> **Upgrading from 1.0.0.** Version 1.0.0 contained syntax errors that stopped it running at all, so it holds no saved state to preserve. Install 1.0.1 straight over it.

### Uninstalling

From the extracted package directory:

```bash
bash uninstall.sh
```

This removes the plugin files and its cPanel registration. Cloned repositories inside account directories are left untouched.

## How to use

Once the plugin is installed, account owners manage their repositories from cPanel. No further server-side setup is needed.

### Add a repository

1. Open cPanel and find **Zactonz Git** under the **Files** group.
2. Fill in the form:
   - **Repository name**: a display name for the list.
   - **Clone URL**: the GitHub repository URL, public or private.
   - **Branch**: usually `main` or `master`.
   - **Repository path**: where to deploy, relative to the account's home directory (for example `public_html` or `public_html/app`).
   - **Access token**: required for private repositories. A GitHub personal access token with read access is enough.
   - **Enable auto sync**: tick this if pushes to GitHub should deploy automatically.
3. Click **Save & Deploy**.

The repository is cloned into the chosen path and appears under **Configured repositories** below the form.

### Automatic deployment with a webhook

1. In **Configured repositories**, click **Webhook** next to the repository. A dialog shows its unique webhook URL; copy it.
2. In GitHub open the repository's **Settings › Webhooks › Add webhook**.
3. Paste the URL as the **Payload URL**.
4. Set **Content type** to `application/json`.
5. Choose **Just the push event** and save.

From then on every push to the configured branch triggers a `git pull` on the server. The **Last sync** column shows when the most recent deployment ran.

### Manual deployment

Click **Sync now** next to a repository to run `git pull` immediately. This works whether or not auto sync is enabled, and is the right choice for repositories where you want to control deployment timing.

### Removing a repository

Delete the entry from **Configured repositories**. The files already deployed to the target path are left in place; remove them from the File Manager if they are no longer wanted.

## FAQ

### Can I use it with private GitHub repositories?

Yes. Enter a GitHub personal access token in the **Access token** field when adding the repository. The token needs read access to the repository and is stored on the server for pulls.

### Will it work on shared hosting?

No. The plugin installs into WHM and needs root access to the server. It is meant for servers you administer, and then benefits every cPanel account on them.

### Does it pull automatically?

Yes, once a GitHub webhook is configured for the repository. Every push to the configured branch triggers a `git pull`. You can also click **Sync now** at any time.

### Can I deploy to a subdirectory such as `public_html/app`?

Yes. The **Repository path** can be any valid path relative to the account's home directory.

### Can I manage several repositories?

Yes. Add as many as you need, each with its own clone URL, branch and target path.

### What happens to local changes in the target directory?

Deployment runs `git pull`, so files that were edited on the server and conflict with the incoming commit will block the pull. Keep the target directory managed by Git alone, or commit server-side changes back to the repository.

### I installed 1.0.0 and nothing happened. What went wrong?

Version 1.0.0 contained syntax errors that stopped it loading, so opening the tool in cPanel produced a fatal error or a blank page. Install 1.0.1 over it; there is no saved state to preserve. The [changelog](https://developers.zactonz.com/changelog/) lists everything that changed.

### Where do I download it?

From [GitHub](https://github.com/zactonz/zctzgit/releases). Each release has a source archive; the [installation page](https://developers.zactonz.com/cpanel-whm/zctzgit/installation/) has the exact command. Commands published in earlier documentation pointed elsewhere and did not work.

### Is it really free?

Yes. Zactonz Git is free and open source, and may be modified, resold or white-labelled. It is provided as-is with no warranty.
