RHEL BasedRocky Linux

How To Install GitLab on Rocky Linux 10

Install GitLab on Rocky Linux 10

GitLab has emerged as one of the most comprehensive DevOps platforms available today, offering everything from version control to continuous integration and deployment in a single, unified interface. When paired with Rocky Linux 10, organizations gain a robust, enterprise-grade foundation for their development workflows. This guide walks you through the complete installation process, ensuring you have a fully functional GitLab instance running on your Rocky Linux 10 server.

Rocky Linux 10 provides the perfect enterprise-level operating system for hosting GitLab, combining Red Hat Enterprise Linux compatibility with community-driven development. Whether you’re setting up GitLab for a small development team or planning a large-scale enterprise deployment, this comprehensive tutorial covers every aspect of the installation process. By the end of this guide, you’ll have GitLab Community Edition running smoothly on your Rocky Linux 10 system, ready to manage your development projects efficiently.

Understanding GitLab and Rocky Linux 10

What is GitLab

GitLab represents a complete DevOps software package that revolutionizes how development teams collaborate and deploy applications. Unlike traditional version control systems, GitLab integrates source code management, continuous integration, continuous deployment, issue tracking, and code review capabilities into a single platform. This unified approach eliminates the need for multiple tools and reduces complexity in development workflows.

The platform offers two main editions: GitLab Community Edition (CE) and GitLab Enterprise Edition (EE). GitLab CE provides core functionality including Git repository management, issue tracking, merge requests, and basic CI/CD pipelines. Enterprise Edition extends these capabilities with advanced features like advanced security scanning, compliance management, and premium support options. For most organizations, GitLab CE offers sufficient functionality to manage complex development projects effectively.

GitLab’s architecture supports both cloud-hosted and self-hosted deployments. Self-hosting provides complete control over your data, customization options, and integration possibilities. This flexibility makes GitLab particularly attractive for organizations with strict security requirements or specific compliance needs.

Rocky Linux 10 Overview

Rocky Linux 10 stands as a premier enterprise-grade Linux distribution, designed as a community-driven alternative to Red Hat Enterprise Linux. Built from the same source code as RHEL, Rocky Linux maintains binary compatibility while providing free access to enterprise-level stability and security features. This compatibility ensures that applications and configurations designed for RHEL environments work seamlessly on Rocky Linux.

The distribution excels in enterprise environments due to its predictable release cycles, long-term support commitments, and extensive package ecosystem. Rocky Linux 10 includes modern kernel features, updated security frameworks, and optimized performance characteristics that make it ideal for hosting resource-intensive applications like GitLab. The operating system’s emphasis on stability and security aligns perfectly with GitLab’s requirements for reliable version control and CI/CD operations.

Rocky Linux’s community-driven development model ensures regular security updates, bug fixes, and feature enhancements without the licensing costs associated with commercial distributions. This approach provides organizations with enterprise-grade capabilities while maintaining cost-effectiveness and avoiding vendor lock-in scenarios.

System Requirements and Prerequisites

Hardware Requirements

GitLab requires substantial system resources to operate effectively, with memory being the most critical factor. A minimum of 4GB RAM is absolutely essential for running GitLab Community Edition, though this configuration only supports very small user groups. For production environments, 8GB RAM represents a more realistic minimum, providing adequate performance for teams of 10-25 users.

CPU requirements scale with user activity and repository size. A dual-core processor suffices for small installations, but quad-core or higher configurations significantly improve performance during peak usage periods. GitLab’s background job processing, including CI/CD pipeline execution and repository maintenance tasks, benefits from additional CPU cores.

Storage considerations extend beyond simple capacity requirements. GitLab stores repository data, artifacts, logs, and database information, with growth rates varying based on development activity. Plan for at least 50GB of available disk space for initial installations, with expansion capabilities for future growth. SSD storage dramatically improves GitLab performance, particularly during repository operations and database queries.

Network connectivity requirements include reliable internet access for package installations and updates. If planning to use GitLab’s container registry or CI/CD features with external services, ensure sufficient bandwidth to handle artifact transfers and deployment operations.

Software Prerequisites

A fresh Rocky Linux 10 installation provides the optimal foundation for GitLab deployment. While GitLab can coexist with other applications, dedicated server installations eliminate potential conflicts and resource competition. Ensure your Rocky Linux installation includes the latest security updates and kernel patches before proceeding with GitLab installation.

