> For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt.

# Connect GitLab

Applies to gitlab.com, GetGeek's [Managed GitLab](https://getgeek.se/) and other
self-hosted GitLab instances. You need the _Maintainer_ or _Owner_ role in the
project.

You need the deploy key and the webhook address from us
(see [Getting started](/en/static/kom-igang.md#steg-2-det-har-far-du-av-oss)).

## 1. Add the deploy key \{#1-lagg-in-deploynyckeln}

1. Open the project and go to **Settings → Repository**.
2. Expand **Deploy keys** and click **Add new key**.
3. Fill in:
   - **Title:** `GetGeek Static` (any name)
   - **Key:** the whole key from us, the line starting with `ssh-ed25519`
   - **Grant write permissions to this key:** _must be unticked._ We only need
     to read.
   - **Expiration date:** leave empty — otherwise builds stop working on that
     date.
4. Click **Add key**.

![The form for a new deploy key in GitLab](/_assets/image/gitlab-deploykey-formular.93ab060cdf.png)
The key then appears in the list:

![The deploy key added in GitLab](/_assets/image/gitlab-deploykey-tillagd.c176f90e4b.png)
## 2. Add the webhook \{#2-lagg-in-webhooken}

1. Go to **Settings → Webhooks** and click **Add new webhook**.
2. Fill in:
   - **Name:** `GetGeek Static` (optional)
   - **URL:** the webhook address from us
   - **Trigger:** tick **Push events**, with _All branches_.

:::warning Push events is not ticked by default
In newer GitLab versions no event is selected when you create a webhook. If you
forget **Push events**, the webhook is saved without an error — but it never
sends anything, and nothing gets built.
:::

![The webhook form in GitLab with Push events ticked](/_assets/image/gitlab-webhook-formular.5788c742a9.png)
:::tip Hide the key in the address
Click **+ Add URL masking** below the URL field and mask the last part of the
address (after `/hook/<site>/`). It is then shown as `{token}` in GitLab, even to
others with access to the project's settings.
:::

3. Leave **Enable SSL verification** ticked and click **Add webhook**.

![SSL verification and the Add webhook button](/_assets/image/gitlab-webhook-ssl.65ede14882.png)
## 3. Test \{#3-testa}

In the list of webhooks, click **Test → Push events**. A green message at the
top of the page means we have received the request and started a build.

![The webhook in the list, with the masked address and the Test button](/_assets/image/gitlab-webhook-lista.ad54ccacd7.png)
If you get an error message instead, see
[Troubleshooting](/en/static/felsokning.md#webhooken-svarar-med-fel).
