Change the URL of a GitLab Server

How to reconfigure the external URL of a GitLab server

GitLab is an open-core company that provides GitLab, a DevOps software package that combines the ability to develop, secure, and operate software in a single application. The open-source software project was created by Ukrainian developer Dmitriy Zaporozhets and Dutch developer Sytse Sijbrandij. [Wikipedia]

In some cases you might encounter the problem of having to reconfigure, the external URL address of an already working GitLab server. At first sight that might look daunting, especially when important repos are involved and people are depending on this installation. However, the solution is rather simple. Log in to your GitLab server and locate the following file /etc/gitlab/gitlab.rb. Search for the setting external_url and set the new desired value e.g:

external_url 'http://gitlab.home.lab'

Save the changes, and then reconfigure and restart the GitLab instance in order to apply the changes.

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

Access your server from the new URL and you will notice that everything now runs under the new configuration.