Skip to main content
All CollectionsVPSVPS OS and Templates
How to Use the Ubuntu 22.04 Template With GitLab
How to Use the Ubuntu 22.04 Template With GitLab

Selecting the preferred OS template for your VPS

Updated over 7 months ago

By following this article, you'll learn how to install and configure GitLab on an Ubuntu 22.04 64-bit virtual private server (VPS) available through hPanel. We'll cover accessing GitLab, the initial admin login details, changing the GitLab domain, and essential security measures.

Haven't signed up for a VPS plan yet? Check out GitLab VPS hosting options.

Installing the Ubuntu 22.04 with GitLab Template:

To select this OS template, go to the VPS section in hPanel and click on the server you want to manage.

In the sidebar, go to OS & Panel Operating System and find the section Change your Operating System. Select Applications, then select the template Ubuntu 22.04 64bit with GitLab, and, finally, click on Change OS:

Once the installation is complete, access GitLab through the server IP or hostname provided in your Hostinger VPS dashboard.

Initial Admin Login Details

Use the following credentials to access the GitLab admin panel:

  • Username: root

  • Password: the one set during the OS installation; learn how to reset panel password

Changing the GitLab Server Domain

If you want GitLab Enterprise to redirect to your domain instead of the server's hostname, edit the configuration file accordingly and then run a reconfiguration command.

To get started, open the following file with your preferred text editor. This example uses vim:

vim /etc/gitlab/gitlab.rb

Once you’re in the file, search for the external_url line. This will likely appear similar to the following with the http and your IP address information:

/etc/gitlab/gitlab.rb

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the>
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retri>
external_url 'http://domain.tld'

After that, enter the following command to apply the changes:

gitlab-ctl reconfigure

Adding an SSL to GitLab Server

Update the last line, i.e., external_url 'http://domain.tld' by changing http to https and inserting your own domain name. This way, you'll be automatically protected by a Let’s Encrypt certificate:

/etc/gitlab/gitlab.rb

## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the>
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retri>
external_url 'https://domain.tld'

Next, you need to add your email address for Let’s Encrypt. Find the letsencrypt['contact_emails'] line, uncomment it by deleting the hash symbol #, and then add your information:

/etc/gitlab/gitlab.rb

letsencrypt['contact_emails'] = ['name@example.tld']

Once you make these changes, save and close the file. Then run the following command to reconfigure GitLab:

gitlab-ctl reconfigure 

And that's it! You've successfully set up a GitLab self-hosted server on an Ubuntu 22.04 VPS provided by Hostinger.

Did this answer your question?