gitlab | LinuxHostSupport Linux Tutorials and Guides Thu, 06 Apr 2023 10:10:59 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to Install GitLab on AlmaLinux 9 https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/ https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/#respond Sun, 30 Apr 2023 17:30:00 +0000 https://linuxhostsupport.com/blog/?p=1774 In this tutorial we are going to show you in step-by-step detail how to install Gitlab on AlmaLinux 9 OS. GitLab is open-source software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continous Integration, Continous Delivery) which makes the work of developers and […]

The post How to Install GitLab on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
In this tutorial we are going to show you in step-by-step detail how to install Gitlab on AlmaLinux 9 OS.

GitLab is open-source software written in Ruby, Go and JavaScript operated by GitLab Inc. GitLab offers a wide range of features such as CI/CD (Continous Integration, Continous Delivery) which makes the work of developers and administrators straightforward and simple.

Installing GitLab on AlmaLinux 9 is a straightforward process that may take up to 10 minutes. Let’s get started!

Prerequisites

  • A VPS with at least 4GB of RAM (Our NVMe 4 VPS plan)
  • Fresh install of AlmaLinux 9 as OS
  • Valid domain pointed to the servers IP address
  • User privileges: root or non-root user with sudo privileges

Step 1. Update the System

Update the system packages to their latest version available before installing anything on a fresh server.

sudo dnf update -y && sudo dnf upgrade -y

Step 2. Install GitLab Dependencies

To install GitLab required package dependencies execute the following command:

sudo dnf install curl python3-policycoreutils git policycoreutils libxcrypt-compat gnupg2 git-core zlib zlib-devel gcc-c++ patch readline readline-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl tar sqlite-devel ruby ruby-devel -y

Step 3. Add GitLab Repository

First we will add the GitLab repo since it is not added by default in the AlmaLinux 9. Open the file /etc/yum.repos.d/gitlab_gitlab-ce.repo with your favorite editor and paste the following lines of code:

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ce-source]

name=gitlab_gitlab-ce-source baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS repo_gpgcheck=1 gpgcheck=1 enabled=1 gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300

Save the file, close it and update the system

sudo dnf update -y

Step 4. Install GitLab

Now, when the repo is added we can install GitLab with the following command:

sudo dnf install gitlab-ce -y

After successfull installation start the GitLab service:

sudo gitlab-ctl start

You should receive the following output:

[root@host]# sudo gitlab-ctl stop
ok: down: alertmanager: 0s, normally up, want up
ok: down: gitaly: 0s, normally up
ok: down: gitlab-exporter: 0s, normally up
ok: down: gitlab-kas: 0s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 1s, normally up
ok: down: nginx: 0s, normally up
ok: down: node-exporter: 1s, normally up
ok: down: postgres-exporter: 0s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 1s, normally up
ok: down: puma: 0s, normally up
ok: down: redis: 1s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: sidekiq: 0s, normally up
[root@host gems]# sudo gitlab-ctl start
ok: run: alertmanager: (pid 53445) 0s
ok: run: gitaly: (pid 53452) 0s
ok: run: gitlab-exporter: (pid 53469) 1s
ok: run: gitlab-kas: (pid 53473) 0s
ok: run: gitlab-workhorse: (pid 53490) 1s
ok: run: logrotate: (pid 53499) 0s
ok: run: nginx: (pid 53512) 0s
ok: run: node-exporter: (pid 53514) 1s
ok: run: postgres-exporter: (pid 53520) 0s
ok: run: postgresql: (pid 53534) 1s
ok: run: prometheus: (pid 53543) 0s
ok: run: puma: (pid 53559) 1s
ok: run: redis: (pid 53567) 0s
ok: run: redis-exporter: (pid 53573) 0s
ok: run: sidekiq: (pid 53587) 1s

To check the status of GitLab service execute the following command:

sudo gitlab-ctl status

You should receive the following output:

[root@host]# sudo gitlab-ctl status
down: alertmanager: 1s, normally up, want up; run: log: (pid 14903) 3685s
run: gitaly: (pid 53452) 33s; run: log: (pid 14315) 3889s
run: gitlab-exporter: (pid 53469) 33s; run: log: (pid 14808) 3703s
run: gitlab-kas: (pid 53473) 32s; run: log: (pid 14582) 3864s
run: gitlab-workhorse: (pid 53490) 32s; run: log: (pid 14731) 3724s
run: logrotate: (pid 53499) 31s; run: log: (pid 14247) 3905s
run: nginx: (pid 53893) 1s; run: log: (pid 14743) 3718s
run: node-exporter: (pid 53514) 31s; run: log: (pid 14785) 3710s
run: postgres-exporter: (pid 53520) 30s; run: log: (pid 14956) 3680s
run: postgresql: (pid 53534) 30s; run: log: (pid 14457) 3873s
run: prometheus: (pid 53543) 29s; run: log: (pid 14865) 3692s
run: puma: (pid 53559) 29s; run: log: (pid 14666) 3736s
run: redis: (pid 53567) 28s; run: log: (pid 14283) 3896s
run: redis-exporter: (pid 53573) 28s; run: log: (pid 14838) 3697s
run: sidekiq: (pid 53587) 28s; run: log: (pid 14683) 3732s

