Toggle navigation

GitLab Image Guide

Version CE10.1.0

Websoft9 GitLab Stack is a pre-configured, ready to run image for running GitLab on Alibaba Cloud.

GitLab Inc. is a company based on the GitLab open-source project. GitLab is an integrated product that unifies issues, code review, CI and CD into a single UI. GitLab Inc. offers self hosted products and SaaS plans for GitLab is an open source project with a large community. Over 1700 people worldwide have contributed to GitLab! GitLab Inc. is an active participant in this community, see our stewardship of GitLab CE for more information. For a more customer focused overview see our pitches. We have a lot of information available online, see the primer for a good start.

This Gitlab Image is used the Omnibus package for installation,it includes:Ruby,Gitlab-Rails,Gitlab-CI,Nginx,Postgresql..(You can view the version from:/opt/gitlab/version-manifest.txt)。

GitLab’s installation directory and settings(you can edit the:/etc/gitlab/gitlab.rb for more settting of Gitlab)

Default location Permissions Ownership Purpose
/var/opt/gitlab/git-data 0700 git:root Holds repositories directory
/var/opt/gitlab/git-data/repositories 2770 git:git Holds git repositories
/var/opt/gitlab/gitlab-rails/shared 0751 git:gitlab-www Holds large object directories
/var/opt/gitlab/gitlab-rails/shared/artifacts 0700 git:root Holds CI artifacts
/var/opt/gitlab/gitlab-rails/shared/lfs-objects 0700 git:root Holds LFS objects
/var/opt/gitlab/gitlab-rails/uploads 0700 git:root Holds user attachments
/var/opt/gitlab/gitlab-rails/shared/pages 0750 git:gitlab-www Holds user pages
/var/opt/gitlab/gitlab-ci/builds 0700 git:root Holds CI build logs
/var/opt/gitlab/.ssh 0700 git:git Holds authorized keys


Why Omnibus package?

We strongly recommend the Omnibus package installation since it is quicker to install, easier to upgrade, and it contains features to enhance reliability not found in other methods. We also strongly recommend at least 4GB of free memory to run GitLab.

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address and you can enter the GitLab login page directly,if there no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

You can use the Chrome or Firefox to visit the http://Internet IP Address/  after the Verify the Image step

Below is the Wizard of installation:

  1. Enter the start page,input you new password and confirm it,then click the button”Change your password”
  2. Log in to Gitlab(usename is root,password is set by yourself in previous step)
  3. Log in successfully,you can see the welcome information below

Remark:The memory of running the Gitlab need more than 4G,otherwise you can see the 502 error

Three usernames and passwords are required for application installation, application using, andapplication maintenance:

1、GitLab:Username is root, Password is set by yourself
2、Linux Server:Username is root,Password is set by youself when buying.
Please Using the Putty for ssh remote and WinSCP for SFTP

Note:You can reset the password of OS through Cloud Console if you have forgotten it


Connect to a Linux instance using Windows OS

This section uses PuTTY as an example. PuTTY can be downloaded here.

You can connect to a Linux instance via PuTTY as follows:

  1. Start Putty.exe.
  2. Enter the public IP address of the instance in Host Name (or IP address).
  3. Use the default port 22.
  4. Select SSH as Connection Type.
  5. Type a session name in Saved Sessions, and then click Save. In later logins, you may directly load the session without re-entering the IP address.
  6. Click Open to connect.
  7. Upon first connection, the following dialog box will be displayed. Click Yes.
  8. As prompted, enter the username and password for the Linux ECS instance. The password will not be displayed on-screen. Press the Enter key to complete connection to the instance.

When you connect your computer to the Linux instance successfully, you can operate the instance from your computer.

Use SFTP you can mange file,upload and download file,configure Server.

  1. Start WinSCP. Login Dialog will appear.
  2. Then select your File protocol(SFTP) on the dialog
  3. Enter your host name to Host name field, username to User name and password to Password like below
  4. You may want to save your session details to a site so you do not need to type them in every time you want to connect. Press Save button and type site name.
  5. When appear the dialog below,please select the “yes”
  6. You can manane Linux file below
  7. WinSCP can integrate the Putty and transfer the log in information to Putty
  8. Now you can use Putty(Not need to log in) from the menu bar of WinSCP

Coming soon

Routine backup (archives) of the database and application setup is essential to ensure failover is smooth.

Backup is based on the server snapshot automatic backup and manual local backup in two ways, both of which have their own advantages and disadvantages, it is recommended to use together

Automatic Backup by Snapshot of Server

IaaS provider have the “snapshot” function for Server, the snapshot is for the server disk. Snapshot tool can record the specified point in time the hard disk data, all backed up, and can achieve a key recovery.

If you have an automatic snapshot of the disk settings, the following scenes you can be more calm face:

  • Work a few days of the results, was mistakenly deleted
  • Hackers damage your site
  • The content has been messed up

Done a snapshot backup, a key to restore to the backup point of time state. That is, on-site reduction, very good function.

Different cloud vendor snapshot settings slightly different, specific reference:

Why 502 error?

Some times you may see the 502 error below

Please don’t worry,the  most likely reason is the lack of memory,you should add more memory or add swap for your Server.

Another reason,when retart Server or after the installation of Image,please wait for 5 minutes if you get 502 error

Use domain you should complete the following steps:

Step One:Domain resolution

e.g,If you using the AliCloud Domain product,you should log in to your Domain Console Panel

And find the domain name resolution interface,then add an A record to the Internet IP Address of Server from Domain Control Panel.

Step One:modify the vhost file

  1. Using SFTP to open the /etc/gitlab/gitlab.rb
  2. Add a line content:external_url “” to the gitlab.rb,then save it
  3. Using putty to run the command
    sudo gitlab-ctl reconfigure”

Omnibus GitLab have it own command set:

# Start all GitLab components
sudo gitlab-ctl start

# Stop all GitLab components
sudo gitlab-ctl stop

# Restart all GitLab components
sudo gitlab-ctl restart

# Restart Nginx
sudo gitlab-ctl restart nginx

Note that on a single-core server it may take up to a minute to restart Unicorn and Sidekiq. Your GitLab instance will give a 502 error until Unicorn is up again.

It is also possible to start, stop or restart individual components.

sudo gitlab-ctl restart sidekiq

Unicorn supports zero-downtime reloads. These can be triggered as follows:

sudo gitlab-ctl hup unicorn

Note that you cannot use a Unicorn reload to update the Ruby runtime.