selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Self-host GitLab

Open-core DevOps platform for Git hosting, CI/CD and MRs

ReleaseOpen Coremit
Docker ComposeCompose file & guide
docker compose up -d
Updated2 weeks ago
Setup difficultyAdvanced
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)
Ports
80 (HTTP web UI and Git over HTTP), 443 (HTTPS), 22 (Git over SSH (GitLab Shell))
Requires
Git, Mail transport agent (Postfix or Sendmail), PostgreSQL, Redis
Docker
gitlab/gitlab-ce

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.

GitLab alternatives

Should you self-host GitLab?

GitLab scores 68/100 on selfhost.directory (how scoring works) and ranks #5 of 15 in 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 (89/100, 59 114 stars). It scores higher overall, so compare the two before you pick. See GitLab vs Gitea side by side.

Features

  • AI assistant (GitLab Duo)Duo Agent Platform on Self-Managed needs GitLab 18.7/18.8 or later and credits; some tiers paid.
  • CI/CD PipelinesJobs are executed by GitLab Runner instances you set up.
  • Container RegistryNeeds its own domain and TLS certificate.
  • Dependency proxy
  • Enterprise features behind paid tiersOfficial support and extra features require a subscription.
  • Geo ReplicationOnly 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

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

How to configure GitLab

  • GITLAB_OMNIBUS_CONFIGEnvironment variable used to pre-configure the Omnibus gitlab.rb settings of a Docker container.

    values: gitlab.rb configuration lines

  • external_urlOmnibus configuration setting for the URL GitLab is reachable at.

    values: URL

  • hostlocalhostGitLab application host in gitlab.yml; must be the fully qualified domain name.

    values: FQDN

  • port80Port GitLab is served on (set to 443 when using HTTPS).

    values: integer

  • httpsfalseWhether GitLab is served over HTTPS.

    values: true/false

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.

More in Code Hosting

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…