{"id":28286,"date":"2019-09-17T16:47:05","date_gmt":"2019-09-17T13:47:05","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=28286"},"modified":"2023-08-17T22:14:13","modified_gmt":"2023-08-17T19:14:13","slug":"install-and-configure-gitlab-ce-on-debian","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-and-configure-gitlab-ce-on-debian\/","title":{"rendered":"Install and Configure GitLab CE on Debian 11\/10"},"content":{"rendered":"\n<p>This guide will walk you through the steps to Install GitLab CE on Debian 11|Debian 10. <a aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-foss\" target=\"_blank\">GitLab Community Edition<\/a> (CE) is an open-source application for hosting Git repositories in your own  infrastructure. With GitLab you can do project planning and source code management to CI\/CD and monitoring. <em>GitLab<\/em> has evolved to become a complete DevOps platform, delivered as a single application.<\/p>\n\n\n\n<p>The next sections will cover the steps to be followed to have a running GitLab CE on Debian 11|Debian 10 Linux machine. Debian 11 is currently available for general use and we&#8217;ve chosen it to host our GitLab service.<\/p>\n\n\n\n<p>In my setup I&#8217;ll use a server with the following specs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>8GB<\/strong> of Ram<\/li>\n\n\n\n<li><strong>4 <\/strong>vcpus<\/li>\n\n\n\n<li><strong>40GB <\/strong>Disk space<\/li>\n\n\n\n<li>Domain name: <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/computingforgeeks.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">git.computingforgeeks.com<\/a><\/li>\n<\/ul>\n\n\n\n<p>See output shared below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ <span class=\"has-inline-color has-pale-pink-color\">free -h<\/span>\n              total        used        free      shared  buff\/cache   available\nMem:          7.8Gi        74Mi       7.6Gi       9.0Mi       101Mi       7.5Gi\nSwap:         4.0Gi          0B       4.0Gi\n\n$<span class=\"has-inline-color has-pale-pink-color\"> grep -c  ^processor \/proc\/cpuinfo <\/span>\n4\n\n$ <span class=\"has-inline-color has-pale-pink-color\">df -hT \/<\/span>\nFilesystem     Type  Size  Used Avail Use% Mounted on\n\/dev\/vda1      ext4   40G  963M   37G   3% \/<\/code><\/pre>\n\n\n\n<p>So let&#8217;s start installation of GitLab CE on Debian 11|Debian 10 system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Update Debian server<\/h2>\n\n\n\n<p>For newly installed Debian server, update all packages and upgrade any system packages to the latest release.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt -y full-upgrade\n&#91; -f \/var\/run\/reboot-required ] &amp;&amp; sudo reboot -f<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Install GitLab Server Dependencies<\/h2>\n\n\n\n<p>Once the server has been updated and rebooted, install important software packages for GitLab. All the packages are installed from default package repositories.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt -y install curl vim openssh-server ca-certificates<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Configure Postfix Send-Only SMTP<\/h2>\n\n\n\n<p>GitLab should be able to send emails to you on Git activities. Configure Postfix SMTP Server using the guide below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" href=\"https:\/\/computingforgeeks.com\/install-and-configure-postfix-smtp-server-on-debian\/\" target=\"_blank\">Install and Configure Postfix as a Send-Only SMTP Server on Debian <\/a><\/li>\n<\/ul>\n\n\n\n<p>Other email solutions can be used as discussed in detail on <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/docs.gitlab.com\/omnibus\/settings\/smtp.html\" target=\"_blank\">configure an external SMTP server<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Add the GitLab CE&nbsp;Repository<\/h2>\n\n\n\n<p>With the dependency packages installed, let&#8217;s add GitLab repository to our Debian 10 server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash<\/code><\/pre>\n\n\n\n<p>If this is successful, a positive message should be displayed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Running apt-get update... done.\nInstalling debian-archive-keyring which is needed for installing \napt-transport-https on many Debian systems.\nInstalling apt-transport-https... done.\nInstalling \/etc\/apt\/sources.list.d\/gitlab_gitlab-ce.list...done.\nImporting packagecloud gpg key... done.\nRunning apt-get update... done.\n\nThe repository is setup! You can now install packages.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Install GitLab CE on Debian<\/h2>\n\n\n\n<p>Next, install the GitLab package while changing <em><a href=\"https:\/\/computingforgeeks.com\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">https:\/\/gitlab.example.com<\/a><\/em> to the URL at which you want to access your GitLab instance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export GITLAB_URL=\"http:\/\/<span class=\"has-inline-color has-luminous-vivid-orange-color\">git.computingforgeeks.com<\/span>\"\nsudo EXTERNAL_URL=\"${GITLAB_URL}\" apt install gitlab-ce<\/code><\/pre>\n\n\n\n<p>If your server has a public IP and access to the internet, you can use <strong>https<\/strong> and Let&#8217;s Encrypt SSL certificate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export GITLAB_URL=\"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">https<\/mark>:\/\/<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">git.computingforgeeks.com<\/mark><\/mark>\"\nsudo EXTERNAL_URL=\"${GITLAB_URL}\" apt install gitlab-ce<\/code><\/pre>\n\n\n\n<p>The installation will automatically configure and start GitLab at the URL provided.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-1024x786.png\" alt=\"\" class=\"wp-image-28405\" style=\"width:768px;height:590px\" width=\"768\" height=\"590\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-1024x786.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-300x230.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-768x590.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-80x60.png 80w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-696x535.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-1068x820.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01-547x420.png 547w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-01.png 1405w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>Whenever you change GitLab configurations on<strong> \/etc\/gitlab\/gitlab.rb<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/gitlab\/gitlab.rb<\/code><\/pre>\n\n\n\n<p>Reconfigure the application by running the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gitlab-ctl reconfigure<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Access GitLab CE Web Interface<\/h2>\n\n\n\n<p>Once the installation of GitLab CE on Debian 11|Debian 10 is done, open the URL&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/computingforgeeks.com\/\" target=\"_blank\"><code>http:\/\/gitlab.example.com<\/code><\/a>&nbsp;on your browser to finish the installation of GitLab CE.<\/p>\n\n\n\n<p>On your first visit, you&#8217;ll be redirected to a password reset screen. Provide the password for the initial administrator account and click on  the <strong>Change your password<\/strong> button when you are finished.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-1024x493.png\" alt=\"\" class=\"wp-image-28414\" style=\"width:768px;height:370px\" width=\"768\" height=\"370\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-1024x493.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-300x145.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-768x370.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-696x335.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-1068x515.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02-872x420.png 872w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-02.png 1656w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>You will  be redirected back to the login screen. Use the default account&#8217;s  username <code>root<\/code> and password set to login<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-1024x497.png\" alt=\"\" class=\"wp-image-28419\" style=\"width:768px;height:373px\" width=\"768\" height=\"373\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-1024x497.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-300x146.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-768x373.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-696x338.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-1068x518.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03-866x420.png 866w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-03.png 1523w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>The next screen should be a Welcome to GitLab page.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized td-caption-align-https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-1024x471.png\" alt=\"\" class=\"wp-image-28424\" style=\"width:768px;height:353px\" width=\"768\" height=\"353\" title=\"\" srcset=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-1024x471.png 1024w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-300x138.png 300w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-768x353.png 768w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-696x320.png 696w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-1068x491.png 1068w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04-913x420.png 913w, https:\/\/computingforgeeks.com\/wp-content\/uploads\/2019\/09\/install-gitlab-debian-10-04.png 1883w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>Learn more from the <a aria-label=\"GitLab documentation (opens in a new tab)\" href=\"https:\/\/docs.gitlab.com\/ee\/README.html\" target=\"_blank\" rel=\"noreferrer noopener\">GitLab documentation<\/a>. More GitLab guides:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" href=\"https:\/\/computingforgeeks.com\/how-to-secure-gitlab-server-with-ssl-certificate\/\" target=\"_blank\">How To Secure GitLab Server with SSL Certificate<\/a><\/li>\n\n\n\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/computingforgeeks.com\/how-to-configure-gitlab-freeipa-authentication\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Configure GitLab FreeIPA LDAP Authentication<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This guide will walk you through the steps to Install GitLab CE on Debian 11|Debian 10. GitLab Community Edition (CE) is an open-source application for hosting Git repositories in your own infrastructure. With GitLab you can do project planning and source code management to CI\/CD and monitoring. GitLab has evolved to become a complete DevOps &#8230; <a title=\"Install and Configure GitLab CE on Debian 11\/10\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-and-configure-gitlab-ce-on-debian\/\" aria-label=\"Read more about Install and Configure GitLab CE on Debian 11\/10\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":28414,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[590,329,26,690,35913,39796,299,50],"tags":[533,728],"cfg_series":[],"class_list":["post-28286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","category-automation","category-debian","category-dev","category-devops","category-gitlab","category-how-to","category-linux-tutorials","tag-git","tag-gitlab"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/28286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=28286"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/28286\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/28414"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=28286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=28286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=28286"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=28286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}