# Private Git servers

Source: https://openpanel.sh/docs/network/private-git

Add a Git server that lives inside your private network, such as your own GitLab, Gitea or Forgejo, as a Git account that OpenPanel checks from one of your servers.

A Git server you run yourself does not have to face the internet. Put it in your organization's private network, and add it as a Git account with **Reached through the private network** on. OpenPanel then reaches it from one of your connected servers instead of from the internet.

## Which accounts can use it [#which-accounts-can-use-it]

| Git account | Through the private network |
|---|---|
| GitLab (your own GitLab) | Yes |
| Gitea | Yes |
| Forgejo | Yes |
| Git over SSH | Yes |
| Git over HTTPS | Yes |
| GitHub, Bitbucket | No: they are on the internet |

`gitlab.com` and `codeberg.org` are on the internet too: OpenPanel refuses them with the switch on.

## Before you start [#before-you-start]

- **The Git server is in the private network.** Add it as [another Linux machine](/docs/network/devices#another-linux-machine), or connect it as an OpenPanel server. Note its name or private address on the [**Private network**](https://openpanel.sh/network) page.
- **At least one connected server is Ready.** The check runs from one of your servers, preferably one already in the network.

## Add the account [#add-the-account]

1. In **Organization settings** → **Git accounts**, choose **Add Git account** and the kind of account.
2. For the **Address** or **Repository URL**, use the Git server's private address in the network, for example `http://100.64.0.7:3000` or `git@100.64.0.7:team/app.git`. Its name works too if the server that runs the check resolves the network's names. Use `http://` if the Git server does not serve HTTPS.
3. Turn on **Reached through the private network**. The switch says which server the check will run from.
4. Fill in the token or credentials as for any account of that kind (see [Git accounts](/docs/git)), and add it.

The account is listed with a **Private network** tag.

## How the check runs [#how-the-check-runs]

OpenPanel signs in to one of your ready servers, servers already in the network first, and runs the check there:

- for GitLab, Gitea, Forgejo and HTTPS repositories, with `curl`;
- for SSH repositories, with `git ls-remote`, or with `ssh` straight to the repository when Git is not installed.

The token, password or deploy key goes to the command on its input, never on its command line, and a deploy key is written to a temporary file that is removed afterwards. A web request stops after 10 seconds and follows no redirects.

If no server is ready yet, the account is saved as **Not checked** ("Not checked: connect a server first."). Choose **Check again** once a server is ready.

## When the check fails [#when-the-check-fails]

| The console says | What to do |
|---|---|
| From web-1, git.example does not resolve. | Use the Git server's name or address as the **Private network** page shows it, and check that the server running the check is in the network. |
| From web-1, git.example could not be reached or refused the connection. | Check that the Git server is online in the network and listens on that port on its private address. |
| From web-1, git.example did not answer within 10 seconds. | The Git server is offline, or nothing listens on that port. |
| … certificate is not trusted (expired, self-signed, or made for another name). | Serve a trusted certificate, or use `http://` inside the private network. |
| … has a private address. OpenPanel reaches only public addresses from the internet … | Turn on **Reached through the private network**. |

More in [A device or server cannot be reached](/docs/troubleshooting/network-unreachable).