To check the GitLab ports execute the following command:

netstat -tunlp | grep gitlab

You should receive the following output:

[root@host]# netstat -tunlp | grep gitlab
tcp6       0      0 ::1:8153                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8155                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8154                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8151                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:8150                :::*                    LISTEN      53473/gitlab-kas
tcp6       0      0 ::1:9229                :::*                    LISTEN      53490/gitlab-workho

Step 5. Access GitLab with Domain

To access the GitLab in the browser via domain name, you need to configure it in the following file: /etc/gitlab/gitlab.rb.

Open it with your favore browser and edit the following lines by entering your domain name and setting your strong root password:

external_url 'http://YourDomainHere'

gitlab_rails['initial_root_password'] = 'YourStrongPasswordHere'

Save the file, close it and execute the following command:

gitlab-ctl reconfigure

After reconfiguring the application you can access GitLab at http://YourDomain using the root as username and your strong password you set above.

Congratulations! You successfully installed and configured GitLab on AlmaLinux 9 OS. If you have any difficulties completing this setup, feel free to contact our technical support and they will help you in no time. We are available 24/7. All you need to do is to sign up for one of our NVMe VPS plans and submit a support ticket.

If you liked this post on how to install GitLab on AlmaLinux 9, please share it with your friends on the social networks or simply leave a reply below. Thanks.

The post How to Install GitLab on AlmaLinux 9 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-almalinux-9/feed/ 0
How to Install GitLab on Debian 11 https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/ https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/#comments Thu, 30 Dec 2021 18:30:00 +0000 https://linuxhostsupport.com/blog/?p=1609 GitLab is a self-hosted git repository management system. It is a Git repository manager providing wiki, issue-tracking, and continuous integration and deployment. Because of the advantage that brings development, operations, and security teams into a single application, GitLab is now widely used across the globe. Installing GitLab on Debian 11 is a fairly easy task […]

The post How to Install GitLab on Debian 11 appeared first on LinuxHostSupport.

]]>
GitLab is a self-hosted git repository management system. It is a Git repository manager providing wiki, issue-tracking, and continuous integration and deployment. Because of the advantage that brings development, operations, and security teams into a single application, GitLab is now widely used across the globe. Installing GitLab on Debian 11 is a fairly easy task and it should take around 15 minutes for the installation. Today we will show you how to install GitLab on your Debian 11 VPS.

Prerequisites

  • A Debian 11 VPS.
  • At least 4GB of RAM.
  • SSH access with sudo privileges, or root access.

In addition, it is recommended to have at least 2GB of SWAP memory, even if you have enough available RAM.

Step 1. Update System

First of all, we need to log in to our Debian 11 VPS through SSH:

ssh master@IP_Address -p Port_Number

Replace “master” with a user that has sudo privileges or root if necessary. Additionally, replace “IP_Address” and “Port_Number” with your server’s respective IP address and SSH port number. Next, let’s make sure that we’re on Debian 11. You can do that like this:

$ lsb_release -a

You should get this as the output:

Distributor ID: Debian
Description: Debian GNU/Linux 11 (bulleseye)
Release: 11
Codename: bullseye

Then, run the following command to make sure that all installed packages on the server are updated to their latest available versions:

$ sudo apt update && apt upgrade

Step 2. Add Repository

There are two ways to install GitLab on Debian 11; we can install it using the repository or the deb package. In this tutorial, we are going to use the repository to install GitLab on Debian 11.

At this step, we will use the repository for Debian 10, because the repository for Debian 11 is not available at this time of writing.

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

The command above will download the GitLab repository to the APT source list file at /etc/apt/sources.list.d/gitlab_gitlab-ce.list
Since the GitLab package source file is for Debian 10, we need to modify these lines.

deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ bullseye main

Replace ‘bullseye’ with ‘buster’ by running this command.

$ sudo sed -i 's/bullseye/buster/g' /etc/apt/sources.list.d/gitlab_gitlab-ce.list

Now, we need to update the repository.

$ sudo apt update -y

