# GitLab Cloud & Self-Hosted CE/EE

> **Availability notice:** Self-serve onboarding in [app.membl.io](https://app.membl.io) currently focuses on **GitHub**. GitLab connections are paused for general self-serve. [Contact us](/contact) if your team needs GitLab runner access.

membl supports both **GitLab.com (SaaS)** and **self-hosted GitLab Community / Enterprise Edition (CE/EE)** over HTTPS when multi-forge access is enabled for your workspace. Keep your `.gitlab-ci.yml` untouched by tagging jobs for membl ephemeral runners, or enable `.membl/workflows/*.yml` with automatic GitLab Commit Status updates and merge request authoring.

<Cards>
  <Card title="Multi-Forge Overview" href="/docs/multi-forge">
    All 7 supported forge families and dual execution modes.
  </Card>

  <Card title="Source Control Security" href="/docs/source-control-security">
    Strict HTTPS, SSRF protection, and automatic egress allowlisting.
  </Card>

  <Card title="Workflow Schema v1" href="/docs/workflow-schema">
    Portable 

    `.membl/workflows/*.yml`

     specification.
  </Card>
</Cards>

## Connecting GitLab

<Steps>
  <Step>
    ### 1. Authorize GitLab Cloud or connect CE/EE

    Sign in at [app.membl.io/sign-in](https://app.membl.io/sign-in) (1-click **Sign in with GitLab** is supported) and open **Settings -> Connections -> Source Control**.

    * **GitLab.com**: Click **Connect GitLab** to authorize via OAuth.
    * **Self-hosted GitLab CE/EE**: Enter your HTTPS instance URL (for example `https://gitlab.example.com`) and provide a Personal Access Token or Group Access Token (`api` scope), or import a 1Password `op://` reference.
  </Step>

  <Step>
    ### 2. Automatic webhook & egress allowlist

    When you link a GitLab project or group, membl registers a signed webhook pointing to `/api/gitlab/webhook` and automatically adds your verified GitLab hostname to your workspace egress allowlist. Isolated membl sandboxes can then clone repositories, upload artifacts, and post job statuses to your self-hosted server cleanly.
  </Step>

  <Step>
    ### 3. Verify with Test Connection

    Click **Test Connection & Verify Webhook** in Source Control settings to validate token permissions, webhook delivery, and egress reachability before running a pipeline.
  </Step>
</Steps>

## Option A: Zero-edit `.gitlab-ci.yml` ephemeral runners

When a webhook arrives for a GitLab job targeting membl, membl provisions an ephemeral single-use runner authentication token (`POST /api/v4/user/runners`, `glrt-...`) and runs `gitlab-runner run-single --max-builds 1` inside a fresh Linux x64 sandbox wired with membl in-place caches and telemetry receipts. Once the build completes, the sandbox is destroyed immediately.

Add `membl` to `tags` in `.gitlab-ci.yml`:

```yaml
stages:
  - test
  - build

unit_tests:
  stage: test
  tags:
    - membl
  script:
    - pnpm install --frozen-lockfile
    - pnpm test

build_app:
  stage: build
  tags:
    - membl
  script:
    - pnpm install --frozen-lockfile
    - pnpm build
```

All existing `.gitlab-ci.yml` stages, `needs:`, `rules:`, CI/CD variables, and artifacts remain unchanged.

## Option B: Native `.membl/workflows/*.yml` on GitLab

If you prefer a single portable CI specification across GitLab and other forges, add `.membl/workflows/ci.yml` to your repository. membl dispatches jobs directly from `/api/gitlab/webhook`, executes your DAG with tool-native cache presets and timing-based sharding, and publishes pass/fail Commit Statuses directly onto your GitLab commits and merge requests.

## Self-hosted GitLab security requirements

* **Strict HTTPS**: Self-hosted GitLab endpoints must use `https://`. Plain HTTP is rejected.
* **SSRF & DNS-rebinding protection**: Every API request and redirect resolves and checks target IPs against private, loopback, link-local, metadata, and CGNAT address blocks. See [Source Control Security](/docs/source-control-security) for details.

## Next steps

* Review [per-second runner pricing](/pricing) (queue and boot seconds are `$0.00`).
* Estimate matrix cache and rounding savings in the [cost calculator](/calculator).

