First, the installation of Gitlab
1. Install dependent packages
1 $ sudo apt-get update
#如无ssh还需安装penssh-server
$ sudo apt-get install postfix ca-certificates-y//install postfix when selecting the Internet without smarthost
2. Add the image source of Tsinghua University
1) Trust Gitlab's GPG public key
$ curl Https://packages.gitlab.com/gpg.key 2>/dev/null | sudo apt-key add-&>/dev/null
2) Add File Gitlab.list
$ sudo vim/etc/apt/sources.list.d/gitlab.list
----------------------------------------------------------------------->
Deb Https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial Main
3, Installation Gitlab-ce
$ sudo apt-get update$ sudo apt-get install Gitlab-ce
4, Configuration Gitlab
$ sudo gitlab-ctl reconfigure
5. Start Postfix Service
$ sudo service postfix start
6. Open 80 port
$ sudo iptables-a input-p tcp-m tcp--dport 80-j ACCEPT
7, browser access gitlab:http://127.0.0.1: The first login needs to set a password, set up to log in, the default user is root.
Second, backup and recovery of Gitlab
1. Backup Gitlab: The file is placed in the/var/opt/gitlab/backups directory by default
2. Restore Gitlab Backup
1) Copy the backup file to/var/opt/gitlab/backups
# Only one backup file in case of restoring $ sudo gitlab-rake gitlab:backup:restore# multiple backup files is required to specify the file $ sudo gitlab-rake gitlab:backup:restore backup= Backup file name
2) Modify the configuration file/etc/gitlab/gitlab.rb
$ sudo sudo vim/etc/gitlab/gitlab.rb
------------------------------------------------------------>
gitlab_rails[' backup_path ' = '/home/backup ' //'/home/backup ' is the backup file path
3) need to reset Gitlab after modification
$ sudo gitlab-ctl reconfigure
UBUNTU16 Deployment Gitlab