In this video, I self-host GitLab in my HomeLab with Docker using my Boilerplates template, apply resource-friendly optimizations, and harden the instance post-install. I also show how I organize deployments and secrets in Projects and Groups, use the glab CLI, and manage updates with pipelines.
Instructions#
Generate a Docker Compose GitLab setup via Boilerplates#
boilerplates compose list
boilerplates compose generate gitlab
cd gitlab
docker compose up -d
Retrieve the initial root password#
docker exec gitlab grep 'Password: ' /etc/gitlab/initial_root_password
Post-install hardening#
- Deactivate sign-ups (public instances): Admin Area → Settings → General → Sign-up restrictions
- Change the initial root password: Profile icon → Edit profile → Password
- Enable two-factor authentication (2FA): Profile icon → Edit profile → Two-Factor Authentication
Performance optimizations#
- The Boilerplates template uses smart defaults and resource-friendly settings to trim memory usage (observed reductions from ~7 GiB down to ~3 GiB in small setups; thanks to nucez from the Discord community).
- Use the provided defaults first; tune further based on your host resources and workload.
GLab CLI quickstart#
Install GLab CLI#
Check out: https://docs.gitlab.com/editor_extensions/gitlab_cli/#installation
Authenticate#
- Create a Personal Access Token: Profile → Access tokens (for admin/testing, enable all scopes carefully).
- Login with glab:
glab --help
glab auth --help
glab auth login
# Select: GitLab Self-Managed or GitLab Dedicated
# Host: your instance (e.g., http://localhost or https://gitlab.example.com)
# Use SSH for Git, HTTP for API (when behind Traefik HTTPS)
References#
- Boilerplates (templates): http://github.com/ChristianLempa/boilerplates/
- GitLab install options: https://about.gitlab.com/install/
- GitLab pricing overview: https://about.gitlab.com/pricing/
- GitLab Community Edition: https://gitlab.com/rluna-gitlab/gitlab-ce
- glab CLI: https://docs.gitlab.com/editor_extensions/gitlab_cli/
- Traefik tutorial: https://youtu.be/-hfejNXqOzA
- Authentik tutorial: https://youtu.be/N5unsATNpJk