How to setup GitLab on Ubuntu 22.04?

#apt update 
# apt install ca-certificates curl openssh-server tzdata perl
# cd /tmp 
# curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab- ce/script.deb.sh
# less /tmp/script.deb.sh 
# bash /tmp/script.deb.sh
# apt install gitlab-ce

To check Firewall status

# ufw status 
# sudo ufw allow http  
# sudo ufw allow https
# sudo ufw allow OpenSSH

Editing the GitLab Configuration File

# vim /etc/gitlab/gitlab.rb
external_url 'https://gitlab.example.com' # To setup ip address and domain
letsencrypt['contact_emails'] = ['admin@gitlab.example.com'] # To setup email address
# sudo gitlab-ctl reconfigure

Use this password for login gitlab

# cat /etc/gitlab/initial_root_password

Open in any browser and access Gitlab

http://gitlab.example.com or http://192.168.0.105

Access GitLab Dashboard

If you want to change your port number so that you can follow this step

# vim /etc/gitlab/gitlab.rb
# external_url 'http://gitlab.example.com:8085' 
# gitlab-ctl reconfigure
# ufw allow 8085 
#ufw reload
#ufw status
#netstat –tunlp | grep 8085

Leave a Reply

Your email address will not be published. Required fields are marked *