If you are a software developer or you are linked to software development you might know what is Git and GitHub.
For those who don’t know what is GitHub, GitHub is a web service based on the software Git (which is a versioning software written by Linus Torvald, creator of Linux). Git allows you to store the history of your software code base and easily control versioning. GitHub host all those Git repositories and also provides many other features like bug tracking, milestone creation and also the creation of Wiki for your project.
In this article, you will learn how to host your own git server like GitHub on your raspberry pi using GitLab.
GitHub is pretty amazing. It may satisfy all your code hosting requirements. But there are three main reasons to host your own git server.
The easiest and the cheapest way to create these type of Git server is by using the most versatile and cheap Raspberry Pi.
- A Raspberry Pi 3. (Raspberry Pi 3 is recommended as it has 64 bit CPU and GitLab requires a 64-bit architecture.)
- Power supply to feed your raspberry pi.
- 16 or 32GB microSD card to store the Git reposetory. (Make you have the latest version of Rasbpian Jessie flashed on the SD card and your SSH is enabled.)
Installing GitLab on the Raspberry Pi is very simple. It’s just 4 simple steps and that’s it! You are all done. Let’s get started.
First, login to your raspberry pi terminal using SSH and flow below steps.
This command will install postfix on your raspberry pi. If you want to send emails from your GitLab server please select ‘Internet Site’ during setup.
Run below command to configure your gitlab server for the first time. This command will take couple of minutes to execute.
That’s it. Congratulations!!! You sucessfully installed GitLab server on your Raspberry Pi. Now one final step is remaining.
Keep in mind that your default account’s username is root.
So, now you learned how you can host your own Git server at your home. This will cost you less than $50. But, it will provide you complete control over your codebase.
Later if you want to migrate to any of online git server, you can easily change your Git hosting by easily adding a remote pointing to the online repository.