408

How can I check which version of GitLab is installed on the server?

I am about the version specified in the GitLab changelog: CHANGELOG.md

For example: "6.5.0", "6.4.3", etc.

Can this be done only through the terminal? Is there a way to do that remotely (with a browser instead of the terminal)?

2
  • 3
    I’m voting to close this question because this is a question about a product/web app that has nothing to do with development. I think Web Applications is a better place for it. Commented Jul 21, 2021 at 18:31
  • For people who are using official GitLab.com, your version is the latest since GitLab is updated continuously Commented Nov 25, 2022 at 6:56

19 Answers 19

534

I have updated my server to GitLab 6.6.4 and finally found the way to get version of GitLab remotely without SSH access to server.

You should be logged in to access the following page: https://your.domain.name/help

It shows something similar to:

GitLab 6.6.4 42e34ae

GitLab is open source software to collaborate on code.
...
etc.

Sign up to request clarification or add additional context in comments.

8 Comments

You have to be signed in though. (I've been scratching my head on this for 10 minutes...)
Do you know a way to do this from a filesystem? I.e., a server that no longer boots.
Find filename "version-manifest.txt"... For gitlab omnibus it is stored at "/opt/gitlab/version-manifest.txt"
Note: you can see what this looks like on the hosted gitlab at gitlab.com/help (if you are logged into that service).
Using grep: grep "gitlab-ce" /opt/gitlab/version-manifest.txt for community edtion grep "gitlab-ee" /opt/gitlab/version-manifest.txt for enterprise edtion
|
151

For omnibus versions:

sudo gitlab-rake gitlab:env:info

Example:

System information
System:     Ubuntu 12.04
Current User:   git
Using RVM:  no
Ruby Version:   2.1.7p400
Gem Version:    2.2.5
Bundler Version:1.10.6
Rake Version:   10.4.2
Sidekiq Version:3.3.0

GitLab information
Version:    8.2.2
Revision:   08fae2f
Directory:  /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL:        https://your.hostname
HTTP Clone URL: https://your.hostname/some-group/some-project.git
SSH Clone URL:  [email protected]:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no

GitLab Shell
Version:    2.6.8
Repositories:   /var/opt/gitlab/git-data/repositories
Hooks:      /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:        /opt/gitlab/embedded/bin/git

4 Comments

It does, but it's SLOW AS HELL. WebURL/help page is much better solution for such a simple task - checking version.
@stamster OP asked "Сan this be done only through the terminal?"
What is this command doing that it takes sooo long to get back version info?
@stamster yes this is slow, but if your running gitlab over a cluster of servers, and if only one server failed the upgrade - you might want to manually check that server.
92

You can access the version through a URL, the web GUI, and the REST API.

Via a URL

An HTML page displaying the version can be displayed in a browser at https://your-gitlab-url/help. The version is displayed only if you are signed in.

Via a menu in the web GUI

If you do not care to type this URL, you can also access the same HTML page from a menu in the GitLab web GUI:

In GitLab 11 and later

  1. Log in to GitLab
  2. Click on the ? drop down menu in the upper right. Select Help.
  3. The GitLab version appears at the top of the page

In earlier versions, like GitLab 9

  1. Log in to GitLab
  2. Click on the three lines drop down menu in the upper left. Select Help.
  3. And then the version appears at the top of the page

Via the REST API

Log in as any user, select the user icon in the upper right of the screen. Select SettingsAccess Tokens. Create a personal access token and copy it to your clipboard.

In a Linux shell, use curl to access the GitLab version:

curl --header "PRIVATE-TOKEN: personal-access-token" your-gitlab-url/api/v4/version

2 Comments

And then? Can you be more specific. I'm trying to set up python-gitlab as a non-admin but fail to find the API version
Gitlab recommend you use the Metadata API instead of the Version API. It contains additional information and is aligned with the GraphQL metadata endpoint. As of GitLab 15.5, the Version API is a mirror of the Metadata API.
52

If you are using a self-hosted version of GitLab then you may consider running this command.

grep gitlab /opt/gitlab/version-manifest.txt

2 Comments

Easiest solution I've seen so far with GitLab self-hosted 12.10.x, thanks much.
It is better than GitLab recommended answer because does not need to be logged or use URL.
27

You have two choices (after having logged in).

  1. Use the API URL https://gitlab.example.com/api/v4/version (you can use it from the command line with a private token), it returns {"version":"10.1.0","revision":"5a695c4"}
  2. Use a HELP URL in the browser, https://gitlab.example.com/help, and you will see a version of GitLab, that is, GitLab Community Edition 10.1.0 5a695c4

Comments

24

You can view GitLab's version at: https://your.domain.name/help

Or via terminal: gitlab-rake gitlab:env:info

Comments

19

Use:

cd /opt/gitlab

cat version-manifest.txt

Example:

gitlab-ctl         6.8.2-omnibus
gitlab-rails       v6.8.2

The current GitLab version is 6.8.2.

Screenshot of the console

Comments

11

If using the GitLab Docker image:

# From the host, not inside the container
sudo cat /srv/gitlab/data/gitlab-rails/VERSION

Example output:

12.1.3

The same file could be found inside the running container under /var/opt/gitlab/gitlab-rails/VERSION.

2 Comments

I think you mean the mapped path, the file is under a running container under /var/opt/gitlab/gitlab-rails/VERSION But yes, it works.
@sneaky thanks, I clarified my answer
8

Get information about GitLab and the system it runs on :

bundle exec rake gitlab:env:info RAILS_ENV=production

Example output of gitlab:env:info

System information
System:     Arch Linux
Current User:   git
Using RVM:  yes
RVM Version:    1.20.3
Ruby Version:   2.0.0p0
Gem Version:    2.0.0
Bundler Version:1.3.5
Rake Version:   10.0.4

GitLab information
Version:    5.2.0.pre
Revision:   4353bab
Directory:  /home/git/gitlab
DB Adapter: mysql2
URL:        http://gitlab.arch
HTTP Clone URL: http://gitlab.arch/some-project.git
SSH Clone URL:  [email protected]:some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    1.4.0
Repositories:   /home/git/repositories/
Hooks:      /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git

Read this article, it will help you.

2 Comments

It works, but current directory should be changed before to directory where gitlab is installed: cd /home/git/gitlab (otherwise it will report: Could not locale Gemfile).
Running Ubuntu 14.04 LTS (trusty) I can use this command to achieve the same: gitlab-rake gitlab:env:info RAILS_ENV=production
8

Instead of http://domain-name/help, you can also check your GitLab version name in browser by logging as Admin

  • Go to http://domain-name
  • Log in to GitLab as Admin (Root)
  • Go to Admin Area
  • On the right corner, below Groups tab, you can find Components tab

There you can find not only GitLab version, but also different components, like GitLab Shell, GitLab workhorse, GitLab API, etc. Version numbers:

Enter image description here

You will also find the suggestions to update the versions there.

Comments

6
cat /opt/gitlab/version-manifest.txt |grep gitlab-ce|awk '{print $2}'

2 Comments

Great option to get the version automatically, though using too much code ;) ... try awk '$1=="gitlab-ce"{print $2}' /opt/gitlab/version-manifest.txt instead.
that is fantastic!!
5

