You decide which services we may enable for analytics, personalization, and external content.
We use cookies and similar technologies on our website to personalize content, embed external media, and better understand how individual areas are used.
Necessary cookies
These entries support essential functions such as security, stability, and form processing.
Optional sections
AnalyticsMarketingPersonalizationExternal media
Your data may be processed with your consent or on the basis of legitimate interests. In the cookie settings, you can reject or explicitly allow each optional category.
Some services process personal data in third countries. By consenting, you also agree to this transfer. You can find more information in our Privacy Policy.
You can reopen and change your selection at any time. · 1.0.2
Set Up GitLab on a Linux Server – Host Your Own DevOps Platform
Discover how to efficiently install GitLab on Linux to optimize DevOps workflows and enhance team collaboration → Learn more now
10 November 20266 min read0 Views0 helpful
Introduction
GitLab is a comprehensive DevOps platform that enables teams to collaborate on code, automate workflows, and efficiently manage the entire software development lifecycle. This guide explains how to install GitLab on a Linux server.
Preparation
The following requirements are recommended by the official GitLab Team. It is highly advisable to meet these prerequisites to avoid future issues and inconveniences.
For the latest and most accurate specifications, please check the official Hardware Requirements documentation from GitLab.
To install GitLab on your Linux server, you need to connect via SSH client. Refer to our First Access (SSH) guide.
Once connected, you can install the necessary packages required for GitLab installation.
FAQ
Frequently asked questions
You can install GitLab directly via One-Click Apps in the VPS web interface by searching for GitLab in the app catalog and starting deployment with your preferred project, environment, and domain settings.
Minimum requirements are 2x 2 GHz CPU, 4 GB RAM, 10 GB storage, and 100 Mbit/s bandwidth (up & down). Recommended are 4x 2.6+ GHz CPU, 8 GB RAM, and 50+ GB storage.
GitLab is a comprehensive DevOps platform that enables teams to collaborate on code, automate workflows, and efficiently manage the entire software development lifecycle.
Feedback
Was this article helpful?
Your feedback helps us prioritize and improve content.
0 of 0 Users found this article helpful.
Personal support
Need more help than the guide provides?
Our ZAP support team knows your product — briefly describe your issue and we'll help you personally.
Navigation
Software
Installing GitLab with One-Click Apps
You can install GitLab directly via One-Click Apps in the VPS web interface. After the initial setup of the apps, open the app catalog, search for GitLab, and start the deployment with your preferred project, environment, and domain settings. This allows you to deploy and manage GitLab quickly and user-friendly without manual command-line setups, while still benefiting from integrated web-based management, support for custom domains, and SSL provisioning where available.
Step 1: Install Dependencies
First, you need to install some dependencies so the GitLab installer can run. Use the following commands to install the required packages on your Linux server.
Update the package list and install the OpenSSH server along with the required prerequisites with this command. This will host your GitLab web interface.
Optionally, you can install Postfix (SMTP server) if you want to send email notifications via GitLab.
If you want to use email notifications, install Postfix with:
Code
sudo apt-get install -y postfix
Update the package list and install the OpenSSH server and required prerequisites with the following command. This will host your GitLab web interface.
During the Postfix installation, a configuration screen may appear. Choose “Internet Site” and confirm with Enter. Enter the external DNS of your Linux server as the “mail name” and confirm. If more screens appear, confirm each with Enter to accept the default values.
If you want to use another solution for email sending, skip this step and configure an external SMTP server after GitLab installation following the official guide.
Step 2: Install GitLab
After all dependencies are installed, you can install GitLab.
In this guide, we install GitLab directly from the official package repositories.
The following script adds the GitLab repositories to the apt package manager:
After this process completes, GitLab should be ready to use on your Linux server. In the next section, you will configure important settings to ensure the server runs smoothly.
Step 3: Configure GitLab
To make everything work, you need to make some changes to the configuration file. Open the GitLab configuration file with your preferred text editor. Here we use the preinstalled nano editor as an example.
Code
sudo nano /etc/gitlab/gitlab.rb
Find the line external_url and enter either your domain or the IP address of your Linux server if you do not want to use a domain for GitLab.
Code
## GitLab URL
##! URL where GitLab will be accessible.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
##!
##! Note: During installation/updates, the environment variable
##! EXTERNAL_URL is used to set/override this value.
##! For AWS EC2 instances, it tries to retrieve the public hostname/IP
##! from AWS. More info:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'http`s`://`your-domain-or-linux-server-ip`'
We also recommend entering your email address in the line letsencrypt['contact_emails']. This allows Let's Encrypt to notify and contact you about automatic and free SSL certificates.
Info
For a free SSL certificate from Let's Encrypt, you need a domain. You cannot request a certificate directly for an IP address.
Code
################################################################################
# Let's Encrypt Integration
################################################################################
# letsencrypt['enable'] = nil
# letsencrypt['contact_emails'] = [`your-email@example.com`] # This should be an array of email addresses
# letsencrypt['group'] = 'root'
# letsencrypt['key_size'] = 2048
# letsencrypt['owner'] = 'root'
# letsencrypt['wwwroot'] = '/var/opt/gitlab/nginx/www'
# See https://docs.gitlab.com/omnibus/settings/ssl/index.html#renew-the-certificates-automatically for more info
# letsencrypt['auto_renew'] = true
# letsencrypt['auto_renew_hour'] = 0
# letsencrypt['auto_renew_minute'] = nil # Should be a number or cron expression if specified.
# letsencrypt['auto_renew_day_of_month'] = "*/4"
# letsencrypt['auto_renew_log_directory'] = '/var/log/gitlab/lets-encrypt'
# letsencrypt['alt_names'] = []
Tip
You can press CTRL+W to search for letsencrypt['contact_emails'] and press Enter so you don’t have to scroll through the entire file manually.
When finished, press CTRL+X, then Y and Enter to save the changes.
Finally, run the following command to reconfigure GitLab with the new settings:
Code
sudo gitlab-ctl reconfigure
This process may take a while as GitLab initializes with the updated configuration data. If a domain was used, SSL certificates will also be automatically issued.
Step 4: Access the Web Interface
After initialization, the server should now be accessible via a web browser. Open your site by entering your domain or IP address:
Code
https://[your_domain] OR http://[your_ip_address]
On first access, the login page will appear.
For the first login, use the username root.
The password can be found in a file on your Linux server. Open the file with the following command and look for the Password field:
Code
sudo nano /etc/gitlab/initial_root_password
Code
# WARNING: This value is only valid under the following conditions
# 1. If it was set manually (either via the `GITLAB_ROOT_PASSWORD` environment variable or `gitlab_rails['initial_root_password']` setting in `gitlab.rb` before the first database population).
# 2. The password has not been manually changed, neither via UI nor command line.
#
# If the password shown here does not work, you must reset the admin password: https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
Password: `[YOUR_PASSWORD_HERE]`
# NOTE: This file is automatically deleted 24 hours after the first reconfigure run.
Enter the username and password on the login page to access your GitLab dashboard for the first time. You should now have access to your GitLab panel on your own Linux server.
We strongly recommend creating a new user and/or changing the root user’s password. You can do this via Admin at the bottom left, then Overview -> Users. There you can manage all users of your GitLab instance.
Optional: Set Up Firewall with ufw
You can skip this step if you do not want to configure a firewall or if you already use firewalld on OpenSUSE, for example. Make sure ports 80/443 and 22 are open.
Install ufw
If ufw is already installed, you can skip this step.
By default, ufw blocks all other ports except the allowed ones. Make sure your whitelist is correct before running this command.
Enable the firewall with:
Code
sudo ufw enable
Conclusion
Congratulations, you have successfully installed GitLab! If you have any questions or problems, our support team is available daily and happy to assist you!
If you want to make further configurations, we recommend reading the official GitLab documentation for the next steps.
Server hosting from €2.49 / month, online instantly, DDoS protection included.