Earlier we have discussed the detailed installation of the Gitlab server on CentOS & Ubuntu systems. Once we have our Gitlab server ready, we must be able to perform common operations, some post-installation Gitlab setup like the ones mentioned below,

  1. Add SSH keys
  2. Create/Remove User
  3. Create/Remove Groups
  4. Create Project

In this Gitlab tutorial, we are going to discuss just that. We will learn how we can perform all these things step by step with the help of some screenshots.

Recommended Read: Informative guide to Gitlab tutorial for Beginners

Also Read: Easy & simple guide to Backup & Restore GITLAB


Gitlab Setup Tutorial


1- Add SSH keys

We need to add our ssh key to the Gitlab server as it allows us to access GitLab with authentication that does not require a username & password. To do this we first have to create public/private ssh keys, follow the steps mentioned below,

Open terminal & run the following command from terminal,

$ ssh-keygen -t rsa

We will first be asked to enter the file name, then the passphrase for the key. We can leave them as defaults by pressing the enter key. Now we should have a public Key by name ‘id_rsa.pub’ & a private key with the name ‘id_rsa’ in the folder ‘/home/user/.ssh’. We also have a detailed tutorial on creating SSH keys, you can READ IT HERE.

Now that we have ssh key ready, open Gitlab server & goto URL

https://GITLAB_URL/profile/keys

or you can also login to Gitlab with your user & then go to “Settings” & there look for “SSH Keys”. Now we need to copy the contents of ‘id_rsa.pub’ i.e. our ssh public key here. It should look something like this,

gitlab setup

Next click on ‘Add key’ to save the ssh key. That’s it, we are done.

2- Create/Remove User

To create a new user for the Gitlab server, we need to go to ‘Admin Area’ after logging into GitLab. Admin Area can be accessed by clicking on the “Wrench” icon on the top right corner or alternatively we can use the following URL “https://GITLAB_URL/admin/users”.

Next click on the ‘Users’ tab in Admin Area & then click on ‘New User’,

Gitlab tutorial

Now Enter the details for user,

Gitlab tutorial

Once all the details have been entered, click on ‘Create User’ to complete the creation procedure.

Now if we need to remove access for the user from Gitlab, we can either Block the user or we can remove it permanently. Both these options can be accessed by clicking on setting options for the user,

Gitlab tutorial

Block or Delete the user as per requirement.

3- Create/Remove Groups

The process for creating Group is quite similar to creating a user. We go to ‘Admin Area’, look for tab ‘Groups’ & then click on ‘Create Group’. Then we need to enter the details regarding the group & whether we want to keep our group as ‘Public’, ‘Private’ or ‘Internal’.

Gitlab tutorial

Once done, click on ‘Create Group’ to create the group. Now we can add users or projects to the group by clicking on the Group name & then selecting either project or ‘Add users’ option there. To delete the project, we have an option where our group name is mentioned.

4- Create Project

Option to create a new project should be on the first screen when you log in to the Gitlab server. Click on the icon ‘New Project’ & then on the next screen, mention all the details related to the project,

Gitlab tutorial

& click on ‘Create project’. & we can now start working on the project. To start working on Gitlab, we should have an idea of git commands, please refer to our article on ‘Some Useful Git commands’ to know about the git commands.

We now end this Gitlab setup tutorial on performing some common operations required after Gitlab installation. We are in process of writing some more tutorials regarding Git & Gitlab, so be back soon & please feel free to send in any questions or queries using the comment box below.

If you have found this article to be useful, please share it among your friends/colleagues/followers. THANKS !!!

We are giving you exclusive deals to try Linux Servers for free with 100$ credit, check these links to claim your 100$,

DigitalOcean - 100$ free credit & Linode - 100$ free credit

Check some Exclusive Deals, HERE.

Also, check out DevOps Book You should read section.