How to Install GitLab enterprise edition on Ubuntu Server

 

Gitalb Installion:-

1. Install and configure the necessary dependencies

sudo apt-get update

sudo apt-get install -y curl openssh-server ca-certificates tzdata

 

Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.

 

sudo apt-get install -y postfix

 

During Postfix installation a configuration screen may appear. Select 'Internet Site' and press enter. Use your server's external DNS for 'mail name' and press enter. If additional screens appear, continue to press enter to accept the defaults.

2. Add the GitLab package repository and install the package

Add the GitLab package repository.

 

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

 

Next, install the GitLab package. Make sure you have correctly set up your DNS, and change https://gitlab.example.com to the URL at which you want to access your GitLab instance. Installation will automatically configure and start GitLab at that URL.

 

For https:// URLs GitLab will automatically request a certificate with Let's Encrypt, which requires inbound HTTP access and a valid hostname. You can also use your own certificate or just use http://.

 

sudo EXTERNAL_URL="ec2-13-201-178-63.ap-south-1.compute.amazonaws.com" sudo apt-get install gitlab-ee=17.6.1-ee.0

 

 

Start gitalb :- 

 

sudo gitlab-ctl reconfigure

 

3. Browse to the hostname and login

On your first visit, you'll be redirected to a password reset screen. Provide the password for the initial administrator account and you will be redirected back to the login screen. Use the default account's username root to login.

Default User Name :- root

Password :-   cd /etc/gitlab 

                       cat initial_root_password


[# WARNING: This value is valid only in the following conditions

#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).

#          2. Password hasn't been changed manually, either via UI or via command line.

#

#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.


Password: 85mzt5ESh1o3vVUCWCbjAZFwzFqFEA2cFeWHQcgHUec=


# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

]


See our documentation for detailed instructions on installing and configuration.

 

 

 

# Debian/Ubuntu Backup cd

sudo apt-get install rsync

sudo gitlab-backup create /location

sudo gitlab-ctl backup-etc <DIRECTORY>

 

data backup location /var/opt/gitlab/backups#

Gitalb config file location   /etc/gitlab

 

(Note:- Change gitlab.rb file extrnel url for restore time )

 

 

You have installed the exact same version and type (CE/EE) of GitLab Omnibus with which the backup was created.

You have run sudo gitlab-ctl reconfigure at least once.

GitLab is running. If not, start it using sudo gitlab-ctl start.

First make sure your backup tar file is in the backup directory described in the gitlab.rb configuration gitlab_rails['backup_path']. The default is /var/opt/gitlab/backups. It needs to be owned by the git user.

 

sudo cp /backups/1639814852_2021_12_18_13.8.3-ee_gitlab_backup.tar /var/opt/gitlab/backups/

sudo chown git.git /var/opt/gitlab/backups/1639814852_2021_12_18_13.8.3-ee_gitlab_backup.tar

 

Stop the processes that are connected to the database. Leave the rest of GitLab running:

 

sudo gitlab-ctl stop unicorn

sudo gitlab-ctl stop puma

sudo gitlab-ctl stop sidekiq

# Verify

sudo gitlab-ctl status

 

Next, restore the backup, specifying the timestamp of the backup you wish to restore:

 

restore  gitlab.rb ad gitlab-secrets.json file ..

 

(Note:- Change gitlab.rb file extrnel url for restore time )

 

 

# This command will overwrite the contents of your GitLab database!

sudo gitlab-backup restore BACKUP=(file name-ce/ee)

 

Reconfigure, restart and check GitLab:

 

sudo gitlab-ctl reconfigure

sudo gitlab-ctl restart

sudo gitlab-rake gitlab:check SANITIZE=true (Expand for output related to the GitLab application check)

 

sudo gitlab-ctl start unicorn

sudo gitlab-ctl start puma

sudo gitlab-ctl start sidekiq

 

 

 

Tail logs in a console on the server

If you want to ‘tail’, i.e. view live log updates of GitLab logs you can use gitlab-ctl tail.

 

# Tail all logs; press Ctrl-C to exit

sudo gitlab-ctl tail

 

# Drill down to a sub-directory of /var/log/gitlab

sudo gitlab-ctl tail gitlab-rails

 

 Gitlab Backup :- 

sudo gitlab-backup create

sudo gitlab-ctl backup-etc

 

 

 

Git Lab Email Configration :-

 

gitlab_rails['smtp_enable'] = true

gitlab_rails['smtp_address'] = "smtp.gmail.com"

gitlab_rails['smtp_port'] = 587

gitlab_rails['smtp_user_name'] = "**************"

gitlab_rails['smtp_password'] = "***********"

gitlab_rails['smtp_domain'] = "smtp.gmail.com"

gitlab_rails['smtp_authentication'] = "login"

gitlab_rails['smtp_enable_starttls_auto'] = true

gitlab_rails['smtp_tls'] = false

gitlab_rails['smtp_openssl_verify_mode'] = 'peer' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html

 

Our problem was that the command    sudo apt-get purge gitlab-ce does not delete all the config folders

 

 

 

Comments

Popular posts from this blog

How to install and configure OSSEC server and client

How to install nuke in windows 10 and windows 11,Installing Nuke on Windows, Install Nuke on Windows

Autodesk Maya 2024 Install Windows 11