Gitlab is the best alternative of Gitlab git repository management system. It provides option to users of self hosted version as well. You can simply install Gitlab on your serve and take full advantages of its outstanding features. This tutorial will help you install Install Gitlab Community edition on your own Ubuntu 6.04/14.04 & Debian 9/8 systems.
You can also visit Online Git Tutorial section to learn about Git command line tutorials and examples.
Use the following commands to install required dependcies to begin Gitlab installation.
$ sudo apt-get update && sudo apt-get upgrade $ sudo apt-get install -y curl openssh-server ca-certificates
Now, enable the Gitlab debian package repository on your system. Execute below command on your system, this will add a file /etc/apt/sources.list.d/gitlab_gitlab-ce.list in your system.
$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
After enabling apt repository, run following command to install Gitlab community edition.
$ sudo apt-get install gitlab-ce
The above command will install all the required applications including Nginx web server to run Gitlab on your system.
Now execute the following command to configure the Gitlab installation. This will make all the installations and required changes in order to run Gitlab community edition.
$ sudo gitlab-ctl reconfigure
Access Gitlab-CE Web UI
Access your server using domain name or IP address on standard http port 80. You will get the password change screen for root user for first time as below. Update the new secure password of root user.
After successfuly changed the password navigate to login screen and login with user “root” and the specified password.
After login you will get the dashboard access of your Gitlab server. Here you can start with creation of users and new git repositories.
Now visit our Git Tutorial to learn more about uses of Git repositories with command line helps and examples.
Schedule Gitlab Data Backup
Use the following command to create complete backup of Gitlab data. The default backup location will be /var/opt/gitlab/backups. You can change this setting in /etc/gitlab/gitlab.rb file.
$ sudo gitlab-rake gitlab:backup:create
You can also add the same command in scheduler to backup data nightly. The below cron will backup data.
0 22 * * 2-6 sudo gitlab-rake gitlab:backup:create