> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/node.js/git-deployments.md).

# GitHub and GitLab

Connect a GitHub or GitLab repository to Hostinger for automatic Node.js deployments on every push, covering how each provider connects, the build pipeline, connection status, and troubleshooting.

Connect a **GitHub** or **GitLab** repository and have Hostinger install dependencies, run your build script, and start (or restart) your Node.js app on every push.

> **Note:** This is a separate integration from the generic [Git](/websites/git.md) feature in the Websites section. This one runs the full Node.js build pipeline (install → build → start). The generic one just copies files into a directory. Use this one whenever your project needs `npm install` or a build step.

## What it does

On each connected push, Hostinger:

1. Pulls the latest code from GitHub or GitLab
2. Runs `npm install` (or `yarn` / `pnpm`, auto-detected from lockfiles)
3. Runs your build script (if one is configured)
4. Starts or restarts your app

Build progress streams to the deployment details page in real time.

## Git deployment vs archive upload

|                        | Git deployment                               | [Archive upload](/node.js/creating-an-app.md) |
| ---------------------- | -------------------------------------------- | --------------------------------------------- |
| Trigger                | Push to a branch                             | Manual upload or API                          |
| Source                 | GitHub or GitLab repository                  | `.zip` / `.tar` / `.tar.gz`                   |
| Dependencies           | Installed on Hostinger                       | Your choice (can ship `node_modules`)         |
| Vulnerability auto-fix | [Pull requests](/node.js/vulnerabilities.md) | Manual                                        |
| Best for               | Ongoing projects                             | One-off deploys, external CI/CD               |

## Requirements

* Active Hostinger hosting plan with a Node.js-capable website
* A GitHub repository, or a GitLab project on **gitlab.com**, with a Node.js project (`package.json` at the app root)
* A supported framework — see [Supported Frameworks](/node.js/overview-1.md) — or **Other** with manual build settings

> **Note:** GitLab support covers gitlab.com. Self-managed GitLab instances can't be connected.

## How the connection works

GitHub and GitLab connect differently:

|                     | GitHub                                                      | GitLab                                                           |
| ------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------- |
| Connection          | Install the **Hostinger GitHub App** on your GitHub account | Sign in to gitlab.com and authorize Hostinger in a popup         |
| Repository access   | You choose: all repositories, or a hand-picked list         | Every project your GitLab account is a member of                 |
| Change access later | GitHub → **Settings** → **Applications**                    | Revoke or re-authorize Hostinger in your GitLab account settings |
| Push notifications  | Delivered through the GitHub App                            | Hostinger adds a webhook to the GitLab project you deploy        |

* You can connect a **GitHub account and a GitLab account at the same time**, and deploy some apps from each. Every app deploys from one repository.
* **Switch account** replaces the connection for that provider — deployments from the previous account stop.
* Adding or removing repository access on GitHub syncs to hPanel automatically. Click **Refresh repositories** if a repository isn't showing.

Your connected accounts are also listed in your hPanel profile under **Account integrations**, where you can connect, disconnect, or open **Manage in GitHub** / **Manage in GitLab**.

## Connect a repository

