GitLab CE Omnibus installation in Ubuntu 16.04
Install and configure the necessary dependencies
Select “local only” in this step, we will configure the SMTP in the following step.
sudo apt-get install curl openssh-server ca-certificates postfix
Add the GitLab package server and install the package
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
Configure and start GitLab
In order for GitLab to display correct repository clone links to your users it needs to know the URL under which it is reached by your users, e.g. http://gitlab.example.com. Add or edit the following line in /etc/gitlab/gitlab.rb:
external_url “http://achernar.ece.tamu.edu”
SMTP settings
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "my.email@gmail.com"
gitlab_rails['smtp_password'] = "my-gmail-password"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = none
Storing Git data in an alternative directory
By default, omnibus-gitlab stores the Git repository data under /var/opt/gitlab/git-data. The repositories are stored in a subfolder repositories. You can change the location of the git-data parent directory by adding the following line to /etc/gitlab/gitlab.rb.
git_data_dirs({"default" => "/mnt/nas/git-data"})
update these configuration by this command:
sudo gitlab-ctl reconfigure
You can also use this command to check if gitlab is installed correctly.
sudo gitlab-ctl status
The output should be like this:
run: gitlab-workhorse: (pid 11740) 82439s; run: log: (pid 11635) 82453s
run: logrotate: (pid 1481) 3248s; run: log: (pid 11659) 82449s
run: nginx: (pid 13931) 80894s; run: log: (pid 11643) 82451s
run: postgresql: (pid 11488) 82478s; run: log: (pid 11487) 82478s
run: redis: (pid 11401) 82484s; run: log: (pid 11400) 82484s
run: sidekiq: (pid 19645) 16362s; run: log: (pid 11625) 82455s
run: unicorn: (pid 19684) 16351s; run: log: (pid 11594) 82457s
Browse to the hostname and login
On your first visit, you'll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you'll be redirected back to the login screen.
The default account's username is root. Provide the password you created earlier and login. After login you can change the username if you wish.