GitLab
A complete DevSecOps platform: Git repositories, merge requests, CI/CD pipelines, a container registry and security scanning in one product.
- Type
- DevSecOps platform
- Created by
- GitLab Inc., open core (Community Edition under MIT)
- Hosting
- GitLab.com, or self-managed on your own servers
- In my stack
- Repositories and pipelines, especially self-hosted
What it is
GitLab hosts Git repositories and everything around them: issues and boards to plan work, merge requests to review changes, a built-in CI/CD engine, a container and package registry, environments to track deployments, and security scanning in the higher tiers.
Its biggest difference from GitHub is that it can be installed on your own servers. Many companies, public bodies and industrial groups run their own GitLab so that code and pipelines never leave their network. The same features are available on GitLab.com for teams that prefer a hosted service.
Why I use it
Everything in one place. Code, review, pipelines, images and deployments are linked: from a merge request you can see the pipeline, the scans and where the change was deployed.
Self-hosting when it matters. For clients whose code must stay on their own infrastructure, GitLab offers the full experience without a third-party cloud.
A strong CI/CD engine. Stages, rules, reusable templates, environments and manual approval steps are built in, and runners can live inside the client’s network.
Traceable releases. Merge request approvals, protected branches and deployment history show who approved and shipped what.
Where I use it
When a client’s code lives on GitLab, or must be hosted on their own servers, I set up repositories, review rules and pipelines there: test, build the Docker image, scan it, and deploy to Kubernetes, with production deployments approved by a person. The pipeline concepts are the same as on GitHub, so moving between the two is straightforward.
Best use cases
- Companies that self-host their code for security, compliance or sovereignty reasons.
- Teams that want one tool for planning, code, CI/CD and registry instead of several services.
- Pipelines with approvals, where production deployments need a named person’s sign-off.
- Runners inside private networks, to deploy to servers that aren’t reachable from the internet.
When I’d use something else
For open-source projects, or teams that want the largest ecosystem of integrations and community actions, GitHub is usually the more natural home. And running your own GitLab means updating, backing up and securing it yourself, which is only worth it when there is a real reason to self-host.
A small example
A .gitlab-ci.yml with three stages. Images are built on the main branch, and the production deployment waits for someone to start it, with GitLab recording who did.
stages: [test, build, deploy]
test:
stage: test
image: golang:1.26
script:
- go test ./...
build:
stage: build
image: docker:27
services: [docker:27-dind]
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy-production:
stage: deploy
script:
- ./deploy.sh "$CI_COMMIT_SHORT_SHA"
environment: production
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual # a person clicks "deploy", and GitLab records who