introduce
GitLab CE or Community Edition is an open source application primarily used for hosting Git repositories, and other development-related features such as issue tracking. It's designed to be hosted using your own infrastructure and give your development team the flexibility to deploy an internal repository, a common way to interact with users, or a way for contributors to host their own projects.
Ubuntu installation gitlab steps
1. Install dependencies
Open the command line window through the shortcut key ctrl+alt+T, and then run the following two lines of commands
sudo apt update
sudo apt-get upgrade
sudo apt-get install curl openssh-server ca-certificates postfix
If this step encounters the following prompt interface, please press Tab to switch to the "OK" button, and then press Enter.
Tab key to select OK
2. Install GitLab
Add the GitLab package and install it
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh |sudo bash
sudo apt-get install gitlab-ce
The following prompt appears, indicating that the installation is successful
3. Configure GitLab
The vim tiny version is pre-installed on ubuntu, and the vim full version is required
sudo apt install vim
enter the configuration file
sudo vim /etc/gitlab/gitlab.rb
1) Configure external IP and default port (about line 33)
4. Start GitLab
Enter the following command:
sudo gitlab-ctl stop //--停止服务
sudo gitlab-ctl reconfigure //--启动服务
sudo gitlab-ctl restart //--重启所有gitlab组件
sudo gitlab-ctl start //--启动所有gitlab组件
5. Initialize the password
The default password is in /etc/gitlab/initial_root_password
1)切换到相应路径下
cd /opt/gitlab/bin/
2)打开控制台
sudo gitlab-rails console -e production
3)查询用户账号信息并赋值给u
u=User.where(id:1).first
4)设置该用户名的密码
u.password=12345678
5)确认密码
u.password_confirmation=12345678
6)保存信息
u.save!
The password setting cannot be too simple, no less than 8 characters, and finally choose to use the default password.
view default password
6. Register a new account
You cannot log in immediately after registration, and must be approved by the administrator.
Log in to the administrator account
user:root
Password: CO3yIcusQMv+eQ4vvafj61oA8iNaYG*************
overview—users--pending approval
click approve
After the approval is completed, you can log in as a new user.