<\/span><\/h2>\n\n\n\nFresh installation of Ubuntu 20.04 requires the latest software updates. Execute the following command to update the system to its latest version:<\/p>\n\n\n\n
sudo apt update -y && apt upgrade -y<\/pre>\n\n\n\n<\/span> Step 2. Install dependencies <\/span><\/h2>\n\n\n\nAfter you update the system, you should now install the needed dependencies for the Gitlab installation.<\/p>\n\n\n\n
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl<\/code><\/pre>\n\n\n\nNext, you need to install postfix for the notification emails that you would be sent from GitLab. Note, you should have a domain or subdomain pointed to your server before continuing with the installation.<\/p>\n\n\n\n
sudo apt-get install -y postfix<\/code><\/pre>\n\n\n\nIf the configuration screen appears during the installation you can select the ‘Internet site’ option and enter the external DNS ‘mail name’ of your server in the next screen. For the next options, you can use the defaults by pressing enter.<\/p>\n\n\n\n
<\/span> Step 3. Install GitLab <\/span><\/h2>\n\n\n\nIf the previous installations were successful you now continue with your installation by adding the GitLab package repository with the following command.<\/p>\n\n\n\n
curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ee\/script.deb.sh | sudo bash<\/code><\/pre>\n\n\n\nYou are now ready to install GitLab, but before continuing, make sure again that you set up the DNS correctly for your domain or subdomain because you will be using it for the automatic installation. You can now run your GitLab installation with the command.<\/p>\n\n\n\n
sudo EXTERNAL_URL=\"https:\/\/example.domain.com\" apt-get install gitlab-ee<\/code><\/pre>\n\n\n\nNote that you should change the EXTERNAL_URL value with your domain or subdomain that you previously set up before starting the installation. During the installation, GitLab will automatically request a certificate from Let’s Encrypt if you used https:\/\/ in the EXTERNAL_URL value, you can also install with HTTP or use your own certificate.<\/p>\n\n\n\n
A random password will be generated for the root user during the installation, you can find the path for the password file at the end of the installation. Usually, you should be able to find the password file at \/etc\/gitlab\/initial_root_password<\/code>. Remember that this password will be stored only for 24 hours.<\/p>\n\n\n\nAfter the installation is finished you can check the service status with the command.<\/p>\n\n\n\n
sudo gitlab-ctl status<\/code><\/pre>\n\n\n\nAnd you should get similar output if all the services are running.<\/p>\n\n\n\n
run: crond: (pid 50291) 9059s; run: log: (pid 47093) 9462s\nrun: gitaly: (pid 50515) 9043s; run: log: (pid 46688) 9675s\nrun: gitlab-exporter: (pid 50330) 9057s; run: log: (pid 47359) 9356s\nrun: gitlab-workhorse: (pid 50261) 9060s; run: log: (pid 47163) 9423s\nrun: grafana: (pid 50463) 9047s; run: log: (pid 49444) 9136s\nrun: logrotate: (pid 120962) 2510s; run: log: (pid 46614) 9707s\nrun: nginx: (pid 47288) 9386s; run: log: (pid 47207) 9412s\nrun: node-exporter: (pid 50310) 9059s; run: log: (pid 47338) 9374s\nrun: postgres-exporter: (pid 50451) 9047s; run: log: (pid 47800) 9287s\nrun: postgresql: (pid 46828) 9647s; run: log: (pid 46845) 9643s\nrun: prometheus: (pid 50346) 9056s; run: log: (pid 47406) 9325s\nrun: puma: (pid 47097) 9458s; run: log: (pid 47105) 9455s\nrun: redis: (pid 46642) 9694s; run: log: (pid 46653) 9691s\nrun: redis-exporter: (pid 50338) 9057s; run: log: (pid 47379) 9342s\nrun: registry: (pid 50278) 9060s; run: log: (pid 47272) 9390s\nrun: sidekiq: (pid 47115) 9442s; run: log: (pid 47127) 9439s<\/code><\/pre>\n\n\n\nNow you should be able to access your GitLab application from your browser with the domain or subdomain that you previously set up.<\/p>\n\n\n\n <\/figure>\n\n\n\nYou can log in with root and the randomly generated password from \/etc\/gitlab\/initial_root_password<\/code>.<\/p>\n\n\n\nYou can start, stop or restart all the GitLab components with the following commands.<\/p>\n\n\n\n
sudo gitlab-ctl start\n\nsudo gitlab-ctl stop\n\nsudo gitlab-ctl restart<\/code><\/pre>\n\n\n\nYou can also start, stop or restart individual components of GitLab. For example, if you want to restart grafana you can do that with the following command.<\/p>\n\n\n\n
# sudo gitlab-ctl restart grafana\nok: run: grafana: (pid 151924) 1s\n<\/code><\/pre>\n\n\n\nBy default, GitLab will allow new user signups, for secure access it is advised to disable it. You can disable it from the GitLab web console – Menu > Admin -> Uncheck the Sign-up enabled box.<\/p>\n\n\n\n