GitLab is a management platform for Git repositories that provides integrated features like continuous integration, issue tracking, team support, and wiki documentation.
- The GitLab Docker images are monolithic images of GitLab running all the necessary services in a single container.
- Before you install GitLab, be sure to review the system requirements. The system requirements include details about the minimum hardware to support GitLab.
- Minimum hardware requirements:
- 4 GB of RAM
- 4 cores of CPU
-
Before setting everything else, create a directory where the configuration, logs, and data files will reside. Ensure that the directory exists and appropriate permission have been granted.
$ mkdir -vp ~/docker/gitlab/{data,logs,config}
-
Modify the
.env
file, you can fine tune these configurations to meet your requirements.GITLAB_IMAGE=gitlab/gitlab-ce:15.3.1-ce.0 GITLAB_HOME=~/docker/gitlab # Gitlab mount path, the GitLab container uses host mounted volumes to store persistent data. GITLAB_HOSTNAME=gitlab.example.com # Domain name or public IP address. GITLAB_PORT_22=22 # SSH port, port 22 cannot be used because it conflicts with the host. GITLAB_PORT_80=80 # Nginx http port. GITLAB_PORT_443=443 # Nginx https port. GITLAB_SHM_SIZE=256m
-
Make sure you are in the same directory as docker-compose.yml and start GitLab, the initial startup time is relatively long, please wait patiently:
$ docker-compose up -d
-
Modify the
${GITLAB_HOME}/config/gitlab.rb
file according to your requirements.external_url 'http://gitlab.example.com' gitlab_rails['gitlab_ssh_host'] = 'gitlab.example.com' gitlab_rails['gitlab_shell_ssh_port'] = 22
-
Reboot gitlab container
$ docker-compose restart
-
Visit the GitLab URL, and log in with username
root
and the password from the following command:$ docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
The password file will be automatically deleted in the first reconfigure run after 24 hours.
-
If something else goes wrong, for more detailed tutorial can be found on the GitLab Website