리눅스

우분투 24.04에서 GitLab를 설치하는 방법

변군이글루 2025. 10. 14. 12:37
반응형

우분투 24.04에서 GitLab를 설치하는 방법

테스트 환경

운영체제 정보

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.2 LTS
Release:        24.04
Codename:       noble

GitLab 설치

시스템 업데이트

sudo apt update

필수 패키지 설치

sudo apt install debian-archive-keyring
sudo apt install -y \
  curl \
  gnupg \
  apt-transport-https

GPG 키 추가

curl -fsSL https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey \
  | gpg --dearmor > /usr/share/keyrings/gitlab_gitlab-ee-archive-keyring.gpg

저장소 설정 (sources.list 파일 추가)

  • GPG 키와 함께 GitLab EE 저장소를 APT 소스에 등록합니다.
sudo tee /etc/apt/sources.list.d/gitlab_gitlab-ee.list <<EOF
deb [signed-by=/usr/share/keyrings/gitlab_gitlab-ee-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu $(lsb_release -cs 2>/dev/null) main
deb-src [signed-by=/usr/share/keyrings/gitlab_gitlab-ee-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu $(lsb_release -cs 2>/dev/null) main
EOF

APT 캐시 갱신

sudo apt update

GitLab EE 설치

sudo apt install -y gitlab-ee
  • 이제 GitLab EE가 설치됩니다.

GitLab EE

GitLab EE 버전 정보

cat /opt/gitlab/version-manifest.txt | head -n 1
gitlab-ee 18.4.2
728x90

GitLab 설정 (gitlab.rb) 및 구성 반영

  • /etc/gitlab/gitlab.rb 파일을 열어 기본 설정을 수정
vim /etc/gitlab/gitlab.rb
external_url "https://gitlab.scbyun.com"
# Let’s Encrypt 사용 시:
letsencrypt['enable'] = true

설정 변경을 적용하려면 아래 명령을 실행합니다.

sudo gitlab-ctl reconfigure
  • Omnibus 패키지 기반의 GitLab 서비스를 구성하고 필요한 설정을 자동으로 적용합니다.

GitLab 서비스 상태 확인

sudo gitlab-ctl status

웹 접속 및 초기 로그인

  • 웹 브라우저로 external_url에 설정한 주소로 접속합니다.
https://gitlab.scbyun.com
  • 최초 로그인 사용자명은 root입니다.
  • 초기 비밀번호는 /etc/gitlab/initial_root_password 파일에 저장되어 있습니다.
cat /etc/gitlab/initial_root_password | grep "^Password"
Password: +1hCFZ50M3aYcSpGTIXT31xeylcaUbIPmS0cDlnkC9w=
더보기

---

cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: +1hCFZ50M3aYcSpGTIXT31xeylcaUbIPmS0cDlnkC9w=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours

---

GitLab EE

 

참고URL

- GitLab Documentation : Installation instructions(manual-deb)

- GitLab Documentation : Reset user passwords

 

728x90
반응형