Installation

Install Gitlab on Ubuntu:

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo apt-get install gitlab-ee

Configuration

nano /etc/gitlab/gitlab.rb
  external_url "http://chenzhang.xyz/gitlab"
  unicorn['worker_timeout'] = 600
  unicorn['port'] = 8888
  web_server['external_users'] = ['www-data']
  nginx['enable'] = false
  ci_nginx['enable'] = false

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

Test

wget http://localhost:8888/gitlab
wget http://chenzhang.xyz/gitlab

References

GitLab Installation

Configuring the external URL for GitLab

How to Install and Configure GitLab on Ubuntu 16.04

Setting up Gitlab on Ubuntu 14.04 with Apache2 without owning a domain name