How to Setup GitLab CE Server Linux on Azure/AWS/GCP

To setup and install GitLab community edition server on Ubuntu, Debian 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.

Run GitLab Server Cloud

Table of Contents

GitLab CE Server Features

  • Efficiently manage repositories with forking, conflict resolution for merges, quick commit-reverts, and groups consisting of multiple people sharing a namespace for projects
  • Issue board for managing, organizing, and visualizing agile software projects
  • Fully functional CI/CD, with versioned build script, build pipelines, and deployment to multiple environments
  • Mattermost-based messaging built in for chat-ops
  • GitLab Web Editor enables editing of merge requests, files, and directories from the web interface
  • Secure authentication with LDAP and Active Directory, two-factor auth, and CAS integration
  • Deep integration with existing tools like JIRA, and the ability to configure an external PostgreSQL database using the Omnibus package.

Getting Started with GitLab Server on Linux

Once your GitLab server has been deployed, the following links explain how to connect to a Linux VM:

 

 

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!

Reconfigure GitLab

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
				
			

Reset GitLab CE root Password in Linux

By default, username of administrator account is root. Run the following command to reset the root password:

				
					sudo gitlab-rake 'gitlab:password:reset[root]'
				
			

Reconfigure GitLab

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'] = ['email@your-domain.com']
 
# 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.

Using GitLab GE Server and Support

Refer to GitLabs documentation on using Git Lab community edition server and for support:

 

https://docs.gitlab.com/

 

https://docs.gitlab.com/ce/README.html

GitLab Firewall Ports

For a list of the firewall ports that are used by GitLab server refer to the following:

 

https://docs.gitlab.com/omnibus/package-information/defaults.html

 

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.

Avatar for Andrew Fitzgerald
Andrew Fitzgerald

Cloud Solution Architect. Helping customers transform their business to the cloud. 20 years experience working in complex infrastructure environments and a Microsoft Certified Solutions Expert on everything Cloud.

4 2 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x