Skip to content

Self-host GitLab CE

updated Aug 2026prices checked · Aug 2026Install verified on Ubuntu 26.04 · Aug 2026 · how we test

The whole DevOps platform in one install: repositories, merge requests, issues, a built-in CI/CD runner fleet, container and package registries, and Pages. It is open core — the community edition is MIT, the ee/ directory behind the paid tiers is not — and it is by far the heaviest thing on this list.

Key facts

CategoryCode hosting
LicenseMIT
StackRuby, Go, PostgreSQL
Min RAM8192 MB
Dockeryes
Difficulty
Our recommendation

GitLab CE is the pick when you want the whole DevOps platform in one install — merge requests, a built-in CI/CD runner fleet, container and package registries, and Pages — and you can afford to feed it. Upstream documents 16 GB as the single-node baseline and says it can run in a memory-constrained environment with at least 8 GB, which is an order of magnitude above Gitea, Forgejo or Gogs. That gap is the entire decision: if what you need is a forge, take Gitea or Forgejo and run a runner beside it. Take GitLab when collapsing five separate tools into one is worth operating by far the heaviest thing on this hub.

What you need

  • Any VPS with at least 8192 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • About the better part of a day

Install with Docker Compose

Save this as compose.yml and run docker compose up -d:

# GitLab CE — Compose is upstream's recommended container path.
# Git over SSH is mapped to 2222 — clone URLs carry the port. Use 22:22 only if
# you have already moved the host's own sshd, which can lock you out if it goes wrong
services:
  gitlab:
    image: gitlab/gitlab-ce:latest   # pin a versioned tag for production
    hostname: gitlab.example.com
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: "external_url 'http://gitlab.example.com'"
    ports: ["80:80", "443:443", "2222:22"]
    volumes:
      - "./config:/etc/gitlab"
      - "./logs:/var/log/gitlab"
      - "./data:/var/opt/gitlab"
    shm_size: "256m"
# docker compose up -d  —  first boot takes several minutes before it answers
# root password: docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
# that file is deleted on the first restart after 24 hours — read it early

What you take on

GitLab pays for its breadth in weight and in licensing, and both bite before you finish the first install:

non-negotiableIt is the most open-core-gated project in the catalogue. The community edition you install is MIT, but merge request approval rules, epics and advanced search need Premium, and dependency scanning and the compliance tooling need Ultimate. Container scanning, the registry, CI/CD and Pages stay free. Read the tier badge on each documentation page before you plan around a feature — the docs cover all tiers together.
non-negotiableOne container is not one service. The image bundles PostgreSQL, Redis, Gitaly, Puma, Sidekiq and NGINX behind a single config file, so first boot takes several minutes before it answers, every restart restarts that whole stack, and upstream's advice is to give it real memory rather than lean on swap. Upstream also warns against running this image on Kubernetes — use the Helm chart or the Operator there.
non-negotiableTwo footguns in the first hour: GitLab claims port 22 for Git over SSH, so move the host's own sshd first or you will lock yourself out of the box, and the generated root password lives in a file that is deleted on the first restart after 24 hours. Read it and store it immediately.

An alternative to

Head-to-head

More in Code hosting

Common questions

Is self-hosted GitLab actually open source?

Partly. Its LICENSE file opens with "Portions of this software are licensed as follows": everything outside the ee/ and jh/ directories is under the MIT Expat license, all client-side JavaScript is MIT, documentation under doc/ is CC BY-SA 4.0, and the ee/ and jh/ directories carry their own separate proprietary licenses. The Community Edition you install from the gitlab-ce package or container is the MIT half; Premium and Ultimate features live in ee/ and are not open source.

How much RAM does self-hosted GitLab need?

GitLab documents 16 GB as the baseline for a single-node install, and says it can run in a memory-constrained environment with at least 8 GB. That is an order of magnitude above Gitea or Gogs, and it is the reason GitLab is a deliberate choice rather than a default one. Upstream also recommends disabling swap rather than leaning on it.

Omnibus package or container?

Both are official. The Linux package (Omnibus) is the standard self-managed path and bundles PostgreSQL, Redis, Gitaly, Puma, Sidekiq and NGINX behind a single gitlab.rb config file. The container wraps the same Omnibus bundle, which is why the image is enormous and first boot is slow. Upstream explicitly warns against running the Docker image in Kubernetes — use the Helm chart or Operator there.

Which features do I lose on the free tier?

The ones that live in ee/. Merge request approval rules, epics and advanced search need Premium; dependency scanning and the compliance tooling need Ultimate. Everything in the core loop stays free: unlimited private repositories, merge requests, issues, CI/CD, container scanning, the container registry and Pages. Read the tier badge on each documentation page before you commit — this is the most open-core-gated project in the catalogue.

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.