In this post, I am going to demonstrate the installation of GitLab. With GitLab, we can host our own repositories at a central place with the ease of the Git features.
To start our own GitLab instance, we will create a machine on CloudSigma. CloudSigma offers resource scaling which will make it very simple to increase the resources in case the organisation demands an increase.
First, I am creating a machine with the following configuration:
- 20 GHz CPU
- 16 GB RAM
- 100 GB SSD
I have installed Ubuntu 18.04 LTS on my SSD. After that, I have attached a static IP on the machine so that even if I stop and start the machine, the IP will remain the same. Having a static IP is really important if we plan to connect the IP to a domain name since we would need to give it in the DNS configuration.
Further, we connect to the machine using SSH and perform the following operations on it. We can use tools like Putty, MobaXterm to establish an SSH connection.
Now that I am connected to the machine, I will start the installation procedure.
First, I am going to update the apt-get GitLab repositories. It downloads the package lists from the repositories and updates them to get information on the newest versions of packages and their dependencies.
sudo apt-get update
Next, after updating the package list, I will install curl, openSSH-server and ca-certificates.
- curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is able to work without user interaction.
- OpenSSH is a suite of security-related network-level utilities based on the Secure Shell (SSH) protocol, which help to secure network communications via the encryption of network traffic over multiple authentication methods and by providing secure tunneling capabilities.
- ca-certificates are PEM files of CA certificates to allow SSL-based applications to check for the authenticity of SSL connections.
sudo apt-get install -y curl openssh-server ca-certificates
Next, for a mailing solution, we will install Postfix. It is the tool that will help sending notification emails, adding member mails, etc.
sudo apt-get install -y postfix
After that, during the installation, on the configuration screen, select ‘Internet Site’ as the mail server configuration type. With these settings, Mail is sent and received directly using SMTP.
On the next screen, it will ask you for the server’s external DNS name. That is why, I am entering my hostname – FQDN.
Now, I am going to add the GitLab package repository.
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
After adding the package GitLab repository, I will install the GitLab package. I will change the EXTERNAL_URL to the URL from where I want to access the GitLab instance. In this case, it will be my static IP address. Installation will take care of the configuration and start GitLab at that URL.
Next, change http://gitlab.example.com to the Domain URL or the IP address.
sudo EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ee
After the installation is complete, go to the URL and it will ask to set a password.
After you have set the password, confirmation would be shared that the password has been changed.
Login with username as ‘root’ and password as the one you have set.
Following this step, home screen with features of Creating a project, Creating a Group, Adding people and Configuring the GitLab would be displayed.
Create a Project
I can choose a Project name and add some description to it. For example, I can choose a Visibility level from Public, Internal or Private. However, there are other methods of creating a Project. Some of those include creating a Project from a template and Importing Project from other services like GitHub.com, BitBucket, Google Code, etc.
After the Project has been created, commands would be shown to configure CLI.
Create a Group
I can simply give a group path, name, description, avatar and visibility level. After I created the group, I can add members to the group with varying roles for them to contribute.
Finally, Admin area contains all the configuration settings, monitoring tools, notification tools, management of abuse reports, appearance, etc. Consequently, these settings help in personalizing the GitLab instance and giving it a business identity.
Et Voilà! Your personal GitLab repository is up and running.
- Removing Spaces in Python - March 24, 2023
- Is Kubernetes Right for Me? Choosing the Best Deployment Platform for your Business - March 10, 2023
- Cloud Provider of tomorrow - March 6, 2023
- SOLID: The First 5 Principles of Object-Oriented Design? - March 3, 2023
- Setting Up CSS and HTML for Your Website: A Tutorial - October 28, 2022