GitLab allows you to host an on-premise Git repository that can be accessed from either your local LAN or (if you have an available public IP address) from outside your company. GitLab is an open-source repository manager based on Rails developed by GitLab Inc. It is a web-based git repository manager that allows your team to collaborate on coding, testing, and deploying applications. GitLab provides several features, including wikis, issue tracking, code reviews, and activity feeds.
In this guide, we will install the GitLab CE on a Rocky/Alma Linux 9 server. We will install the GitLab CE using the ‘omnibus’ package provided by GitLab.
Related content:
Prerequisites
- Updated Rocky Linux 9 server
- Access to the internet
- Ensure that your server is at lease 4GB of RAM with more than 20GB of disk space and 2 CPUs
Ensure that the server packages are up to date
Before proceeding let us update our Rocky Linux server using this command:
|
|
Install common packages that will be essential
|
|
Install and configure the necessary dependencies
Before proceeding let"s ensure that the pakages needed are installed. Use this command:
|
|
Next, ensure that the ssh server is started and enabled to start on boot:
|
|
If you have firewall enabled, open up http and https traffic using this command:
|
|
Our Gitlab CE server will be sending emails. Let us install postfix for this purpose:
|
|
Then let"s enable and start the service:
|
|
Confirm that postfix was installed and started successfully:
|
|
Add the GitLab package repository and install the package
Add the GitLab package repository.
|
|
Next, install the GitLab package. We will use a custom domain to access our Gitlab instance. Ensure that you have mapped the DNS records for your domai to point to the server where you are installing Gitlab. Installation will automatically configure and start GitLab at that URL.
|
|
Configuring Gitlab CE
Now that gitlab is successfully installed, let"s configure it. The main configuration file can be found in the file/etc/gitlab/gitlab.rb
. Open the file (vim /etc/gitlab/gitlab.rb
) and confirm that the external url is set as defined during installation:
|
|
Save & and run the reconfiguration script
|
|
Wait for the configuration script to finish. You should see something similar to this:
|
|
Accessing Gitlab CE
Once the configuration is complete, Gitlab CE is available in the URL provided (In my case http://gitlab.citizix.com
. Ensure that the DNS entry for the URL is pointing to the server then access that url in the browser. You should be redirected to the login page.
Unless you provided a custom password during installation, a password will be randomly generated and stored for 24 hours in /etc/gitlab/initial_root_password
. Use this password with username root
to login.
|
|
Once logged in you can use the gitlab server to create and manange projects and repositories.
Conclusion
Congratulations, you now have your local GitLab up and running. You can now use your Gitlab CE Server to manage repositories and projects.
Have fun!