GitLab is a comprehensive DevOps platform that enables teams to work together on code, automate workflows, and efficiently manage the entire software development lifecycle. In this guide, we’ll show you two ways to get started: the easy way, using the One-Click App to make GitLab available over HTTPS in just a few clicks, and a manual installation from the official package repositories using the console.
The quickest way to get your own GitLab instance is through the One-Click Apps on your VPS. ZapX launches GitLab Community Edition as a container, sets up a domain and HTTPS for you, and generates the password for the admin account. You don’t need to install packages or edit gitlab.rb.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps to learn how.
- Enough memory: GitLab is resource-intensive. According to the GitLab documentation, a single installation can run in constrained environments with 8 GB RAM, while GitLab recommends 16 GB RAM and 8 CPU cores as a starting point. Even when idle, GitLab uses around 3.5 GB.
- Only one GitLab installation is possible per VPS because Git uses port
2222for SSH.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search for GitLab in the App catalog and click Install app.
- Leave Use a custom subdomain or zap.cloud enabled and choose an address. You’ll be able to access GitLab over HTTPS at this address.
- You don’t need to enter anything under App configuration. However, change the time zone: enter your time zone in
TZandGITLAB_TIMEZONE, for example,Europe/Berlin. The default value isUTC. You only need theGITLAB_SMTP_*fields if GitLab should send emails; see below. - Click Queue installation. GitLab takes several minutes to start for the first time, even if the app is already shown as online. Until it’s ready, the address will display an error.
Open the app’s Access link and sign in with the user root. You can find the password in the app settings (gear icon), under App environment > Automatically generated values, as SERVICE_PASSWORD_GITLAB. Click the eye icon to show it or the copy icon to copy it.
The password is for the first startup. If you change it afterward in GitLab under your profile, your new password will remain in effect.
By default, anyone who knows the address can create an account in your GitLab. GitLab itself points this out in the Admin area. In the notice “Check the restrictions for new users,” click “Deactivate” if you want only you and your team to have accounts. You can then create new users in the Admin area under “Users.”
You can clone and push over HTTPS right away using the app’s address. To use Git over SSH, the One-Click App uses port 2222; you can find the connection details in the panel on the app card under Connection. First, add your public SSH key to GitLab under “SSH Keys” in your profile. GitLab displays your project’s SSH addresses with the correct port, for example:
git clone ssh://git@name-1234.zap.cloud:2222/group/project.git
Without a mail server, GitLab won’t send emails, including notifications or password reset links. To set this up, enter your email provider’s details in the app settings (gear icon), under App environment:
| Variable | Value |
|---|---|
GITLAB_SMTP_ENABLE | true |
GITLAB_SMTP_ADDRESS | SMTP server address |
GITLAB_SMTP_PORT | Port, usually 587 |
GITLAB_SMTP_USER_NAME | Mailbox username |
GITLAB_SMTP_PASSWORD | Mailbox password |
GITLAB_SMTP_DOMAIN | Your email provider’s domain |
GITLAB_EMAIL_FROM | Sender address, for example, gitlab@your-domain.de |
Then click Save. The app will restart.
To check whether an update is available for your installation, go to the app settings (gear icon), select App update, and click Check for updates. If a new version is available, install it by clicking Apply update. Repositories, settings, and the database are stored in separate volumes and will be preserved.
GitLab requires specific intermediate versions for major upgrades. Keep your installation up to date regularly and check GitLab’s upgrade planning before updating.
The rest of this guide describes how to manually install GitLab from the official package repositories using the console. For example, you might choose this method if you want to run GitLab directly on the server instead of in a container, or if you want to control each step yourself.
The following requirements are recommended by the official GitLab team. We strongly recommend meeting these requirements to avoid problems and inconveniences later.
| Components | Minimum | Recommended |
|---|---|---|
| CPU | 2x 2 GHz | 4x 2.6+ GHz |
| RAM | 4 GB | 8 GB |
| Storage | 10 GB | 50+ GB |
| Bandwidth | 100 Mbit/s (Up & Down) | 100 Mbit/s (Up & Down) |
| Platform | Options |
|---|---|
| Operating system | Ubuntu (20.04, 22.04, 24.04), Debian (10, 11, 12), OpenSUSE (15.5) |
| Database | PostgreSQL 14.9+ |
| Web server | NGINX (bundled with GitLab), Puma 6.4.2+ |
| Other | Redis 7.x+, Sidekiq 7.3.2+, Prometheus 2.54.1+ |
For the latest and most accurate specifications, please refer to GitLab’s official Hardware Requirements documentation.
To install GitLab on your Linux server, you’ll need to connect using an SSH client. See our Initial Access (SSH) guide for instructions.
Once connected, you can install the packages required for the GitLab installation.
First, 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 and required prerequisites with the following command. This will host your GitLab web interface.
sudo apt update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
You can optionally install Postfix (SMTP server) if you want to send email notifications through GitLab.
If you want to use email notifications, install Postfix with:
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.
sudo apt update
sudo apt-get install -y curl openssh-server ca-certificates perl
You can optionally install Postfix (SMTP server) if you want to send email notifications through GitLab.
If you want to use email notifications, install Postfix with:
sudo apt-get install -y postfix
Install the OpenSSH server and required prerequisites with the following command. This will host your GitLab web interface.
sudo zypper install curl openssh perl
Make sure the OpenSSH daemon is enabled:
sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd
If you use firewalld, make sure the required ports are open.
Check whether firewalld is active with:
sudo systemctl status firewalld
If it is, open the default ports (80 and 443):
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
You can optionally install Postfix (SMTP server) if you want to send email notifications through GitLab.
If you want to use email notifications, install Postfix with:
sudo zypper install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
A configuration screen may appear during the Postfix installation. Select “Internet Site” and press Enter to confirm. For the “mail name,” enter the external DNS name of your Linux server and confirm. If additional screens appear, press Enter on each one to accept the default values. If you want to use another email delivery solution, skip this step and configure an external SMTP server after installing GitLab, following the official instructions.
Once all dependencies are installed, you can install GitLab.
In this guide, we’ll install GitLab directly from the official package repositories.
The following script adds the GitLab repositories to the apt package manager:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
You can then install the gitlab-ee package:
sudo apt-get install -y gitlab-ee
The following script adds the GitLab repositories to the Zypper package manager:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
You can then install the gitlab-ee package:
sudo zypper install gitlab-ee
Once this process is complete, GitLab should be ready to use on your Linux server. In the next section, you’ll configure important settings to ensure the server runs smoothly.
For everything to work, you’ll need to make some changes to the configuration file. Open the GitLab configuration file with your preferred text editor. In this example, we’ll use the preinstalled nano editor.
sudo nano /etc/gitlab/gitlab.rb
Find the external_url line and enter either your domain or the IP address of your Linux server if you don’t want to use a domain for GitLab.
## GitLab URL
##! URL, under which 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 value of the environment variable
##! EXTERNAL_URL is used to set/replace this value.
##! For AWS EC2 instances, an attempt is made 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 / IPv4 address of your Linux server`'
We also recommend entering your email address on the letsencrypt['contact_emails'] line. This allows Let's Encrypt to notify and contact you about automatic, free SSL certificates.
You need a domain to get a free SSL certificate from Let's Encrypt. You can’t request a certificate directly for an IP address.
################################################################################
# Let's Encrypt Integration
################################################################################
# letsencrypt['enable'] = nil
# letsencrypt['contact_emails'] = [`Your email here`] # 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'] = []
Press CTRL+W to search for letsencrypt['contact_emails'], then press Enter so you don’t have to search through the entire file manually.
When you’re done, press CTRL+X, then Y and Enter to save your changes.
Finally, run the following command to reconfigure GitLab with the new settings:
sudo gitlab-ctl reconfigure
This process may take a while as GitLab initializes with the updated configuration data. If you used a domain, SSL certificates will also be issued automatically.
After initialization, you should be able to access the server in a web browser. Open your site by entering your domain or IP address:
https://[your_domain] OR http://[your_ip_address]
The login page will appear the first time you access it.
Use the root user for your first login.
You can find the password in a file on your Linux server. Open the file with the following command and look for the Password field:
sudo nano /etc/gitlab/initial_root_password
# 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 the `gitlab_rails['initial_root_password']` setting in `gitlab.rb` before the initial database population).
# 2. The password has not been changed manually, either via the UI or the command line.
#
# If the password shown here does not work, you’ll need to 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 your 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 password for the root user. You can do this by clicking Admin in the bottom left, then Overview -> Users. From there, you can manage all users on your GitLab instance.
You can skip this step if you don’t want to configure a firewall or, for example, if you’re already using firewalld on OpenSUSE. Make sure ports 80/443 and 22 are open.
If ufw is already installed, you can skip this step.
sudo apt-get install -y ufw
sudo zypper install ufw
sudo ufw allow http
sudo ufw allow https
sudo ufw allow OpenSSH
By default, ufw will block all other ports except those you’ve allowed. Make sure your whitelist is correct before running this command.
Enable the firewall with:
sudo ufw enable
Congratulations, you’ve successfully installed GitLab! If you have any questions or run into problems, our support team is available every day and will be happy to help.
If you want to make additional changes, we recommend reading the official GitLab documentation for next steps.