The easiest way is to paste the following command:

cat /opt/gitlab/version-manifest.txt | head -n 1

and there you get the version installed. :)

Comments

4

It can be retrieved using REST, see Version API :

curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/version

For authentication see Personal access tokens documentation.

Comments

4

You can use the package manager to query the installed version of GitLab CI. if it happens to be debian or ubuntu, like this:

dpkg -l | grep gitlab-ce | tr -s [:space:] | cut -d" " -f3

It should work similarly with other distributions, assuming you used a package manager to install it.

Comments

4

This is a command line to know all the data of your GitLab install:

gitlab-rake gitlab:env:info

And this is the command line to know there are if new GitLab versions, for you can update GitLab

yum --showduplicates list gitlab-ce

And once you know your current version and the latest GitLab update, you can update it with the following line command:

yum install gitlab-ce-15.2.2-ce.0.el7

Comments

4

I have version 12.2.0-ee, and I tried the URL via (https://yourgitlab/help), but I have not got this information.

On the other hand, I got this with gitlab-rake with success into the command line:

sudo gitlab-rake gitlab:env:info

Output:

...
GitLab information
Version:        12.2.0-ee
...

1 Comment

gitlab.com is also EE and you can easy access gitlab.com/help if you are logged in. So you have made something wrong.
0

The following information is available from within the CI pipeline (GitLab >= 11.4):

Variable Value
CI_SERVER_VERSION_MAJOR The major version of the GitLab instance.
CI_SERVER_VERSION_MINOR The minor version of the GitLab instance.
CI_SERVER_VERSION_PATCH The patch version of the GitLab instance.
CI_SERVER_VERSION The full version of the GitLab instance.

Comments

0

If you are an admin and if you want to see the GitLab version (and more you didn't know about), click on the wrench/admin menu icon and under Components you can see a lot, especially if you are using Omnibus.

Comments

0

To check the version of GitLab on CentOS:

rpm -qa | grep gitlab-ce

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.