SlideShare a Scribd company logo
1
• Git is a distributed revision control and source code management (SCM) system with an emphasis on speed.
Every Git working directory is a full-fledged repository with complete history and full version tracking
capabilities, not dependent on network access or a central server. Git is free software distributed under the
terms of the GNU General Public License version 2.
• GitHub is a web-based hosting service for software development projects that use the Git revision control
system. GitHub offers both paid plans for private repositories and free accounts for open-source projects.
In this tutorial, we will explain how to get your own GitHub instance running on your own Ubuntu 12.04 VPS. Ubuntu 12.04 is
recommended because of some incompatibilities between Python and Ruby on other Linux distributions. Also, make sure you
have at least 1GB RAM memory on your VPS. Our first step is to install some required packages and dependencies.
2
# sudo apt-get update
# sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-
dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev
Then, we are going to install Ruby 2.0.
# mkdir /tmp/ruby && cd /tmp/ruby
# curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
# cd ruby-2.0.0-p247
# ./configure
# make
# sudo make install
Once it is finished, we should make sure we are having the required version with and we should get an output with the Ruby
version:
# ruby –version
3
Then, we need to install Bundler gem. Bundler provides a consistent environment for Ruby projects by tracking and
installing the exact gems and versions that are needed. We also need to add a git user that will be used by GitLab.
# sudo gem install bundler --no-ri --no-rdoc
# sudo adduser --disabled-login --gecos 'GitLab' git
Once we are done with this, our next task is to clone the GitLab shell from its repository and set the environment.
# cd /home/git
# sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
# cd gitlab-shell
# sudo -u git -H git checkout v1.7.0
# sudo -u git -H cp config.yml.example config.yml
4
Now we have a local copy of the GitLab shell. There should be a sample config.yml file with it. We should
open config.yml using our favourite text editor and edit as follows:
gitlab_url: http://**yourdomain.com**/
Once that’s done, you can move on to running the GitLab shell installer:
# sudo -u git -H ./bin/install
We will use MySQL as the database backend and connect GitLab to it. We need to install MySQL database server
packages first. We will be asked to set a password during the installation. Make sure you remember or write it down
because we will need it later.
# sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
5
Now, we should log in to MySQL, using the password that we set and create the required user and database for GitLab.
# mysql -u root –p
Once we enter the password, we are in the MySQL command prompt. We will add users, create databases and set the correct
privileges to it.
CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '**enter-mysql-password**'; CREATE DATABASE IF NOT EXISTS
`gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; GRANT SELECT, LOCK TABLES, INSERT, UPDATE,
DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost’;
To make sure your new MySQL user was created successfully let’s log in to mysql using the GitLab user. When you’ll be
asked for the password, make sure to enter the one you selected above.
# mysql -u gitlab –p
6
If everything worked fine, we can proceed with the GitLab installation:
# cd /home/git
# sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
# cd /home/git/gitlab
# sudo -u git -H git checkout 6-0-stable
# sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
Similar like we did with the GitLab shell set up if we have a domain configured for our VPS we need to edit the config.yml to
use that domain. We should edit the file as follows:
gitlab:
## Web server settings
host: **yourdomain.com**
port: 80
https: false
7
Now we need to execute several commands in order to set the proper privileges for everything we installed:
cd /home/git/gitlab
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
sudo -u git -H mkdir public/uploads
sudo chmod -R u+rwX public/uploads
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
sudo -u git -H git config --global user.name "GitLab”
sudo -u git -H git config --global user.email "gitlab@localhost”
sudo -u git -H git config --global core.autocrlf input
sudo -u git cp config/database.yml.mysql config/database.yml
8
Now we need to configure GitLab to be able to connect to the MySQL database using the user we set up earlier. To do this,
we need to edit the config/database.yml file as follows:
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: gitlabhq_production
pool: 10
username:gitlab
password: "**enter-mysql-password**”
Once we save the file, we should change its access level, so the other users can’t find our password:
# sudo -u git -H chmod o-rwx config/database.yml
9
Now we need to install a few gem and the final step (enter yes when asked):
# cd /home/git/gitlab
# sudo gem install charlock_holmes --version '0.6.9.4’
# sudo -u git -H bundle install --deployment --without development test postgres aws
# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
If everything is installed successfully, we will get output similar to:
Administrator account created:
login.........admin@local.host
password......**your-password**
10
Remember to change the password after the first login. We should set GitLab to start on server boot:
# sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
# sudo chmod +x /etc/init.d/gitlab
# sudo update-rc.d gitlab defaults 21
In order to make sure that everything is running, we execute the following command. If no error message is displayed, we
are good. We can proceed and start GitLab
# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
# sudo service gitlab start
11
Now we need to install and make everything accessible via the web. We will use Nginx for this, once you install it, we copy
the same configuration file that came with GitLab.
# cd /home/git/gitlab
# sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
# sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
We need to edit /etc/nginx/sites-available/gitlab file to use your domain name. The setting is in the beginning on the file, so
it should look similar to:
server {
listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name **yourdomain.com**; #
12
You will have to put your fully qualified domain name instead of yourdomain.com then restart Nginx:
# sudo service nginx restart
That should be all. We have our own GitLab server fully functional. If we point our browser to the domain name we used for
this installation, we will get the GitLab login prompt. We can log in with the username and provided that you used when
installing, but we should change it right away. Now we can host and manage as many projects as we like.
13

More Related Content

Similar to How To Install GitLab As Your Private GitHub Clone

Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Wycliff1
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
Pantheon
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucketMedhat Dawoud
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
Oded Sagir
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
Juraj Hantak
 
Git Basics
Git BasicsGit Basics
Git Basics
Ryan Condron
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
Matt Gauger
 
Advanted git
Advanted git Advanted git
Advanted git
Sahil Gupta
 
Git github
Git githubGit github
Git github
Anurag Deb
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI
Sebastian Witowski
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)
Joel W. King
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The ServerWildan Maulana
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Git and Github
Git and GithubGit and Github
Git and Github
Teodora Ahkozidou
 
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
 
Magie di git
Magie di gitMagie di git
Magie di git
michele franzin
 

Similar to How To Install GitLab As Your Private GitHub Clone (20)

Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
Git hooks
Git hooksGit hooks
Git hooks
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucket
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Advanted git
Advanted git Advanted git
Advanted git
 
Git github
Git githubGit github
Git github
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The Server
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 
Magie di git
Magie di gitMagie di git
Magie di git
 

More from VEXXHOST Private Cloud

10 Essential Laravel 4 Packages Everyone Should Use.pptx
10 Essential Laravel 4 Packages Everyone Should Use.pptx10 Essential Laravel 4 Packages Everyone Should Use.pptx
10 Essential Laravel 4 Packages Everyone Should Use.pptx
VEXXHOST Private Cloud
 
How To Install Rails & Nginx with Passenger on Ubuntu
How To Install Rails & Nginx with Passenger on UbuntuHow To Install Rails & Nginx with Passenger on Ubuntu
How To Install Rails & Nginx with Passenger on Ubuntu
VEXXHOST Private Cloud
 
How To Create a SSL Certificate on Nginx for Ubuntu.pptx
How To Create a SSL Certificate on Nginx for Ubuntu.pptxHow To Create a SSL Certificate on Nginx for Ubuntu.pptx
How To Create a SSL Certificate on Nginx for Ubuntu.pptx
VEXXHOST Private Cloud
 
How to Add Swap on Ubuntu
How to Add Swap on UbuntuHow to Add Swap on Ubuntu
How to Add Swap on Ubuntu
VEXXHOST Private Cloud
 
Getting Started with MEAN Stack
Getting Started with MEAN StackGetting Started with MEAN Stack
Getting Started with MEAN Stack
VEXXHOST Private Cloud
 
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOSHow To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
VEXXHOST Private Cloud
 
Fixing 403 Forbidden Nginx Errors
Fixing 403 Forbidden Nginx ErrorsFixing 403 Forbidden Nginx Errors
Fixing 403 Forbidden Nginx Errors
VEXXHOST Private Cloud
 
WordPress App on Ubuntu 14.04 LTS
WordPress App on Ubuntu 14.04 LTSWordPress App on Ubuntu 14.04 LTS
WordPress App on Ubuntu 14.04 LTS
VEXXHOST Private Cloud
 
How to deploy a MariaDB Galera cluster on Ubuntu 14.04
How to deploy a MariaDB Galera cluster on Ubuntu 14.04How to deploy a MariaDB Galera cluster on Ubuntu 14.04
How to deploy a MariaDB Galera cluster on Ubuntu 14.04
VEXXHOST Private Cloud
 
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or UbuntuHow To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
VEXXHOST Private Cloud
 
How To Install Ruby on Rails on Ubuntu
How To Install Ruby on Rails on UbuntuHow To Install Ruby on Rails on Ubuntu
How To Install Ruby on Rails on Ubuntu
VEXXHOST Private Cloud
 
How To Run Nginx in a Docker Container on Ubuntu 16.04
How To Run Nginx in a Docker Container on Ubuntu 16.04How To Run Nginx in a Docker Container on Ubuntu 16.04
How To Run Nginx in a Docker Container on Ubuntu 16.04
VEXXHOST Private Cloud
 
How To Install & Configure Varnish with Apache on Ubuntu
How To Install & Configure Varnish with Apache on UbuntuHow To Install & Configure Varnish with Apache on Ubuntu
How To Install & Configure Varnish with Apache on Ubuntu
VEXXHOST Private Cloud
 
CentOS 6 to CentOS 7 Upgrade Procedure
CentOS 6 to CentOS 7 Upgrade ProcedureCentOS 6 to CentOS 7 Upgrade Procedure
CentOS 6 to CentOS 7 Upgrade Procedure
VEXXHOST Private Cloud
 
How To Deploy a Clojure Web Application on Ubuntu 14.04
How To Deploy a Clojure Web Application on Ubuntu 14.04How To Deploy a Clojure Web Application on Ubuntu 14.04
How To Deploy a Clojure Web Application on Ubuntu 14.04
VEXXHOST Private Cloud
 
How to setup OpenVPN Server and Client on Ubuntu 14.04
How to setup OpenVPN Server and Client on Ubuntu 14.04How to setup OpenVPN Server and Client on Ubuntu 14.04
How to setup OpenVPN Server and Client on Ubuntu 14.04
VEXXHOST Private Cloud
 
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
VEXXHOST Private Cloud
 

More from VEXXHOST Private Cloud (17)

10 Essential Laravel 4 Packages Everyone Should Use.pptx
10 Essential Laravel 4 Packages Everyone Should Use.pptx10 Essential Laravel 4 Packages Everyone Should Use.pptx
10 Essential Laravel 4 Packages Everyone Should Use.pptx
 
How To Install Rails & Nginx with Passenger on Ubuntu
How To Install Rails & Nginx with Passenger on UbuntuHow To Install Rails & Nginx with Passenger on Ubuntu
How To Install Rails & Nginx with Passenger on Ubuntu
 
How To Create a SSL Certificate on Nginx for Ubuntu.pptx
How To Create a SSL Certificate on Nginx for Ubuntu.pptxHow To Create a SSL Certificate on Nginx for Ubuntu.pptx
How To Create a SSL Certificate on Nginx for Ubuntu.pptx
 
How to Add Swap on Ubuntu
How to Add Swap on UbuntuHow to Add Swap on Ubuntu
How to Add Swap on Ubuntu
 
Getting Started with MEAN Stack
Getting Started with MEAN StackGetting Started with MEAN Stack
Getting Started with MEAN Stack
 
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOSHow To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
How To Securely Set Up Shipyard 2.0.10 with TLS on CoreOS
 
Fixing 403 Forbidden Nginx Errors
Fixing 403 Forbidden Nginx ErrorsFixing 403 Forbidden Nginx Errors
Fixing 403 Forbidden Nginx Errors
 
WordPress App on Ubuntu 14.04 LTS
WordPress App on Ubuntu 14.04 LTSWordPress App on Ubuntu 14.04 LTS
WordPress App on Ubuntu 14.04 LTS
 
How to deploy a MariaDB Galera cluster on Ubuntu 14.04
How to deploy a MariaDB Galera cluster on Ubuntu 14.04How to deploy a MariaDB Galera cluster on Ubuntu 14.04
How to deploy a MariaDB Galera cluster on Ubuntu 14.04
 
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or UbuntuHow To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
How To Mitigate & Fix OpenSSL Heartbeat on CentOS or Ubuntu
 
How To Install Ruby on Rails on Ubuntu
How To Install Ruby on Rails on UbuntuHow To Install Ruby on Rails on Ubuntu
How To Install Ruby on Rails on Ubuntu
 
How To Run Nginx in a Docker Container on Ubuntu 16.04
How To Run Nginx in a Docker Container on Ubuntu 16.04How To Run Nginx in a Docker Container on Ubuntu 16.04
How To Run Nginx in a Docker Container on Ubuntu 16.04
 
How To Install & Configure Varnish with Apache on Ubuntu
How To Install & Configure Varnish with Apache on UbuntuHow To Install & Configure Varnish with Apache on Ubuntu
How To Install & Configure Varnish with Apache on Ubuntu
 
CentOS 6 to CentOS 7 Upgrade Procedure
CentOS 6 to CentOS 7 Upgrade ProcedureCentOS 6 to CentOS 7 Upgrade Procedure
CentOS 6 to CentOS 7 Upgrade Procedure
 
How To Deploy a Clojure Web Application on Ubuntu 14.04
How To Deploy a Clojure Web Application on Ubuntu 14.04How To Deploy a Clojure Web Application on Ubuntu 14.04
How To Deploy a Clojure Web Application on Ubuntu 14.04
 
How to setup OpenVPN Server and Client on Ubuntu 14.04
How to setup OpenVPN Server and Client on Ubuntu 14.04How to setup OpenVPN Server and Client on Ubuntu 14.04
How to setup OpenVPN Server and Client on Ubuntu 14.04
 
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
How To Setup Highly Available Web Servers with Keepalived & Floating IPs on U...
 

Recently uploaded

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

How To Install GitLab As Your Private GitHub Clone

  • 1. 1
  • 2. • Git is a distributed revision control and source code management (SCM) system with an emphasis on speed. Every Git working directory is a full-fledged repository with complete history and full version tracking capabilities, not dependent on network access or a central server. Git is free software distributed under the terms of the GNU General Public License version 2. • GitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both paid plans for private repositories and free accounts for open-source projects. In this tutorial, we will explain how to get your own GitHub instance running on your own Ubuntu 12.04 VPS. Ubuntu 12.04 is recommended because of some incompatibilities between Python and Ruby on other Linux distributions. Also, make sure you have at least 1GB RAM memory on your VPS. Our first step is to install some required packages and dependencies. 2
  • 3. # sudo apt-get update # sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi- dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev Then, we are going to install Ruby 2.0. # mkdir /tmp/ruby && cd /tmp/ruby # curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz # cd ruby-2.0.0-p247 # ./configure # make # sudo make install Once it is finished, we should make sure we are having the required version with and we should get an output with the Ruby version: # ruby –version 3
  • 4. Then, we need to install Bundler gem. Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. We also need to add a git user that will be used by GitLab. # sudo gem install bundler --no-ri --no-rdoc # sudo adduser --disabled-login --gecos 'GitLab' git Once we are done with this, our next task is to clone the GitLab shell from its repository and set the environment. # cd /home/git # sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git # cd gitlab-shell # sudo -u git -H git checkout v1.7.0 # sudo -u git -H cp config.yml.example config.yml 4
  • 5. Now we have a local copy of the GitLab shell. There should be a sample config.yml file with it. We should open config.yml using our favourite text editor and edit as follows: gitlab_url: http://**yourdomain.com**/ Once that’s done, you can move on to running the GitLab shell installer: # sudo -u git -H ./bin/install We will use MySQL as the database backend and connect GitLab to it. We need to install MySQL database server packages first. We will be asked to set a password during the installation. Make sure you remember or write it down because we will need it later. # sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev 5
  • 6. Now, we should log in to MySQL, using the password that we set and create the required user and database for GitLab. # mysql -u root –p Once we enter the password, we are in the MySQL command prompt. We will add users, create databases and set the correct privileges to it. CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '**enter-mysql-password**'; CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost’; To make sure your new MySQL user was created successfully let’s log in to mysql using the GitLab user. When you’ll be asked for the password, make sure to enter the one you selected above. # mysql -u gitlab –p 6
  • 7. If everything worked fine, we can proceed with the GitLab installation: # cd /home/git # sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab # cd /home/git/gitlab # sudo -u git -H git checkout 6-0-stable # sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml Similar like we did with the GitLab shell set up if we have a domain configured for our VPS we need to edit the config.yml to use that domain. We should edit the file as follows: gitlab: ## Web server settings host: **yourdomain.com** port: 80 https: false 7
  • 8. Now we need to execute several commands in order to set the proper privileges for everything we installed: cd /home/git/gitlab sudo chown -R git log/ sudo chown -R git tmp/ sudo chmod -R u+rwX log/ sudo chmod -R u+rwX tmp/ sudo -u git -H mkdir /home/git/gitlab-satellites sudo -u git -H mkdir tmp/pids/ sudo -u git -H mkdir tmp/sockets/ sudo chmod -R u+rwX tmp/pids/ sudo chmod -R u+rwX tmp/sockets/ sudo -u git -H mkdir public/uploads sudo chmod -R u+rwX public/uploads sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb sudo -u git -H git config --global user.name "GitLab” sudo -u git -H git config --global user.email "gitlab@localhost” sudo -u git -H git config --global core.autocrlf input sudo -u git cp config/database.yml.mysql config/database.yml 8
  • 9. Now we need to configure GitLab to be able to connect to the MySQL database using the user we set up earlier. To do this, we need to edit the config/database.yml file as follows: production: adapter: mysql2 encoding: utf8 reconnect: false database: gitlabhq_production pool: 10 username:gitlab password: "**enter-mysql-password**” Once we save the file, we should change its access level, so the other users can’t find our password: # sudo -u git -H chmod o-rwx config/database.yml 9
  • 10. Now we need to install a few gem and the final step (enter yes when asked): # cd /home/git/gitlab # sudo gem install charlock_holmes --version '0.6.9.4’ # sudo -u git -H bundle install --deployment --without development test postgres aws # sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production If everything is installed successfully, we will get output similar to: Administrator account created: login.........admin@local.host password......**your-password** 10
  • 11. Remember to change the password after the first login. We should set GitLab to start on server boot: # sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab # sudo chmod +x /etc/init.d/gitlab # sudo update-rc.d gitlab defaults 21 In order to make sure that everything is running, we execute the following command. If no error message is displayed, we are good. We can proceed and start GitLab # sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production # sudo service gitlab start 11
  • 12. Now we need to install and make everything accessible via the web. We will use Nginx for this, once you install it, we copy the same configuration file that came with GitLab. # cd /home/git/gitlab # sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab # sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab We need to edit /etc/nginx/sites-available/gitlab file to use your domain name. The setting is in the beginning on the file, so it should look similar to: server { listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea server_name **yourdomain.com**; # 12
  • 13. You will have to put your fully qualified domain name instead of yourdomain.com then restart Nginx: # sudo service nginx restart That should be all. We have our own GitLab server fully functional. If we point our browser to the domain name we used for this installation, we will get the GitLab login prompt. We can log in with the username and provided that you used when installing, but we should change it right away. Now we can host and manage as many projects as we like. 13