To setup and install GitLab community edition server on Ubuntu or CentOS server on Azure, AWS or GCP, the recommended way is to use the image available in the cloud marketplace. It comes pre configured with the latest version of GitLab CE with all the installed pre reqs.
Once your GitLab server has been deployed, the following links explain how to connect to a Linux VM:
- How to connect to a Linux VM on Azure
- How to connect to a Linux VM on AWS
- How to connect to a Linux VM on GCP
Once connected and logged in, follow the next steps on setting up GitLab community edition.
Configuring Domain Name for GitLab URL Access
If you would like to use you’re own DNS domain URL to access Git Lab web portal instead of using its IP address, run the following command to edit the gitlab.rb configuration file. Simply update the external_url field with your domain name as i’ve done below (make sure to add http:// ):
sudo vim /etc/gitlab/gitlab.rb
If you don’t want to use a domain name, simply add the servers IP making sure you put http:// into the config file as below:
To edit a VIM file press Shift+I, make the changes you need to and to save press ESC, then type :wq!
Now, run the reconfigure command to apply changes to Gitlab server. This will take some time once it completes to apply the changes.
sudo gitlab-ctl reconfigure
Setting up SSL Certificates for GitLab
The Gitlab also provide native support for configuring let’s encrypt SSL certificates. To enable the let’s encrypt SSL, edit the following values in configuration file. If you don’t want to, then you can skip this step
# Enable the Let's encrypt SSL letsencrypt['enable'] = true # This is optional to get SSL related alerts letsencrypt['contact_emails'] = ['firstname.lastname@example.org'] # This example renews every 7th day at 12:30 letsencrypt['auto_renew_hour'] = "12" letsencrypt['auto_renew_minute'] = "30" letsencrypt['auto_renew_day_of_month'] = "*/7"
If you edit the file, then run the config changes with the following command:
sudo gitlab-ctl reconfigure
Access the GitLab Web Dashboard
If you browse to the new URL or IP address of your server, you will now see the GitLab screen. Here you set a new password for access. Add a new password and press Change your password
If you get a 502 screen, it means the config changes are still being applied and need to wait a few more minutes. If you refresh the page after a minute or two you will eventually see the login screen.
Next screen, enter username root and your new password
You should now be logged into the GitLab portal and are now all set to start configuring as per your requirements.
GitLab Firewall Ports
For a list of the firewall ports that are used by GitLab server refer to the following:
If you are using any of the cloud platform firewalls (NSG, Security Groups), here are instructions on opening firewall ports:
To setup AWS firewall rules refer to – AWS Security Groups
To setup Azure firewall rules refer to – Azure Network Security Groups
To setup Google GCP firewall rules refer to – Creating GCP Firewalls
Disclaimer: GitLab is a registered trademark of GitLab Inc and is licensed under open-source (MIT) license. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.