Administrative access through either root privileges or sudo capabilities is mandatory for GitLab installation and configuration. The installation process modifies system configurations, installs system services, and requires elevated permissions for proper setup. Verify sudo access by running basic system commands with elevated privileges.

Basic Linux system administration knowledge proves invaluable during GitLab installation and ongoing maintenance. Understanding file permissions, service management, and network configuration concepts helps troubleshoot potential issues and optimize GitLab performance. Familiarity with command-line operations and text editors streamlines the configuration process.

Git version control fundamentals knowledge enhances your ability to utilize GitLab effectively after installation. While not strictly required for installation, understanding Git concepts like repositories, branches, and merge operations helps you configure GitLab optimally for your development workflows.

Pre-Installation System Preparation

System Update Process

Begin GitLab installation by ensuring your Rocky Linux 10 system includes the latest packages and security updates. System updates prevent compatibility issues and security vulnerabilities that could affect GitLab operation. Execute a comprehensive system update using the DNF package manager, which serves as Rocky Linux’s primary package management tool.

Run the following command to update all installed packages:

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

This command combination updates package metadata, installs available updates, and upgrades packages to their latest versions. The -y flag automatically confirms update installations, streamlining the process for automated deployments. Allow sufficient time for this process, as update sizes vary based on your system’s current patch level.

After completing system updates, consider rebooting your server to ensure kernel updates take effect and all services restart with updated configurations. While not always necessary, rebooting provides a clean starting point for GitLab installation and eliminates potential issues from updated system libraries.

Installing Essential Dependencies

GitLab requires several system packages for proper installation and operation. These dependencies include network utilities, security policy tools, and SSH server capabilities. Installing these packages before GitLab installation prevents dependency resolution issues and ensures all required components are available.

Execute the following command to install essential dependencies:

sudo dnf install -y curl vim policycoreutils python3-policycoreutils git wget

Each package serves specific purposes in GitLab operation. Curl enables downloading GitLab packages and communicating with external services. Vim provides a capable text editor for configuration file modifications. Policycoreutils and python3-policycoreutils manage SELinux security policies, which GitLab requires for proper security integration. Git provides the underlying version control system that GitLab extends and enhances.

Wget offers an alternative download utility that proves useful for retrieving additional resources or troubleshooting network connectivity issues. While curl generally suffices for GitLab installation, having multiple download tools available simplifies troubleshooting scenarios.

SSH Service Configuration

SSH access enables remote GitLab administration and provides secure connectivity for Git operations. Most Rocky Linux installations include SSH server capabilities, but the service may require activation and configuration. Proper SSH setup ensures you can manage GitLab remotely and troubleshoot issues without physical server access.

Enable and start the SSH service using systemctl commands:

sudo systemctl enable sshd
sudo systemctl start sshd

The enable command configures SSH to start automatically during system boot, ensuring remote access remains available after server restarts. The start command immediately activates SSH service, providing immediate remote connectivity.

Verify SSH service status to confirm proper operation:

sudo systemctl status sshd

This command displays SSH service status, including active state, process information, and recent log entries. A properly configured SSH service shows “active (running)” status and displays listening port information.

GitLab Repository Configuration

Adding Official GitLab Repository

GitLab provides official package repositories for major Linux distributions, including Rocky Linux. Using official repositories ensures you receive authentic GitLab packages with proper security signatures and regular updates. The automated repository configuration script simplifies this process while maintaining security best practices.

Download and execute the official GitLab repository configuration script:

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

This command downloads the repository configuration script directly from GitLab’s package distribution service and executes it with elevated privileges. The script automatically detects your Rocky Linux version, configures appropriate repository settings, and imports necessary GPG signing keys.

The automated approach provides several advantages over manual configuration. It ensures proper repository URLs, maintains current GPG keys, and adapts to distribution-specific requirements automatically. Additionally, the script includes error checking and validation steps that prevent common configuration mistakes.

Monitor script execution for any error messages or warnings. Successful execution concludes with confirmation messages indicating repository activation and GPG key import completion. If network connectivity issues prevent script download, consider using manual repository configuration methods.

Manual Repository Configuration

