How to Install GitLab on Ubuntu 26.04

How to Install GitLab on Ubuntu 26.04

GitLab is open source software. With GitLab, users can manage their projects more easily through features designed to support collaborative development. GitLab provides remote access to Git repositories, including code hosting, bug tracking, software development lifecycle management, and social coding. Because of the advantage that brings development, operations, and security teams into a single application, GitLab is now widely used across the globe. In this article, we will show you how to install GitLab on Ubuntu 26.04.

Prerequisites

  • An Ubuntu 26.04 VPS with at least 8GB of RAM
  • SSH root access, or a user with sudo privileges

Conventions

# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user

Step 1. Update the System

First of all, we need to log in to our Ubuntu 26.04 VPS through SSH:

ssh root@IP_Address -p Port_number

Replace “root” with a user that has sudo privileges. 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 Ubuntu 26.04. You can verify it with this command:

# lsb_release -a

You should get this as the output:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu Resolute Raccoon 
Release:        26.04
Codename:       resolute

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

# apt update 

That’s it, the system package information should be updated now.

Step 2. Install Dependencies

Almost every package we install relies on other packages to run properly or to enable installation. Before proceeding with the other steps, we need to install the dependencies.

# apt install ca-certificates curl gnupg git sudo

Step 3. Add a System User

Let’s create a new system user called ‘master’, run this command:

# /usr/sbin/adduser master

You will be prompted to create a password. Make sure to use a strong password when prompted.

Step 4. Add User to Sudoer

On Debian systems, administrative privileges are typically granted by adding users to the sudo group. To give a regular user full sudo access (i.e., the ability to run commands as root with sudo), add them to the sudo group using one of these commands:

# /usr/sbin/usermod -aG sudo master

Step 5. Install Docker

There are some methods to install Docker on a Debian 13 system. In this step, we are going to install Docker Engine from Docker’s Apt repository. This is by far the best and most recommended way to install Docker because we can perform the update easily. Before installing Docker Engine for the first time on a new host machine, you need to configure the Docker Apt repository. Then you can install and update Docker from the repository.
Execute these commands to add and set up Docker’s Apt repository.

# install -m 0755 -d /etc/apt/keyrings
# curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# chmod a+r /etc/apt/keyrings/docker.gpg

Then, add Docker’s APT repository to the APT source.

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
   tee /etc/apt/sources.list.d/docker.list > /dev/null

Once added, update the package index files on the system.

# apt update

Finally, install the Docker packages.

# apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

That’s it, Docker has been installed on your Debian system. We can run the command below to verify the installation.

# docker version

It will show you an output like this:

Client: Docker Engine - Community
 Version:           29.3.1
 API version:       1.54
 Go version:        go1.25.8
 Git commit:        c2be9cc
 Built:             Wed Mar 25 16:13:43 2026
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.3.1
  API version:      1.54 (minimum version 1.40)
  Go version:       go1.25.8
  Git commit:       f78c987
  Built:            Wed Mar 25 16:13:43 2026
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.2.2
  GitCommit:        301b2dac98f15c27117da5c8af12118a041a31d9
 runc:
  Version:          1.3.4
  GitCommit:        v1.3.4-0-gd6d73eb8
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Step 6. Run Docker without Sudo

The Docker daemon binds to a Unix socket. When running the Docker command without sudo, you will get this error message:

permission denied while trying to connect to the docker API at unix:///var/run/docker.sock

To run Docker commands without sudo, we need to add the user we want to the Docker group:

# /usr/sbin/usermod -aG docker $USER

For example, let’s add the user “master” to the Docker group:

# /usr/sbin/usermod -aG docker master

Now, you can switch to the user ‘master’ and run Docker without sudo.

# su - master
``

$ sudo mkdir -p /opt/gitlab/{config, logs, data}
$ sudo chown -R master: /opt/gitlab

Now, let’s create a docker-compose.yml file in your desired directory (e.g., /opt/gitlab):

$ cd /opt/gitlab
$ nano docker-compose.yml

Paste the following configuration into the file; do not forget to replace gitlab.yourdomain.com with your actual domain name:

services:
web:
image: 'gitlab/gitlab-ce:latest'
container_name: 'gitlab'
restart: always
hostname: 'gitlab.yourdomain.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.yourdomain.com'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
ports:
- '80:80'
- '443:443'
- '2222:22'
volumes:
- '/opt/gitlab/config:/etc/gitlab'
- '/opt/gitlab/logs:/var/log/gitlab'
- '/opt/gitlab/data:/var/opt/gitlab'
shm_size: '256m'

Save and exit the editor. Here is the explanation:

/opt/gitlab/config:/etc/gitlab: This volume is used to persist GitLab configuration data.
/opt/gitlab/logs:/var/log/gitlab: This volume is used to persist GitLab log data.
/opt/gitlab/data:/var/opt/gitlab: This volume is used to persist GitLab application data.

If you do not have a domain or subdomain, you can replace the value of ‘hostname’ and ‘external_url’ with your server’s IP address.

Step 7. Run the GitLab Container

At the time of this writing, GitLab has not released its support for Ubuntu 26.04. So, we cannot use their APT repository to install GitLab. In this step, we will install GitLab using the Docker Compose method. Let’s start the GitLab container in detached mode using Docker Compose:

$ docker compose up -d

The image will start downloading, and the container will begin running. Please be informed that this process may take several minutes to complete. You can monitor the progress with:

$ docker logs -f gitlab

Step 8. Access GitLab

Open your web browser and navigate to your configured external_url (e.g., https://gitlab.yourdomain.com).

Install GitLab on Ubuntu 26.04


You can log in as root with the password in the file. To see the password, execute the command below:

$ docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password

It will print the password:

Password: ucRuwEgHEd08Xfmhh6w9OppSeuO4zHsmwNRR+QBBiQI=

Once logged in, you will see the GitLab dashboard.

GitLab Dashboard

At this point, you can start customizing and working on your GitLab website.

That’s it all! You have learned how to install GitLab on Ubuntu 26.04

Of course, you don’t have to install GitLab on Ubuntu 26.04 if you use one of our managed Ubuntu Hosting services, in which case you can simply ask our expert Linux admins to install GitLab on Ubuntu 26.04 for you. They are available 24×7 and will address your request immediately. Managing a website is not just about installation; we can help you optimize it if you have an active service with us.

If you liked this post on installing GitLab on Ubuntu 26.04, please share it with your friends or leave a comment below.

Leave a Comment