# GitLab

> Self-hosted, open-core DevOps platform: Git repositories, merge requests, CI/CD pipelines, issue boards, wikis and an integrated container registry in one install.

- **Category:** [Code Hosting](https://selfhost.directory/code-hosting)
- **Licence:** mit
- **Source model:** Open core (some features or tiers are paid)
- **Author:** GitLab
- **Platforms:** Docker, Docker Compose, Linux, Helm
- **Ports:** 80 (HTTP web UI and Git over HTTP), 443 (HTTPS), 22 (Git over SSH (GitLab Shell))
- **Requires:** Redis, PostgreSQL, Git, Mail transport agent (Postfix or Sendmail), S3-compatible Object Storage (optional)
- **Tags:** PostgreSQL, Redis, Git, Devops, Wikis, LDAP, CI/CD, Container Registry, Code Review, Kubernetes, Issue Tracker, Ruby On Rails, SAML

## Docker images

- [`gitlab/gitlab-ce`](https://hub.docker.com/r/gitlab/gitlab-ce) — Community Edition container image
- [`gitlab/gitlab-ee`](https://hub.docker.com/r/gitlab/gitlab-ee) — Enterprise Edition container image

## Hardware requirements

- **CPU:** 8 vCPU (baseline for a single-node installation)
- **RAM:** 16 GB (baseline; can run with at least 8 GB in memory-constrained environments)
- **Storage:** 40 GB for application nodes (package installation ~2.5 GB plus OS, logs, temporary files)

## What is GitLab?

This Rails-based product pulls source code management, build and deployment pipelines, issue tracking and documentation into a single application that runs on your own hardware. Its README advertises fine-grained permissions for Git repositories, code review via merge requests, CI/CD pipelines that build, test and ship applications, plus a per-project issue tracker, board and wiki, and notes that over 100,000 organizations run it on-premises for their Git hosting. Licensing is open-core: the bulk of the code is MIT, while files under /ee stay proprietary yet source available and open to contributions. Three editions ship - the free Community Edition, Enterprise Edition aimed at organizations larger than 100 users with official support behind a subscription, and a JiHu edition for China. To self-host, the documented options are the recommended Omnibus deb/rpm packages (which bundle PostgreSQL, Redis and Sidekiq), Docker images used through Compose, Docker Engine or Swarm, the Kubernetes Helm chart or GitLab Operator, and a self-compiled install; a single node should have 8 vCPU and 16 GB RAM, with 8 GB possible when memory is tight. Paid tiers unlock Premium and Ultimate capabilities, and GitLab.com remains available as the vendor-hosted option.

## Should you self-host GitLab?

GitLab scores **68/100** on selfhost.directory ([how scoring works](https://selfhost.directory/scoring)) and ranks **#5 of 15** in [Code Hosting](https://selfhost.directory/code-hosting).

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is mit-licensed.

Its closest alternative on selfhost.directory is [Gitea](https://selfhost.directory/project/gitea) (89/100, 59 114 stars). It scores higher overall, so compare the two before you pick. [See GitLab vs Gitea side by side.](https://selfhost.directory/compare/gitea-vs-gitlab-ce-2)

## Features

- AI assistant (GitLab Duo) (◐ partial) — Duo Agent Platform on Self-Managed needs GitLab 18.7/18.8 or later and credits; some tiers paid.
- CI/CD Pipelines — Jobs are executed by GitLab Runner instances you set up.
- Container Registry — Needs its own domain and TLS certificate.
- Dependency proxy
- Enterprise features behind paid tiers (◐ partial) — Official support and extra features require a subscription.
- Geo Replication — Only takes effect when Geo is enabled.
- Issue Tracking
- Merge requests
- Single sign-on (LDAP, SAML, OAuth, OIDC)
- Wiki

## How to install GitLab

### Install GitLab with Docker

Environment variables:

```
GITLAB_OMNIBUS_CONFIG
```

shell
```
sudo docker run --detach \
  --hostname gitlab.example.com \
  --env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.example.com'" \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --shm-size 256m \
  gitlab/gitlab-ee:<version>-ee.0
```

Note: Sign in as root with the password from /etc/gitlab/initial_root_password.

### Install GitLab with Docker Compose

Requirements: You must have a working [Docker installation](https://docs.docker.com/engine/install/#server) that is not Docker for Windows.

Environment variables:

```
GITLAB_OMNIBUS_CONFIG, GITLAB_HOME
```

yaml
```
services:
  gitlab:
    image: gitlab/gitlab-ee:<version>-ee.0
    container_name: gitlab
    restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        # Add any other gitlab.rb configuration here, each on its own line
        external_url 'https://gitlab.example.com'
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'
```

shell
```
docker compose up -d
```

Note: Replace ee with ce to install the Community Edition image; Docker Swarm mode is also documented.

### Install GitLab with Linux

The recommended way to install GitLab is with the [Omnibus packages](https://docs.gitlab.com/install/package/) on our package server.
Compared to [a self-compiled installation](https://docs.gitlab.com/install/self_compiled/), this is faster and less error prone.
Just select your operating system, download the respective package (Debian or RPM) and install it using the system's package manager.

Note: Bundles GitLab with PostgreSQL, Redis and Sidekiq; available for Ubuntu, Debian, AlmaLinux, Oracle Linux, RHEL, Amazon Linux, openSUSE Leap/SLES.

## FAQ

### Do the compute minutes apply to all runners?

No, compute minute limits only apply to GitLab.com shared runners.

### Can I bring my own GitLab CI/CD runners?

Yes, bring-your-own runners work with all plans.

### Can I import my projects from another provider?

Yes, project import from other providers is supported.

### What are the differences between SAST, Secret Detection, and Container Scanning across tiers?

Basic scans run in every tier, but enterprise-grade scanning and management features are only available in Ultimate.

### What are the differences between Free, Premium, and Ultimate plans?

The differences are laid out in GitLab's feature comparison pages for Premium and Ultimate.

### Is there a minimum supported version to use specific capabilities?

For Self-Managed, GitLab Duo Agent Platform requires at least version 18.8, and trialing Ultimate with Duo and GitLab Credits requires 18.9.

### How do I install GitLab Self-Managed?

All supported installation methods are listed in the GitLab installation documentation.

### What is GitLab Self-Managed?

It is the version of GitLab you install, configure and maintain on your own infrastructure, whether on-premises or in the cloud.

## GitLab alternatives

- [Forgejo](https://selfhost.directory/project/forgejo): A self-hosted, open-source software forge: git hosting with issues, pull requests, wikis, CI and package registries in one lightweight binary or container. (compare: https://selfhost.directory/compare/forgejo-vs-gitlab-ce-2)
- [Gitea](https://selfhost.directory/project/gitea): Gitea is a self-hosted, open-source Git platform with code hosting, CI/CD, package registries, issues, and project management — a lightweight GitHub alternative. (compare: https://selfhost.directory/compare/gitea-vs-gitlab-ce-2)
- [Gerrit](https://selfhost.directory/project/gerrit): Open-source, self-hosted code review and Git repository management server: patchset reviews, fine-grained permissions, plugins, REST API and webhooks. (compare: https://selfhost.directory/compare/gerrit-vs-gitlab-ce-2)
- [Gogs](https://selfhost.directory/project/gogs): A lightweight, open-source, self-hosted Git service written in Go: repos, issues, pull requests, wikis and LDAP login, run from one binary or a Docker image. (compare: https://selfhost.directory/compare/gitlab-ce-2-vs-gogs)
- [Gitness](https://selfhost.directory/project/gitness): An open-source, self-hosted DevOps platform combining Git code hosting, CI/CD pipelines, Gitspaces dev environments and artifact registries in one Docker container. (compare: https://selfhost.directory/compare/gitlab-ce-2-vs-gitness)
- [Gitea Runner](https://selfhost.directory/project/gitea-runner): Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD (compare: https://selfhost.directory/compare/gitea-runner-vs-gitlab-ce-2)
- [Pipewright](https://selfhost.directory/project/pipewright): A self-hosted CI/CD platform that unifies build pipelines, server deployment, and container management in a single Go binary. (compare: https://selfhost.directory/compare/gitlab-ce-2-vs-pipewright)
- [semaphore](https://selfhost.directory/project/semaphore): Semaphore is a self-hosted, open-source CI/CD platform with YAML pipelines, parallel execution, and self-hosted agents for teams. (compare: https://selfhost.directory/compare/gitlab-ce-2-vs-semaphore)

## More in Code Hosting

- [GitLab-CE](https://selfhost.directory/project/gitlab-ce): Self-hosted, open-source DevOps platform for Git repositories, merge requests, CI/CD pipelines, issue boards and wikis, with free CE and paid Premium/Ultimate tiers.
- [Gitness](https://selfhost.directory/project/gitness): An open-source, self-hosted DevOps platform combining Git code hosting, CI/CD pipelines, Gitspaces dev environments and artifact registries in one Docker container.
- [Gitus](https://selfhost.directory/project/gitus): Gitus is a self-hosted, open-source Git forge in Go with no JavaScript, featuring a web installer, SSH access, issues, pull requests, and experimental webhooks.
- [Gogs](https://selfhost.directory/project/gogs): A lightweight, open-source, self-hosted Git service written in Go: repos, issues, pull requests, wikis and LDAP login, run from one binary or a Docker image.
- [harness](https://selfhost.directory/project/harness): Self-hosted, open-source DevOps platform: Git hosting with pull requests, CI/CD pipelines, Gitspaces dev environments, and Docker and Helm artifact registries.
- [legit](https://selfhost.directory/project/legit): Open-source, self-hosted browsing UI for Git repos, built in Go: serves bare repositories from a folder with custom templates, README rendering and HTTP cloning.
- [OneDev](https://selfhost.directory/project/onedev): OneDev is a powerful and simple DevOps platform that integrates Git server, Kanban, CI/CD, and package registries into a seamless experience.
- [Pagure](https://selfhost.directory/project/pagure): Pagure is a lightweight, git-centered forge for hosting projects with documentation, ticketing, and pull-request mechanisms.
- [rgit](https://selfhost.directory/project/rgit): Self-hosted, open-source Git web interface in Rust using RocksDB caching and gitoxide for fast browsing with dark mode.
- [RhodeCode](https://selfhost.directory/project/rhodecode): RhodeCode is an open-source, self-hosted platform for unified repository management, supporting Git, Mercurial, and Subversion. It provides enterprise-grade security, code review, workflow automation, and permission management for teams.
- [Roundup Issue Tracker](https://selfhost.directory/project/roundup-issue-tracker): Roundup is a highly customizable issue-tracking system with command-line, web, REST, XML-RPC, and e-mail interfaces. It is designed to be easy to install and use, and can be adapted to various use cases.
- [scm-manager](https://selfhost.directory/project/scm-manager): Self-hosted open-source repository manager for Git, Mercurial and Subversion with web UI, REST API, and plugin system.

## Links

- [Homepage](https://gitlab.com/gitlab-org/gitlab-ce)
- [Website](https://about.gitlab.com/)
- [GitLab Docs](https://docs.gitlab.com/)
- [GitLab forum](https://forum.gitlab.com/)
- [GitLab on Twitter](https://twitter.com/gitlab)
- [GitLab on YouTube](https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg)
- [GitLab University](https://university.gitlab.com)

---
Source: https://selfhost.directory/project/gitlab-ce-2