1. Create the app via **Websites** → **Add Website** → **Node.js web app** (see [Creating a Node.js App](/node.js/creating-an-app.md)).
2. Under **Import your Git repository**, click **Connect with GitHub** or **Connect with GitLab** and finish the connection in the popup. If the account is already connected, the button reads **Continue with GitHub** or **Continue with GitLab**.
3. Pick a repository — private repositories are marked with a lock icon. You can also paste a **public repository URL** to clone it into your own account and deploy the copy — see [Deploy a public repository](#deploy-a-public-repository).
4. Confirm or adjust the auto-detected settings:

   | Setting              | Description                                                                                                |
   | -------------------- | ---------------------------------------------------------------------------------------------------------- |
   | **Framework preset** | Auto-detected from `package.json`                                                                          |
   | **Branch**           | The branch that triggers deployments (defaults to the repo's default branch)                               |
   | **Node.js version**  | 18, 20, 22, or 24                                                                                          |
   | **Root directory**   | Path to the app (repo root, or a subdirectory for monorepos — auto-detected)                               |
   | **Build command**    | npm script to run (e.g. `build`)                                                                           |
   | **Output directory** | Where built files land (e.g. `.next`, `dist`)                                                              |
   | **Entry file**       | For server apps (e.g. `server.js`) — path rules in [Build Settings](/node.js/build-settings.md#entry-file) |
5. Click **Deploy** to run the first build.

For per-framework defaults, see [Supported Frameworks](/node.js/overview-1.md).

## Deploy a public repository

Paste a public **github.com** or **gitlab.com** repository URL into **Public repository URL** and click **Deploy**. Hostinger clones it into a new repository on your account, and you pick the **Repository name** and whether it's a **Private repository** (on by default). hPanel shows the path the copy will be created at, and Hostinger deploys from the copy.

Where the copy goes:

* **One provider connected** — the copy is created there.
* **Both or neither connected** — hPanel asks you to **Choose where to create the repository**. If the provider you pick isn't connected yet, you connect it next.

The source and the copy don't have to use the same provider. For example, you can clone a public GitHub repository into your GitLab account.

## Automatic builds

Auto-deployment is turned on when you deploy from Git, and it works the same way for GitHub and GitLab. On every push:

1. You push to the connected branch.
2. GitHub or GitLab notifies Hostinger with a webhook.
3. Hostinger pulls the code at the pushed commit.
4. Dependencies install, build runs, app restarts.
5. Logs stream to **Deployments** → deployment details.

The dashboard shows an **Auto-deployment** chip when this is active. Only one deployment runs at a time per site; additional pushes queue up.

## Manual builds

Click **Redeploy** on the website dashboard or the **Deployments** page. Same pipeline, triggered by you — it reuses the saved settings and pulls the latest code from the connected branch.

## Connection status

The dashboard and Deployments page show the state of the Git connection. `{provider}` stands for GitHub or GitLab:

| Status                                     | Meaning                                                | Fix                                                                                |
| ------------------------------------------ | ------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| **Connected with {provider}**              | Auto-deployment active; links to the repo              | —                                                                                  |
| **Git provider is not connected**          | No GitHub or GitLab account is connected for this site | Click **Connect Git provider** and choose **Connect GitHub** or **Connect GitLab** |
| **Different {provider} account connected** | The site's repo belongs to another account             | Click **Switch account**                                                           |
| **Repository access missing**              | Hostinger can no longer access this repo               | Click **Manage access** and grant access in GitHub or GitLab                       |
| App suspended                              | The Hostinger app is suspended in your GitHub account  | Re-enable it on GitHub                                                             |

## Disconnecting

From the menu next to the connection status:

* **Disconnect from repository** — unlinks this site only. Your Git account stays connected; auto-deployments for this site stop.
* **Disconnect GitHub** or **Disconnect GitLab** — removes the whole connection. All sites connected to that account stop deploying; already-deployed sites stay live.

## Build logs and history

Every deployment is recorded with its branch, commit hash and message, author, timestamp, and status, plus the full build log. See [Deployments](/node.js/deployments.md). Logs are also available via the [API](/api-reference/endpoints/hosting/nodejs.md).

## Environment variables

Values set under **Environment variables** are injected into both build and runtime. They persist across deployments — no need to re-apply on every push. See [Environment Variables](/node.js/environment-variables.md).

## Monorepos

For apps that live in a repo subdirectory, Hostinger detects the **Root directory** (where the app's `package.json` lives) and builds from there — only that subdirectory is built. Deploy separate subdirectories as separate Hostinger Node.js apps.

## Branch strategy

* Deploy `main` for always-live workflows.
* Use `production` or `release/*` to batch changes and control what ships.
* For QA before merging, deploy a preview branch as a separate Node.js app on a free subdomain, then point the main site's branch at the release once it's verified.

## Vulnerability auto-fix pull requests

For Git-connected apps, Hostinger can open a pull request on your GitHub repository, or a merge request on your GitLab project, that bumps vulnerable npm packages. You review and merge — nothing goes live until you do. See [Vulnerability Scanning](/node.js/vulnerabilities.md).

## Troubleshooting

**Build fails during dependency install** Check the first error in the log. Common causes: missing native dependencies, peerDependencies conflicts, Node version mismatch with `engines` field. npm installs automatically retry with `--legacy-peer-deps` before failing.

**Build succeeds but site shows old version** Static/SSG output: clear browser cache and [Hostinger cache](/websites/cache.md). Server apps: verify the new process started in **Runtime Logs**.

**Deployments not triggering on push** Confirm the branch name matches the connected branch, and that the connection status shows **Connected with GitHub** or **Connected with GitLab** — a revoked connection or missing repository access shows a warning state instead. On GitLab, also check that Hostinger's webhook is still listed and enabled in the project's **Settings** → **Webhooks**. GitLab can disable a webhook after repeated failed deliveries; re-enable it there. If the webhook was deleted, contact Hostinger support.

**"Could not access the repository" when deploying by URL** URL-based deploys work with public github.com and gitlab.com repositories only. For private repos, connect the owning account instead.

**Repository is empty** Push at least one commit with a `package.json` before importing.

**GitHub or GitLab access revoked** Reconnect from the dashboard's connection status → **Connect Git provider**. On GitHub, you can also restore the Hostinger app's access in GitHub → **Settings** → **Applications**.

***

*Last updated: October 21, 2026*
