GitLab Tutorial - Part 1 - Your Own Private GitHub
9K views
Feb 15, 2023
Learn how to install GitLab on an Ubuntu Server, login, create our first code repo and push up our first commit. Not bad for one video. Full show notes at https://codereviewvideos.com/course/your-own-private-github/video/zero-to-gitlab-in-5-minutes
View Video Transcript
0:00
Hi this is Chris from CodeReviewVideos and in this video we're going to be looking at how we can install GitLab on an Ubuntu server
0:06
So in this video I'm installing GitLab on an Ubuntu virtual machine running inside Oracle's VirtualBox
0:12
but it doesn't really matter whether the machine's virtual or physical, the installation process is exactly the same
0:19
and just for reference I have one running on DigitalOcean and also a client one running on Linode
0:26
and they all work exactly the same. As long as you've got at least a gig of memory in them
0:31
that's about the bare minimum. And if you go at a gig, honestly
0:36
you're going to have to play with the swap file, which I'll cover in the show notes. But aside from that, if you're working
0:42
so if it's like your personal projects that you're storing, then effectively one gig, in my opinion
0:47
is going to be more than enough. But you can take a look at the links
0:51
as I say in the show notes, which will give you a slightly better idea as to the sort of RAM spec and the CPU spec etc if you're going to be using it
0:59
for a larger team. So as you can see we're installing the GitLab Omnibus
1:03
package and we're using the 7.10.1 release. Now thankfully since I put on
1:09
7 onto a DigitalOcean droplet and the installation process was quite involved you had to install various different pieces separately and so on but in the 7 release as you see in this video it really simple
1:23
It's almost like a one-liner. So, yeah, it's really not that difficult to get started with it
1:29
And essentially, the whole purpose of having a GitLab server running is so that you can store your own project
1:35
So you get the equivalent of having GitHub's functionality, but you've got it private and the benefits of doing that in my opinion are if you don't want
1:44
your code to be put in the hands of some faceless company not not saying necessarily a bad company
1:50
but i don't want my sort of intellectual property and as some of my clients see it the same way they
1:56
don't want the code that runs their business put out on like bitbucket or github regardless of
2:01
whether you're paying for that it's still in someone else's hands so worst case they could
2:07
take what you've done. It's kind of like tinfoil hat kind of stuff but at the same time
2:13
you do have to kind of take heed of the security implications of putting your
2:19
business critical code that runs your business then putting it on someone else's
2:25
servers is kind of crazy but the whole point really of GitLab is to bring all the functionality of having like GitHub or Bitbucket or whatever and putting that into a machine that you control
2:37
And really setting it up and managing it is not that difficult at all, but it's probably one of those things that seems a little bit more scary than it really is until you give it a shot
2:48
And so hopefully you'll see that, you know, within five minutes of watching this video, you could have a perfectly working GitLab instance
2:55
and in my opinion, GitLab is brilliant. So what you see in the background here now
3:00
is setting up the user account, the first user account that you set up. So you've got to change it
3:04
from that five life password that you get. And then once you log in, you can basically go about as though you would
3:09
as I say, you had your own GitHub running locally. As you can see in 7.10, I think
3:15
I'm not too sure if this came between 7.6 or 7.10, but after upgrading to 7.10
3:20
you can now import projects from GitHub and Bitbucket and whatnot. so there really is no excuse to not bring across your code base
3:28
What we're doing here is bringing in the SSH key from my laptop
3:32
and that will mean so that when you're pushing your code up you're not having to type passwords in or whatever
3:37
And then once we've set up this SSH key section we going to then set up our first project and add it as a remote like we normally would do if we were using GitHub or bitbucket or whatever the process doesn change it just the path that we pushing off the code to um will obviously not be one of those services it will be something that we control and there a
3:57
couple of little changes that they're going to catch me out here as you'll see but um yeah the
4:02
general gist of what we're doing is very similar to any of the other managed services so i've left
4:07
this sort of mistake in here well i say sort of mistake it was a mistake as you can see i've added
4:12
that in and even that is is wrong um you can see there it's going off to ubuntu master but i want
4:17
to show this piece anyway so that if you edit the .git slash config you can go in there and change
4:22
up the url of your remote the reason that i'm leaving that in is for two reasons the first it
4:29
was difficult to edit that out without making it look like well without having to start again
4:33
But the second thing is, if you're moving from, say, GitHub or whatever
4:38
and you want to move to using a GitLab, then changing that is as simple as just changing that one line in your config
4:46
And so, yeah, it's pretty straightforward to actually make a migration across
4:50
And as you'll see later on in this series, we can use all the continuous integration setups and stuff
4:57
and GitLab's got its own GitLab CI, which we will be covering. It's very, very cool, honestly
#File Sharing & Hosting
#Programming
#Video Sharing