Step 3. Install GitLab

After adding the repository, we can install GitLab Community Edition by running this command:

$ sudo apt install gitlab-ce -y
installing gitlab on debian 11

Once the installation is finished, we can run this command to reconfigure it and run GitLab

$ sudo gitlab-ctl reconfigure

At this point, you should be able to access GitLab at http://YOUR_SERVER_IP_ADDRESS/ and log in as root using the password in /etc/gitlab/initial_root_password

Please note that the password in /etc/gitlab/initial_root_password is valid only for 24 hours. You can log in and change your password immediately or reset it using this command below

$ sudo gitlab-rake "gitlab:password:reset[root]"

Step 4. Configure GitLab

GitLab has been successfully installed, and it is time to configure it.

Secure GitLab Server with Let’s Encrypt SSL Certificate

By default, when installing GitLab without passing an environment for the EXTERNAL_URL value. The installation will set http://gitlab.example.com as the external URL. If we want to access our GitLab installation through a domain or subdomain name and install an SSL certificate for it, we can edit the configuration file /etc/gitlab/gitlab.rb

Open /etc/gitlab/gitlab.rb and find external_url line

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

Replace it with

external_url 'https://gitlab.yourdomain.com'

Make sure that your domain or subdomain DNS record is pointing to your GitLab server.

Then, still in the same file, make sure these are uncommented and modified as follows.

letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ['you@yourdomain.com'] 
letsencrypt['auto_renew'] = true

Save the file then exit.

Now, we need to reconfigure Omnibus GitLab, and we need to do this every time we edit /etc/gitlab/gitlab.rb file.

$ sudo gitlab-ctl reconfigure

Run the command above and wait, once completed you the SSL certificate from Let’s Encrypt should be installed and you should be able to access your GitLab at https://YOUR_DOMAIN_NAME.COM

Email Configuration

By default, GitLab should be able to send its email using sendmail. However, for better email deliverability, you should consider using an SMTP server for this purpose. With the SMTP credentials, we can configure GitLab to use SMTP to send its email.

Open /etc/gitlab/gitlab.rb

$ sudo nano /etc/gitlab/gitlab.rb

Then, find the following

# gitlab_rails['smtp_enable'] = true
# gitlab_rails['smtp_address'] = "smtp.server"
# gitlab_rails['smtp_port'] = 465
# gitlab_rails['smtp_user_name'] = "smtp user"
# gitlab_rails['smtp_password'] = "smtp password"
# gitlab_rails['smtp_domain'] = "example.com"
# gitlab_rails['smtp_authentication'] = "login"
# gitlab_rails['smtp_enable_starttls_auto'] = true
# gitlab_rails['smtp_tls'] = true
# gitlab_rails['smtp_pool'] = false
# gitlab_rails['smtp_openssl_verify_mode'] = 'none'
# gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
# gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"

You need to uncomment the lines and use your SMTP credentials to make it work. Also, make sure that your SMTP password does not contain any string delimiters used in a YAML file, otherwise, it will not work. Save your changes then exit the file.

As mentioned earlier, we need to reconfigure Omnibus GitLab after editing the gitlab.rb file.

$ sudo gitlab-ctl reconfigure

And that’s it. From now on, GitLab will send emails through SMTP which will result in better email deliverability if compared to using sendmail. You can log in to your GitLab website at https://yourdomain.com and start using it.

configuring gitlab on debian 11

Congratulations! You have successfully installed GitLab on Debian 11.

Of course, if you are one of our Debian Hosting customers, you don’t have to install GitLab on Debian 11 yourself – simply ask our admins, sit back, and relax. Our admins will install GitLab on Debian 11 for you immediately without any additional fee, along with many useful optimizations that we can do for you. Managing a GitLab website is not just about the installation, we can help you with optimizing your GitLab installation if you have a VPS with us.

PS. If you liked this post about how to install GitLab on Debian 11, please share it with your friends on the social networks using the share buttons below, or simply leave a comment in the comments section. Thanks.

The post How to Install GitLab on Debian 11 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-debian-11/feed/ 3
How to Install GitLab on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-gitlab-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-gitlab-on-ubuntu-16-04/#respond Wed, 22 Aug 2018 08:33:28 +0000 https://linuxhostsupport.com/blog/?p=650 One of the alternatives for Github is the Gitlab git repository manager. In this tutorial, we are going to show you how to install GitLab (Community Edition) on Ubuntu 16.04. Gitlab offers outstanding features like repository branching, merging, file locking and tagging, time tracking and many more, so you can take full advantage of it. […]

