In this article we use EC2 instance on AWS with Ubuntu 24.04 Server.
First, update our ubuntu package
sudo apt update
Next, install some libraries that we need.
sudo apt install ca-certificates curl openssh-server postfix tzdata perl
Install Gitlab CE
Move to directory /tmp
cd /tmp
Get the repository for gitlab ce
curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
Run the bash script
sudo bash /tmp/script.deb.sh
Lastly, install the gitlab ce
sudo apt install gitlab-ce
Setup firewall
Check the status of UFW
sudo ufw status
Add some rules to allow http, https and OpenSSH
sudo ufw allow http
sudo ufw allow https
sudo ufw allow OpenSSH
Check the ufw status again
sudo ufw status
Editing the Gitlab configuration
Edit the gitlab configuration in
sudo nano /etc/gitlab/gitlab.rb
Edit this 2 below below to get domain name and ssl certificate from letsencrypt.
external_url 'https://gitlab.withenri.tech'
letsencrypt['contact_emails'] = ['studio@withenri.tech']
save the configuration with ctrl + x, choose Yes
and Enter
.
Lastly, run the gitlab-ctl to configure gitlab
sudo gitlab-ctl reconfigure
Just wait, the process will take times. If there is no error, we can access our gitlab instance with the domain name.
Root Password Gitlab
The default user for Administrator is root with password in
sudo cat /etc/gitlab/initial_root_password
this file will deleted in 24 our after installation of gitlab.
Administrator UI
Access our instance with domain name (https://gitlab.withenri.tech).
Enter username with root and password from /etc/gitlab/initial_root_password
.
Change the root password with click profile picture, choose edit profile
and choose Password
.
That's it.
Hopefully this article helps you!
Top comments (0)