We use and recommend omnibus method with latest Ubuntu LTS.
Install
Gitlab-CE Package
#Install and configure the necessary dependencies
sudo apt-get install curl openssh-server ca-certificates postfix
#Add the GitLab package server
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
#install the package
sudo apt-get install gitlab-ce
#Configure and start GitLab
sudo gitlab-ctl reconfigure
Configure
All Gitalb related configurations are stored in /etc/gitlab/gitlab.rb
vim /etc/gitlab/gitlab.rb
Useful links:
Gitlab offers too many options. We are using:
- Email sending via SMTP with AWS SES
- Inbound emails with Gmail IMAP
- Backup with Amazon S3
S3 Backup
Based on this official doc. For S3 instructions, jump here.
Backup
sudo gitlab-rake gitlab:backup:create
Setup Cron for Automated Backup
Run
crontab -e
Add
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
Restore
Download latest backup from S3 or copy from old server to location /var/opt/gitlab/backups
Run
# Stop the processes that are connected to the database.
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# Verify
sudo gitlab-ctl status
# Restore
sudo gitlab-rake gitlab:backup:restore
# Restart gitlab and verify
sudo gitlab-ctl start
sudo gitlab-rake gitlab:check SANITIZE=true
Upgrade
sudo apt-get update
sudo apt-get install gitlab-ce
Maintenance mode
Start
gitlab-ctl deploy-page up
Stop
gitlab-ctl deploy-page down
Useful
Todo
- Share configs
- main backup
- /etc/gitlab backup