How To Install GitLab Server In Linux

How To Install GitLab Server In Linux

How To Install GitLab Server In Linux

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed environment variables in .gitlab-ci.yml.

https://cloudaffaire.com/gitlab-ci-yml-part-ten-basics-of-environment-variables/

So far we have focused on the development aspects of GitLab using a free account provided by GitLab.com. Next, we will cover some basics of GitLab server administration. Instead of using GitLab.com provided GitLab server, you can install your own GitLab server. In this blog post, we will discuss how to install GitLab server in a Linux system.

GitLab Components:

A typical install of GitLab will be on GNU/Linux. It uses NGINX or Apache as a web front end to proxypass the Unicorn web server. By default, communication between Unicorn and the front end is via a Unix domain socket but forwarding requests via TCP is also supported. The web front end accesses /home/git/gitlab/public bypassing the Unicorn server to serve static pages, uploads (e.g. avatar images or attachments), and precompiled assets. GitLab serves web pages and the GitLab API using the Unicorn web server. It uses Sidekiq as a job queue which, in turn, uses Redis as a non-persistent database backend for job information, meta data, and incoming jobs.

The GitLab web app uses PostgreSQL for persistent database information (e.g. users, permissions, issues, other meta data). GitLab stores the bare Git repositories it serves in /home/git/repositories by default. It also keeps default branch and hook information with the bare repository. When serving repositories over HTTP/HTTPS GitLab utilizes the GitLab API to resolve authorization and access as well as serving Git objects.

The add-on component GitLab Shell serves repositories over SSH. It manages the SSH keys within /home/git/.ssh/authorized_keys which should not be manually edited. GitLab Shell accesses the bare repositories through Gitaly to serve Git objects and communicates with Redis to submit jobs to Sidekiq for GitLab to process. GitLab Shell queries the GitLab API to determine authorization and access.

Gitaly executes Git operations from GitLab Shell and the GitLab web app, and provides an API to the GitLab web app to get attributes from Git (e.g. title, branches, tags, other meta data), and to get blobs (e.g. diffs, commits, files).

How To Install GitLab Server In Linux

Below is the list of all components of GitLab:

  • NGINX: Webserver to routes requests to appropriate components, terminates SSL.
  • Unicorn (GitLab Rails): Handles requests for the web interface and API.
  • Sidekiq: Background jobs processor.
  • Gitaly: Git RPC service for handling all Git calls made by GitLab.
  • Praefect: A transparent proxy between any Git client and Gitaly storage nodes.
  • GitLab Workhorse: Smart reverse proxy, handles large HTTP requests.
  • GitLab Shell: Handles git over SSH sessions.
  • GitLab Pages: Hosts static websites.
  • Registry: Container registry, allows pushing and pulling of images.
  • Redis: Caching service.
  • PostgreSQL: Database for persistent database information (e.g. users, permissions, issues, other meta data).
  • PgBouncer: Database connection pooling, failover.
  • Consul: Database node discovery, failover.
  • GitLab self-monitoring: Prometheus: Time-series database, metrics collection, and query service.
  • GitLab self-monitoring: Alertmanager: Deduplicates, groups, and routes alerts from Prometheus.
  • GitLab self-monitoring: Grafana: Metrics dashboard.
  • GitLab self-monitoring: Sentry: Track errors generated by the GitLab instance.
  • GitLab self-monitoring: Jaeger: View traces generated by the GitLab instance.
  • Redis Exporter: Prometheus endpoint with Redis metrics.
  • PostgreSQL Exporter: Prometheus endpoint with PostgreSQL metrics.
  • PgBouncer Exporter: Prometheus endpoint with PgBouncer metrics.
  • GitLab Exporter: Generates a variety of GitLab metrics.
  • Node Exporter: Prometheus endpoint with system metrics.
  • Mattermost: Open-source Slack alternative.
  • MinIO: Object storage service.
  • Runner: Executes GitLab CI jobs.
  • Database Migrations: Database migrations.
  • Certificate Management: TLS Settings, Let’s Encrypt.
  • GitLab Geo Node: Geographically distributed GitLab nodes.
  • LDAP Authentication: Authenticate users against centralized LDAP directory.
  • Outbound email (SMTP): Send email messages to users.
  • Inbound email (SMTP): Receive messages to update issues.
  • Elasticsearch: Improved search within GitLab.
  • Sentry integration: Error tracking for deployed apps.
  • Jaeger integration: Distributed tracing for deployed apps.

Note: A typical GitLab install does not include all the above components.

How To Install GitLab Server In Linux?

Step 1: Install GitLab server.

Step 2: Log in to your GitLab Server. Open 192.168.0.10 in your favorite browser and set the root user password.

How To Install GitLab Server In Linux

Our GitLab server has been successfully installed.

How To Install GitLab Server In Linux

Hope you enjoyed this article. In the next blog post, we will discuss the GitLab Server Configuration.

To get more details on GitLab you can follow the below link.

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

To Get more details on Git you can follow the below links.

https://cloudaffaire.com/category/devops/git/

https://git-scm.com/doc

 

Leave a Reply

Close Menu