What is a Gitlab Instance URL?

I’m not sure if I connected with gitlab successfully. In the docs it says:

Verify that your SSH key was added correctly.

  1. For GitLab.com, to ensure you’re connecting to the correct server, confirm the SSH host keys fingerprints.
  2. Open a terminal and run this command, replacing gitlab.example.com with your GitLab instance URL.

What is a Gitlab Instance URL? How do I get mine? I couldn’t find any answers on the web - really confused by this one.

A “Gitlab Instance URL” is a URL of a GitLab instance.

wow I bet your reddit friends will think this was hilarious
if someone else could help me out, that would be greatly appreciated :+1:

3 Likes

Well, for self hosted you would configure the instance URL yourself and you should know it. I guess that for instance hosted by gitlab you’d receive a weblink from them.
So it is just the webaddress of your gitlab, whether you configured it for a self hosted instance, or one you received from Gitlab to visit your instance.
grove’s reply might not seem very kind, but he/she is kinda correct that there isn’t much to explain about this.

To add some links which may clarify a bit more:

I had a feeling that was not what you wanted to know, but I’m not sure what you do want to know.

What are you actually trying to do? There are many pages of docs, which are you refering to?

thanks @bartj
well I received an invitation from my future boss, signed-up, set everything up and want to confirm if I can connect correctly.
in the docs it says that it shall look like this: git@gitlab.example.com
in your stackoverflow link it says it should look like this: gitlab.com
apparently I’m not getting something basic, but is there a way to get my instance URL for sure? like going to my dashboard, or settings and copying it from somewhere?

The url your boss sent you to invite you to connect to accept the invitation is what you use after the git@

since you signed up and logged in there, then you have the url.

aiit, will try that out, thanks @iwalker and @bartj

so I had to generate a new ssh key to make it work, but for all the others stumbling across the problem this thread was about:
1.Go to your dashboard
2.Copy the URL
3.Your Gitlab Instance URL is git@dashboardURL

4 Likes

If your future boss uses the SaaS offering on GitLab.com, the instance URL is gitlab.com, operated and managed by the GitLab infrastructure team.

If the company instead uses a self-managed setup, the domain where the webserver provides the GitLab UI cannot be gitlab.com or any sub domain. Instead, you often see something like

  • gitlab.companydomain.com
  • git.internaldomain.com

Or similar. From your browser’s address bar, you’ll extract https://gitlab.companydomain.com/ whereas the instance URL is gitlab.companydomain.com then.

Depending on the desired way to clone from the Git server in GitLab, you’ll either use SSH or HTTPS as transport. In your example, this is SSH using the git username @ the instance URL. Next to the URL, the clone command also needs the namespace and project with the .git suffix.

Tip: There’s also an easier way to get the clone URL from the UI in the web interface. Navigate into the project repository overview and click on the right side on Clone.

image

A click on the copy icon copies the text into your clip board, and depending on your OS, you can insert it into the terminal then. On macOS, use cmd+v.

Cheers,
Michael

1 Like

Michael,

On the “Clone with SSH” box, I have a question? Breaking down the url in there:
git " I know this is the user"
@
gitlab.com → This comes from hostname on a deployment config? Is there any other way configure this?

Hi,

I’ve taken the screenshot from a project on GitLab.com SaaS, hence the gitlab.com URL. If you are running a self-managed instance, this will be the instance URL configured as external_url in your gitlab.rb settings. More in the documentation.

Cheers,
Michael

Thanks Michael. I had run across that and could have sworn I had it set. It might have been an issue with the envvar that was being used. So I set it directly in the gitlab.rb file.

This seemed to cause a few other issues (too many redirects so I will play with the reverse proxy…).

However, looking at the logs this seems like it worked.

Thanks so much.

Thanks,
Joe

In my case the Gitlab instance url was simply git@gitlab.com

7 Likes

In my case the Gitlab instance url was simply git@gitlab.com

Thanks! This was the solution for my case as well!

I go bit by this too. I kept trying things with my user name in it. The answer for most would be just git@gitlab.com. I suppose it is different if you have set up a company account with gitlab, but I just have a personal account here.

Bottom line: the help docs on ssh keys could explain this better. Nothing there defines ‘instance url’ so I was left wondering.

@ddoherty03 Thanks for sharing your feedback.

I’m trying to understand how the documentation should be changed. Currently, it says

  1. Open a terminal and run this command, replacing gitlab.example.com with your GitLab instance URL:
ssh -T git@gitlab.example.com

which instructs to replace gitlab.example.com only, thus keeping the leading user@ string being git@.

Would it be easier if the user login would be written using the -l parameter instead of the @ prefix?

ssh -T -l git gitlab.example.com

As such, only the GitLab instance URL gitlab.example.com would need to be replaced. On GitLab.com SaaS, the test can look like:

ssh T -l git gitlab.com

Welcome to GitLab, @dnsmichi!

Or we might need to better explain the user@server SSH connect pattern used in the command. Thoughts?

@dnsmichi, thanks for the quick reply. Might I suggest something like this:

  1. Open a terminal and run this command:
  ssh -T <instance url>

For most [or free or general?] users, the <instance url> is simply, git@gitlab.com, so you would run:

ssh -T git@gitlab.com

If you have a [domain-specific instance not sure what the best wording would be here I am new to gitlab] and your [domain name is] example.com, you would run:

ssh -T git@gitlab.example.com

I agree with @dnsmichi , the documentation is clear (and the part before the @ (and the @ itself) is not part of any url I’ve ever seen), so where were you trying to put in your username? Maybe it should just be made clear that is not a part of the instance url.

Although I never use -l (the first time I saw someone do it, I actually had to ask what it meant) @dnsmichi 's idea to do so in the documentation sounds like it might eliminate a lot of this confusion (and I doubt it’s possible to eliminate all, even with documentation that says “do this”, you get people asking “what to do?”).

1 Like

I ran into the same issue today. I simply have a free personal gitlab account (to host repositories on gitlab.com) and didn’t understand what was the instance url.

It was clear to me that only the part after git@ needed to be changed but I didn’t know what to change it to. What is not clear is the definition of instance url.

After reading this thread, I understood that in my case the instance url was simply: gitlab.com.