Manual repository configuration provides greater control over repository settings and proves valuable in environments with restricted internet access or specific security requirements. This approach involves creating repository configuration files manually and importing GPG verification keys independently.

Create the GitLab repository configuration file:

sudo vim /etc/yum.repos.d/gitlab_gitlab-ce.repo

Add the following repository configuration content:

[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/10/$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

This configuration specifies the GitLab Community Edition repository for Rocky Linux 10, enables GPG signature verification, and configures SSL certificate validation. The multiple GPG key URLs ensure compatibility with different GitLab package signing practices over time.

Import GPG verification keys manually to validate package authenticity:

sudo rpm --import https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey

Verify repository configuration by listing available repositories:

dnf repolist

The GitLab repository should appear in the output, confirming successful configuration. If the repository doesn’t appear, review configuration file syntax and network connectivity to GitLab’s package servers.

GitLab Installation Process

Installing GitLab Community Edition

GitLab installation requires specifying your external URL during the package installation process. This URL determines how users access your GitLab instance and affects various configuration settings. Choose between domain-based URLs for production environments or IP-based URLs for development or internal deployments.

Install GitLab Community Edition with your specified external URL:

sudo EXTERNAL_URL="http://your-domain.com" dnf install -y gitlab-ce

Replace “your-domain.com” with your actual domain name or server IP address. Use HTTPS URLs if you plan to configure SSL certificates immediately after installation. The EXTERNAL_URL environment variable automatically configures basic GitLab settings during installation.

The installation process downloads approximately 1GB of package data and requires several minutes to complete. GitLab includes numerous components including Ruby runtime, PostgreSQL database, Redis cache, and Nginx web server. Progress indicators show download and installation status throughout the process.

During installation, GitLab automatically creates system users, initializes database schemas, and configures default settings. The process includes extensive dependency resolution and may install additional system packages required for GitLab operation.

Alternative Installation Methods

Direct RPM package installation provides an alternative for environments with limited internet connectivity or specific version requirements. Download GitLab RPM packages manually and install them using local package management commands.

Download the desired GitLab version from the official releases page:

wget https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/10/gitlab-ce-[version].el10.x86_64.rpm/download.rpm

Install the downloaded RPM package:

sudo rpm -ivh gitlab-ce-[version].el10.x86_64.rpm

This approach requires manual dependency resolution and may necessitate installing additional packages separately. Use this method only when standard repository installation isn’t feasible.

Offline installation scenarios require downloading all dependencies in advance and transferring them to the target system. Consider creating local repository mirrors for environments with multiple GitLab installations or restricted internet access.

GitLab Configuration and Setup

Initial GitLab Configuration

GitLab requires initial configuration after package installation to activate all services and prepare the system for user access. The reconfigure process initializes databases, generates configuration files, and starts all GitLab services. This step is crucial for proper GitLab operation and must complete successfully before accessing the web interface.

Execute the GitLab configuration process:

sudo gitlab-ctl reconfigure

This command reads configuration settings from /etc/gitlab/gitlab.rb and applies them across all GitLab components. The process typically requires 5-10 minutes and generates extensive output showing configuration progress for each service component.

Monitor the reconfigure output for error messages or warnings that might indicate configuration issues. Successful completion displays a summary of configured services and their operational status. If errors occur, review system logs and configuration file syntax before attempting to resolve issues.

The initial reconfigure uses default settings suitable for basic GitLab operation. Advanced configurations require modifying /etc/gitlab/gitlab.rb before running reconfigure commands. Always backup configuration files before making changes to prevent configuration loss.

Advanced Configuration Options

GitLab’s main configuration file (/etc/gitlab/gitlab.rb) contains hundreds of configuration options for customizing GitLab behavior. Email notification settings rank among the most commonly modified configurations, enabling GitLab to send notifications for various development activities.

Configure SMTP email settings by editing the configuration file:

sudo vim /etc/gitlab/gitlab.rb

Add or modify email configuration settings:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.your-domain.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "gitlab@your-domain.com"
gitlab_rails['smtp_password'] = "your-password"
gitlab_rails['smtp_domain'] = "your-domain.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_email_from'] = "gitlab@your-domain.com"

SSL certificate configuration enhances security by encrypting communications between users and your GitLab instance. GitLab supports various SSL implementation methods, including Let’s Encrypt integration and custom certificate installation.

After modifying configuration settings, apply changes by running:

sudo gitlab-ctl reconfigure

Database performance tuning becomes important for larger GitLab installations. The configuration file includes PostgreSQL optimization settings that improve performance based on available system resources and expected user loads.

Service Management

GitLab operates as a collection of interconnected services, each responsible for specific functionality. Understanding service relationships helps troubleshoot issues and optimize performance. The gitlab-ctl command provides comprehensive service management capabilities for monitoring and controlling GitLab components.

Check GitLab service status to verify proper operation:

sudo gitlab-ctl status

This command displays the operational status of all GitLab services, including process IDs, uptime information, and service states. Healthy GitLab installations show all services in “run” status with reasonable uptime values.

Individual service management commands provide granular control over GitLab components:

sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart

These commands affect all GitLab services simultaneously. For service-specific operations, append the service name to commands. For example, sudo gitlab-ctl restart nginx restarts only the web server component.

Firewall and Network Configuration

Firewall Rules Setup

Rocky Linux 10 includes firewalld as the default firewall management system, which blocks external access to most network services by default. GitLab requires specific firewall rules to enable web interface access and Git operations. Configure firewall rules to allow necessary traffic while maintaining security best practices.

Open HTTP and HTTPS ports for web interface access:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=22/tcp
sudo firewall-cmd --reload

These commands permanently add firewall rules for HTTP (port 80), HTTPS (port 443), and SSH (port 22) access. The permanent flag ensures rules persist across system reboots. The reload command activates new firewall rules immediately.

Verify firewall rule configuration:

sudo firewall-cmd --list-all

This command displays active firewall zones and their associated rules. Confirm that HTTP, HTTPS, and SSH services appear in the services list or that their corresponding ports appear in the ports list.

For GitLab installations using custom ports, specify exact port numbers instead of service names. Custom port configurations require corresponding updates to GitLab’s external URL settings to ensure proper operation.

Network Access Configuration

Domain name configuration provides professional appearance and simplifies user access to your GitLab instance. Configure DNS records to point your chosen domain name to your GitLab server’s IP address. Both A records for IPv4 addresses and AAAA records for IPv6 addresses may be necessary depending on your network configuration.

Create appropriate DNS records with your domain registrar or DNS hosting service:

Type: A
Name: gitlab (or your preferred subdomain)
Value: your-server-ip-address
TTL: 300 (or your preferred value)

IP address-based access works for development environments or situations where domain names aren’t available. Configure GitLab’s external URL using your server’s IP address, but be aware that some GitLab features may have limitations when using IP-based configurations.

Load balancer considerations become important for high-availability GitLab deployments. Configure load balancer health checks to monitor GitLab service availability and implement proper session persistence for consistent user experiences.

Initial GitLab Access and Setup

First-Time Access

After completing installation and configuration, access your GitLab instance through a web browser using the external URL specified during installation. GitLab automatically generates a temporary root password during the initial setup process, which you’ll need to retrieve before logging in.

Retrieve the automatically generated root password:

sudo cat /etc/gitlab/initial_root_password

This file contains the temporary password for GitLab’s root administrator account. Copy this password carefully, as you’ll need it for initial login. The password expires 24 hours after installation for security purposes.

Navigate to your GitLab URL in a web browser and log in using:

  • Username: root
  • Password: (the password from the initial_root_password file)

Upon successful login, GitLab prompts you to change the root password immediately. Choose a strong password that meets your organization’s security requirements. This password controls access to GitLab’s administrative functions and should be protected accordingly.

Install GitLab on Rocky Linux 10

Basic GitLab Configuration

GitLab’s admin area provides comprehensive configuration options for customizing your instance according to your organization’s needs. Access the admin area by clicking the wrench icon in the top navigation bar after logging in as root.

User management represents one of the most important initial configuration tasks. Create additional user accounts for your development team members, configure authentication settings, and establish user group hierarchies. GitLab supports various authentication methods including LDAP integration and OAuth providers.

Project creation workflows allow you to establish your first GitLab projects and begin using version control features. Create test projects to verify GitLab functionality and familiarize yourself with the interface before migrating existing repositories.

Security settings configuration includes enabling two-factor authentication, configuring password policies, and setting up security monitoring features. These settings help protect your GitLab instance against unauthorized access and security threats.

Post-Installation Tasks and Optimization

Performance Optimization

GitLab performance optimization involves tuning various system components to handle your expected user load efficiently. Memory usage optimization represents the most critical performance factor, as GitLab can consume significant RAM during peak usage periods.

Configure GitLab worker processes based on available system memory:

sudo vim /etc/gitlab/gitlab.rb

Adjust worker process settings:

unicorn['worker_processes'] = 4
unicorn['worker_memory_limit_min'] = "1024 * 1 << 20"
unicorn['worker_memory_limit_max'] = "1280 * 1 << 20"

These settings control the number of GitLab worker processes and their memory usage limits. More worker processes improve concurrent user handling but increase memory consumption. Balance these settings based on available system resources.

Background job configuration affects GitLab’s ability to process CI/CD pipelines, repository maintenance tasks, and notification delivery. Sidekiq handles these background operations and benefits from proper resource allocation.

Configure Sidekiq worker settings:

sidekiq['max_concurrency'] = 25
sidekiq['min_concurrency'] = 5

Database maintenance tasks help maintain GitLab performance over time. PostgreSQL requires regular maintenance operations including vacuum operations, index rebuilding, and statistics updates. GitLab includes automated maintenance features, but understanding these processes helps troubleshoot performance issues.

Security Hardening

SSL certificate installation encrypts communications between users and your GitLab instance, protecting sensitive information including passwords and source code. GitLab supports automated Let’s Encrypt certificate provisioning for domain-based installations.

Enable Let’s Encrypt automatic certificate provisioning:

letsencrypt['enable'] = true
letsencrypt['contact_emails'] = ['admin@your-domain.com']
external_url 'https://gitlab.your-domain.com'

Custom SSL certificate installation provides greater control over certificate sources and validation processes. This approach works well for organizations with existing certificate management infrastructure or specific certificate requirements.

User authentication methods beyond username/password combinations significantly improve GitLab security. Configure two-factor authentication requirements, integrate with existing LDAP or Active Directory systems, or implement OAuth authentication with trusted providers.

Backup strategy implementation ensures your GitLab data remains protected against hardware failures, accidental deletions, or security incidents. GitLab includes built-in backup utilities that create comprehensive backups of repositories, databases, and configuration files.

Troubleshooting Common Issues

Installation Problems

Repository access issues often stem from network connectivity problems or firewall restrictions. Verify internet connectivity and DNS resolution before attempting GitLab installation. Corporate firewalls may block access to GitLab’s package repositories, requiring proxy configuration or alternative installation methods.

Dependency conflicts occasionally occur when other software packages interfere with GitLab requirements. Review error messages carefully to identify conflicting packages and consider removing unnecessary software or using alternative package versions.

Permission-related problems typically involve insufficient privileges during installation or incorrect file ownership after installation. Ensure you’re using sudo or root access for all installation commands and verify file permissions if services fail to start properly.

Configuration Issues

Service startup failures often indicate configuration file syntax errors or resource constraints. Review GitLab logs located in /var/log/gitlab/ for detailed error messages. Common issues include insufficient memory, incorrect external URL configuration, or networking problems.

Memory-related problems manifest as slow performance, service crashes, or failed background job processing. Monitor system memory usage during peak periods and consider adding RAM or optimizing GitLab settings for available resources.

Network connectivity issues prevent users from accessing GitLab or cause problems with external integrations. Verify firewall rules, DNS configuration, and network routing to ensure proper connectivity between users and your GitLab instance.

Maintenance and Best Practices

Regular Maintenance Tasks

System updates coordination ensures your GitLab installation remains secure and stable. Plan regular maintenance windows for applying Rocky Linux security updates and GitLab version upgrades. Test updates in development environments before applying them to production systems.

GitLab version upgrades require careful planning and testing, especially for major version changes. Review GitLab’s upgrade documentation for version-specific requirements and potential breaking changes. Always backup your GitLab installation before performing upgrades.

Backup verification procedures ensure your backup strategy actually protects against data loss. Regularly test backup restoration processes in isolated environments to verify backup integrity and restoration procedures.

Congratulations! You have successfully installed GitLab. Thanks for using this tutorial for installing GitLab on your Rocky Linux 10 system. For additional help or useful information, we recommend you check the official GitLab website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button