The post How to Install GitLab on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
One of the alternatives for Github is the Gitlab git repository manager. In this tutorial, we are going to show you how to install GitLab (Community Edition) on Ubuntu 16.04.
Gitlab offers outstanding features like repository branching, merging, file locking and tagging, time tracking and many more, so you can take full advantage of it.
Gitlab has self-hosted and paid version (Enterprise Edition) and self-hosted and free (Community Edition). In this article, we will install the Community Edition by using the ‘omnibus’ package offered by official Gitlab.

Prerequisites

We will assume that you have a VPS with freshly installed Ubuntu 16.04. Other then the Ubuntu for recommended hardware requirements you will need:

2 cores
4GB of RAM
Root privileges

For more information about hardware requirements, you can check the official Gitlab page.

Install Required Packages

Before we begin the installation of GitLab, we need to be sure that Ubuntu already has the necessary packages installed to run GitLab. To install the necessary dependencies, we need to execute the command below:

sudo apt update
sudo apt install curl openssh-server ca-certificates

Also, we need to install Postfix MTA for notifications.

sudo apt install postfix

A configuration screen may appear during Postfix installation. Choose the “Internet Site” and press Enter. After this, need to provide a mail server name or IP address to configure how the system will send mail. You can proceed if additional screens appear and accept the default values.

Install and configure Gitlab packages

Now that dependencies are set, we can proceed with installing GitLab. This is a direct process that uses an installation script named ‘omnibus’ to configure your system with GitLab repositories.

We will add the repository for the GitLab package by running the following command:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash

Next step is to install the GitLab package. In the following command, you need to change the URL from http://your_domain.com to the domain you will use to access the GitLab instance. The domain you will set it will be configured automatically by the script we are using. After the installation, there is an additional configuration for setting up the HTTPS protocol.

sudo EXTERNAL_URL="http://your_domain.com" apt install gitlab-ee

If the upper instruction was carefully followed, now you have installed GitLab CE on your Ubuntu 16.04. server.

First browsing on your domain

When you access your_domain.com for the first time at your favorite browser, you will be redirected to the reset password screen. Of course in this screen, you need to enter your admin password and when you will finish with this, you will be redirected to the login screen again so you can log in for the first time. The username will be set by default as root, so you can use it when you try to log in.

Generate Let’s encrypt SSL certificates

In this section, we will install the free Let’s Encrypt SSL certificate for our newly installed GitLab. In order to generate a Let’s Encrypt Certificate, we will use the letsencrypt command tool.

To install the letsencrypt command-line tool on Ubuntu 16.04, run the following command:

sudo apt install letsencrypt

Using the below command you can generate a new Let’s Encrypt SSL certificate for your domain.

sudo letsencrypt certonly --standalone -d your_domain.com

After executing this command you need to enter your email address. Next step you can type ‘A’ so you Agree with the Terms of Service. After accepting on ToS there is one more step which is optional. You can choose ‘Y’ or ‘N’ and wait for the script to finish the installation of the SSL certificate for your_domain.com.

Please note: in some situations installation of the Let’s Encrypt SSL certificate may be not successful. So, you need to stop the application using sudo systemctl stop gitlab-runsvdir.service and re-run the letsencrypt tool. Once the script will finish you can start the GitLab application using sudo systemctl start gitlab-runsvdir.service.

Enable HTTPS for GitLab

Since we have generated an SSL certificate with Let’s Encrypt, in this step we will enable HTTPS connection and forward from all HTTP to HTTPS.

We will configure GitLab by editing the configuration file ‘gitlab.rb’ as an example shown below:

sudo nano /etc/gitlab/gitlab.rb

Change the HTTP to HTTPS at external_url:

external_url 'https://your_domain.com'

Modify and uncomment this configuration as the following example:

letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ['sammy@yourdomain.com']
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/letsencrypt/live/your_domain.com/fullchain.pem"
nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/your_domain.com/privkey.pem"

After completing the modifications, save the changes and exit the nano.

Please note: You need to change your_domain.com with the GitLab domain that you used to configure.

The last step is to execute the following command and apply the GitLab configuration:

sudo gitlab-ctl reconfigure

In summary, we installed GitLab CE on Ubuntu 16.04. Also, we installed Let’s Encrypt SSL and configure GitLab to work on HTTPS. For more information about GitLab feel free to look at their official website documentation at https://docs.gitlab.com/


Install GitLab on Ubuntu 16.04 You don’t have to install GitLab on your Ubuntu 16.04 VPS if you use our server administration services, in which case you can simply ask our expert Linux admins to install GitLab for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on How to Install GitLab on Ubuntu 16.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

The post How to Install GitLab on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-gitlab-on-ubuntu-16-04/feed/ 0