{"id":7268,"date":"2021-06-16T07:55:15","date_gmt":"2021-06-16T07:55:15","guid":{"rendered":"https:\/\/linuxways.net\/?p=7268"},"modified":"2021-06-16T07:55:15","modified_gmt":"2021-06-16T07:55:15","slug":"how-to-install-harbor-image-registry-in-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-harbor-image-registry-in-ubuntu-20-04\/","title":{"rendered":"How to Install Harbor Image Registry in Ubuntu 20.04"},"content":{"rendered":"<p>Today the Harbor image registry is widely used for storing container images. It has an extensible API and web UI supports content signing and validation for the images. Harbor images can be replicated across multiple harbor instances.<\/p>\n<p>This article will explain how to install harbor in the stable version of Ubuntu 20.04.<\/p>\n<h2>Prerequisites<\/h2>\n<ol>\n<li>Domain mapped to A record to get letsencrypt certificate. ( If you have your own certificate no need this)<\/li>\n<li>Internet connection to the server.<\/li>\n<li>Latest version of docker and docker-compose installed.<\/li>\n<\/ol>\n<h2>Configuration<\/h2>\n<p>First of all update your package repository,<\/p>\n<pre>$ sudo apt update<\/pre>\n<p>Harbor can be accessed in a secure environment using TLS encryption. For this, we are going to generate a letsencrypt certificate. You need to install the certbot package to get the certificate.<\/p>\n<p>( If you are going to use your own certificate then exclude the step )<\/p>\n<pre>$ sudo apt install certbot -y<\/pre>\n<p>Now generate a certificate, use your domain name and email.<\/p>\n<p>( If you are going to use your own certificate then exclude the step )<\/p>\n<pre>$ sudo certbot certonly --standalone -d \"harbor.yourdomain.com\" --preferred-challenges http --agree-tos -n -m \"admin@yourdomain.com\" --keep-until-expiring<\/pre>\n<p>By default certificate are generated in \/etc\/letsencrypt\/live\/harbor.yourdoain.com\/<\/p>\n<p>Let\u2019s begin to download the harbor package. Copy the following script and paste it in your terminal. It will download the latest version of harbor.<\/p>\n<pre>$ curl -s https:\/\/api.github.com\/repos\/goharbor\/harbor\/releases\/latest | grep browser_download_url | cut -d '\"' -f 4 | grep '\\.tgz$' | wget -i -<\/pre>\n<p>Extract the content using the following command.<\/p>\n<pre>$ tar zxvf harbor-offline-installer-v*.tgz<\/pre>\n<p>You will get a harbor directory, change to it.<\/p>\n<pre>$ cd harbor<\/pre>\n<p>You can see the installation script file and other configurations. An example of configuration is given in a temp file. Just copy it to the harbor.yml file.<\/p>\n<pre>$ cp harbor.yml.tmpl harbor.yml<\/pre>\n<p>Open the harbor.yml file and make necessary changes like harbor your hostname, http and https port, certificate path and admin dashboard password. If you have your own certificate then make sure they are in the path you defined.<\/p>\n<pre>$ vim harbor.yml<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"630\" class=\"wp-image-7269\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-465.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-465.png 910w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-465-300x208.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-465-768x532.png 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\" \/><\/p>\n<p>Also in the same file you can configure database password, maximum number of connections and volume to store your images. Save the file finally.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"274\" class=\"wp-image-7270\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-466.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-466.png 759w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-466-300x108.png 300w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/p>\n<p>Now, run the install script as shown below. The notary and chartmuseu are optional.<\/p>\n<p>Notary helps to digitally sign images using keys that verify content and publish them securely. Chartmuseum provides helm chart repositories.<\/p>\n<pre>$ sudo .\/install.sh --with-notary --with-chartmuseum<\/pre>\n<p>After the installation finished. Confirm by listing the port below.<\/p>\n<pre>$ sudo ss -tulpan | grep -i list<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1110\" height=\"302\" class=\"wp-image-7271\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-467.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-467.png 1110w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-467-300x82.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-467-1024x279.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-467-768x209.png 768w\" sizes=\"auto, (max-width: 1110px) 100vw, 1110px\" \/><\/p>\n<p>Also verify that there is some content in your data volume. And see log directory.<\/p>\n<pre>$ ls \/data<\/pre>\n<pre>$ ls \/var\/log\/harbor\/<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"146\" class=\"wp-image-7272\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-468.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-468.png 949w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-468-300x46.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-468-768x118.png 768w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/p>\n<h3>Harbor web access<\/h3>\n<p>Now you can access the harbor web. Type https:\/\/harbor.yourdomain.com<\/p>\n<p>To access harbor web use the credential you defined in above harbor.yml configuration.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"925\" height=\"483\" class=\"wp-image-7273\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-469.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-469.png 925w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-469-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-469-768x401.png 768w\" sizes=\"auto, (max-width: 925px) 100vw, 925px\" \/><\/p>\n<h3>Harbor dashboard<\/h3>\n<p>The dashboard is really nice and easy to use. You can create project and send your image to store and use it in the deployment.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1261\" height=\"582\" class=\"wp-image-7274\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-470.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-470.png 1261w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-470-300x138.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-470-1024x473.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-470-768x354.png 768w\" sizes=\"auto, (max-width: 1261px) 100vw, 1261px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>This article shows you how to install harbor in Ubuntu. The process is the same for all the Debian family of linux. Hope you enjoy it.<\/p>","protected":false},"excerpt":{"rendered":"<p>Today the Harbor image registry is widely used for storing container images. It has an extensible API and web UI supports content signing and validation for the images.&hellip;<\/p>","protected":false},"author":1,"featured_media":7352,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[373,100],"class_list":["post-7268","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-harbor-image-registry","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=7268"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7268\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/7352"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}