Looking to take control of your development workflow? GitLab might be exactly what you need. It combines version control, continuous integration, project management, and more into a single, cohesive solution that's transforming how individuals and teams build software.
And while they offer a paid hosted version, many developers would rather self-host it...
Why self-host GitLab?
Self-hosting GitLab gives you direct access to every aspect of your development environment.
You can control security settings, customize storage configurations, and integrate additional services without worrying about third-party restrictions. Some developers also appreciate keeping their own code on their own servers.
You can self-host GitLab on a range of hardware, from a personal server in your basement to a dedicated server in a data center.
System requirements
When deciding where to install GitLab, make sure your server meets the following basics:
- Operating system: Ubuntu, Debian, CentOS, Rocky Linux, or any Linux distro you prefer
- CPU: At least 2 cores (but more is better if you plan on running CI/CD)
- RAM: 4 GB minimum (8 GB+ recommended for more demanding workloads)
- Storage: Adequate disk space for your repositories, logs, and artifacts (GitLab can grow quickly)
Note: For self-hosted deployments, you’ll also want to secure your server. Tools like Fail2Ban, UFW, or other firewall solutions can protect against brute-force attacks and unwanted traffic. For additional SSH security tips, check out our guide on 7 Quick and Easy Ways to Secure SSH on a Linux Server.
Also, if you’re looking for guaranteed reliability and performance, consider using a dedicated server from xTom (hi! that's us ;-) or one of our scalable NVMe-powered KVM VPS.
CE vs. EE: which version should you choose? What does GitLab offer?
GitLab comes in two main versions: Community Edition (CE) and Enterprise Edition (EE).
- Community Edition (CE) is open-source and free to use, ideal for individual developers or small teams.
- Enterprise Edition (EE) includes additional enterprise-level features such as advanced CI/CD, security management, and performance monitoring. It’s geared towards larger organizations with more complex needs.
To be specific, though:
Feature | Community Edition (CE) | Enterprise Edition (EE) |
---|---|---|
Cost | Free (open source) | Paid (Tiered pricing based on user count and features) |
Source code | Open source | Partially open source (core features open, premium features proprietary) |
Basic Git features | Full Git repository management, branching, merging | Same as CE with additional merge request approvals and controls |
CI/CD | Built-in CI/CD pipelines, runners, artifacts | Advanced CI/CD with Auto DevOps, deploy boards, advanced deployment solutions |
Issue tracking | Full issue tracking with workflows, labels, due dates | Advanced issue tracking with multiple assignees, related issues, SLA management |
Project management | Basic boards, milestones, time tracking | Advanced features including epics, portfolio management, advanced roadmaps, value stream management |
Wiki & documentation | Built-in wiki, markdown support | Same as CE with advanced search and organization |
Security features | Basic security features (2FA, basic permissions) | Advanced security suite with SAST/DAST scanning, container scanning, dependency scanning, license compliance, security dashboards, advanced audit logs, advanced permission controls |
Performance | Basic instance monitoring | Advanced monitoring, performance analytics, service desk, GitLab insights |
User management | Basic user and group management | Advanced user management with LDAP/SAML/SSO integration, group SSO, enterprise permissions, user caps and controls |
Authentication | Local authentication, basic OAuth | Advanced authentication options including smartcard auth, enterprise SSO |
High availability | Basic redundancy options | Full HA support with geo replication, disaster recovery, load balancing, horizontal scaling |
Support | Community forums and documentation | 24/7 enterprise support with SLA |
Backup & recovery | Basic backup/restore tools | Advanced backup solutions with automated backups, point-in-time recovery, geo disaster recovery |
Container registry | Built-in container registry | Container registry with advanced security scanning, dependency tracking, policy management |
API access | Full REST and GraphQL API access | Same as CE with additional enterprise endpoints |
Integrations | Standard integrations with common tools (Jira, Jenkins, etc.) | Additional premium integrations and enhanced enterprise tool support |
Analytics | Basic repository and CI analytics | Advanced analytics including code review analytics, value stream analytics, productivity analytics, group-level insights |
Storage | Local and object storage support | Same as CE with additional enterprise storage options |
Release management | Basic release tracking | Advanced release controls, automated release notes, enterprise release management |
Compliance | Basic audit logging | Advanced compliance tools with audit events, advanced audit logs, compliance frameworks, policy management, evidence collection |
You can install either version based on your requirements by specifying the package during installation (EE or CE). If you don't need enterprise features, CE is a great place to start!
How to install GitLab on AlmaLinux (RHEL), Ubuntu, and Debian
While GitLab offers many ways to self-host it, such as Docker and Docker Compose, their recommended method is through their official Linux package, which is what we'll cover in this article. For all additional install methods, review their documentation.
Step 1: Install and configure dependencies
AlmaLinux and RedHat 8/9
Install the necessary dependencies:
sudo dnf install -y curl policycoreutils openssh-server perl
Enable OpenSSH:
sudo systemctl enable sshd
sudo systemctl start sshd
If needed, configure firewall for remote access:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
Install Postfix for email notifications (optional if using external SMTP):
sudo dnf install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
Note: During Postfix installation, select "Internet Site" and enter your server's external DNS for the "mail name."
Ubuntu 20.04/22.04/24.04 LTS and Debian 11/12
Update package lists and install dependencies:
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates perl
# You'll need to add "tzdata" above for Ubuntu.
Install Postfix for email notifications:
sudo apt-get install -y postfix
Step 2: Add GitLab repository and install
AlmaLinux and RedHat 8/9
Add the GitLab repository:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
Install GitLab:
sudo EXTERNAL_URL="https://gitlab.example.com" dnf install -y gitlab-ee
Ubuntu 20.04/22.04/24.04 LTS and Debian 11/12
Add the GitLab repository:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
Install GitLab:
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ee
Note: Replace gitlab.example.com
with your domain. Using https://
will automatically request a Let's Encrypt SSL certificate.
Step 3: Access GitLab and login
Congrats! GitLab is now installed.
You can access GitLab through your server's domain or IP address. By default, root
is the user, and a random password is generated and stored in /etc/gitlab/initial_root_password
for 24 hours.
Make sure to finish setting up accordingly and configure proper authentication.
Conclusion
GitLab is a versatile tool that combines version control, CI/CD, issue tracking, and other features into a single platform. By self-hosting it, you gain more flexibility in configuring your environment, controlling data, and adding custom integrations.
If you decide to run GitLab on your own infrastructure, xTom has solutions for every scale, from dedicated servers and colocation to IP transit and more. If you prefer a scalable environment, consider V.PS for an NVMe-powered KVM instance that you can spin up quickly and manage with ease.
Thanks for reading, and enjoy deploying code! :-)