How to install Gitlab CE Server on OpenSUSE Leap 15.3

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 the OpenSUSE Leap 15.3. We will install the GitLab CE using the ‘omnibus’ package provided by GitLab.

# Prerequisites

  • Updated OpenSUSE Leap 15.3 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

# Table of Content

  1. Ensure that the server packages are up to date
  2. Installing and configuring the necessary dependencies
  3. Add the GitLab package repository and install the package
  4. Fix for the GitLab “Unable to locate package gitlab-ce” on Debian 11
  5. Configuring Gitlab CE
  6. Accessing Gitlab CE

# 1. Ensure that the server packages are up to date

Before proceeding let us update our Centos 8 server using this command:

sudo zypper ref
sudo zypper update -y

# 2. Install and configure the necessary dependencies

Before proceeding let’s ensure that the pakages needed are installed. Use this command:

sudo zypper install curl openssh perl vim

Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd

sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd

Open HTTP, HTTPS and SSH access in the system firewall. This is an optional step, and you can skip it if you intend to access GitLab only from your local network.

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.

sudo zypper install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

During Postfix installation a configuration screen may appear. Select ‘Internet Site’ and press enter. Use your server’s external DNS for ‘mail name’ and press enter. If additional screens appear, continue to press enter to accept the defaults.

# 3. Add the GitLab package repository and install the package

Add the GitLab package repository.

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

Next, install the GitLab package. Make sure you have correctly set up your DNS, and change https://gitlab.citizix.com to the URL at which you want to access your GitLab instance. Installation will automatically configure and start GitLab at that URL.

For https:// URLs, GitLab will automatically request a certificate with Let’s Encrypt, which requires inbound HTTP access and a valid hostname. You can also use your own certificate or just use http:// (without s).

If you would like to specify a custom password for the initial administrator user (root), check the documentation. If a password is not specified, a random password will be automatically generated.

sudo EXTERNAL_URL="https://gitlab.example.com" zypper install gitlab-ce

# Browse to the hostname and login

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.

# 5. 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:

external_url 'http://gitlab.citizix.com'

Save & and run the reconfiguration script

sudo gitlab-ctl reconfigure

Wait for the configuration script to finish. You should see something similar to this:

Recipe: monitoring::alertmanager
  * runit_service[alertmanager] action restart (up to date)
Recipe: monitoring::postgres-exporter
  * runit_service[postgres-exporter] action restart (up to date)
Recipe: monitoring::grafana
  * runit_service[grafana] action restart (up to date)

Running handlers:
Running handlers complete
Chef Infra Client finished, 189/1108 resources updated in 02 minutes 28 seconds
gitlab Reconfigured!

# 6. 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 as shown below:

Gitlab CE Sign in 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.

sudo cat /etc/gitlab/initial_root_password

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!

Last updated on Mar 20, 2024 17:19 +0300
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy