{"id":3626,"date":"2023-06-26T11:11:10","date_gmt":"2023-06-26T08:11:10","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3626"},"modified":"2023-06-26T11:11:12","modified_gmt":"2023-06-26T08:11:12","slug":"how-to-configure-a-private-docker-registry-in-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/","title":{"rendered":"How to Configure a Private Docker Registry in Ubuntu 22.04"},"content":{"rendered":"\n<p>There are situations where you might want to set up your own private Docker registry even though Docker Hub offers a public registry for storing and sharing Docker images. In this guide, we&#8217;ll show you how to set up a private Docker registry on Ubuntu 22.04 so you can manage your container images safely within your company.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Prerequisites\" title=\"Prerequisites:\">Prerequisites:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_1_Update_and_Upgrade_Packages_index\" title=\"Step 1: Update and Upgrade Packages index\">Step 1: Update and Upgrade Packages index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_2_Install_Docker_on_Ubuntu\" title=\"Step 2: Install Docker on Ubuntu\">Step 2: Install Docker on Ubuntu<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_3_Generate_SSL_Certificate\" title=\"Step 3: Generate SSL Certificate\">Step 3: Generate SSL Certificate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_4_Create_a_Registry_Configuration_File\" title=\"Step 4: Create a Registry Configuration File\">Step 4: Create a Registry Configuration File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_5_Start_the_Docker_Registry\" title=\"Step 5: Start the Docker Registry\">Step 5: Start the Docker Registry<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_6_Configure_Docker_Daemon\" title=\"Step 6: Configure Docker Daemon\">Step 6: Configure Docker Daemon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_7_Restart_Docker_Daemon\" title=\"Step 7: Restart Docker Daemon\">Step 7: Restart Docker Daemon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Step_8_Push_and_Pull_Images\" title=\"Step 8: Push and Pull Images\">Step 8: Push and Pull Images<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/#Final_Thoughts\" title=\"Final Thoughts\">Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Before we begin, make sure you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a virtual machine or an <a href=\"https:\/\/www.virtono.com\/cloud-vps\">Ubuntu 22.04 server<\/a>.<\/li>\n\n\n\n<li>access to the server as root or sudo.<\/li>\n\n\n\n<li>basic command-line and Docker knowledge.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_1_Update_and_Upgrade_Packages_index\"><\/span>Step 1: Update and Upgrade Packages index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Making sure your Ubuntu system is up to date is the first step. Run the following commands after opening a terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt update\nsudo apt upgrade -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_2_Install_Docker_on_Ubuntu\"><\/span>Step 2: Install Docker on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You must have <a href=\"https:\/\/en.wikipedia.org\/wiki\/Docker_(software)\" target=\"_blank\" rel=\"noopener\">Docker<\/a> installed on your system in order to create a private Docker registry. Run the commands below to install Docker:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install docker.io -y\nsudo systemctl start docker\nsudo systemctl enable docker<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"223\" data-attachment-id=\"3628\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/attachment\/screenshot-2023-06-26-at-10-29-35\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?fit=2458%2C730&amp;ssl=1\" data-orig-size=\"2458,730\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-06-26-at-10.29.35\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?fit=750%2C223&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=750%2C223&#038;ssl=1\" alt=\"How to Configure a Private Docker Registry in Ubuntu 22.04\" class=\"wp-image-3628\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=1024%2C304&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=300%2C89&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=768%2C228&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=1536%2C456&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?resize=2048%2C608&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.29.35.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_3_Generate_SSL_Certificate\"><\/span>Step 3: Generate SSL Certificate<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You must create an SSL certificate to protect your private Docker registry. To create a self-signed certificate, execute the commands below:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo mkdir \/certs\nsudo openssl req -newkey rsa:4096 -nodes -sha256 -keyout \/certs\/domain.key -x509 -days 365 -out \/certs\/domain.crt<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"160\" data-attachment-id=\"3629\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/attachment\/screenshot-2023-06-26-at-10-31-06\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?fit=2880%2C614&amp;ssl=1\" data-orig-size=\"2880,614\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-06-26-at-10.31.06\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?fit=750%2C160&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=750%2C160&#038;ssl=1\" alt=\"protect your private Docker registry\" class=\"wp-image-3629\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=1024%2C218&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=300%2C64&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=768%2C164&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=1536%2C327&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?resize=2048%2C437&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.31.06.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p>Ensure that &#8220;domain&#8221; is changed to your own domain name or IP address.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_4_Create_a_Registry_Configuration_File\"><\/span>Step 4: Create a Registry Configuration File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The Docker registry needs a configuration file, so we must do that next. Create a config.yml file using a text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>mkdir \/etc\/docker\/registry\/\nsudo nano \/etc\/docker\/registry\/config.yml<\/code><\/pre>\n\n\n\n<p>Copy and paste the configuration shown below into the file:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>version: 0.1\nlog:\n  level: info\n  formatter: json\n  fields:\n    service: registry\nstorage:\n  cache:\n    layerinfo: inmemory\n  filesystem:\n    rootdirectory: \/var\/lib\/registry\nhttp:\n  addr: :5000\n  tls:\n    certificate: \/certs\/domain.crt\n    key: \/certs\/domain.key<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_5_Start_the_Docker_Registry\"><\/span>Step 5: Start the Docker Registry<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now that we have the configuration file, we can launch the Docker registry. Run the command line:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo docker run -d -p 5000:5000 --restart=always --name registry -v \/etc\/docker\/registry:\/etc\/docker\/registry -v \/certs:\/certs -v \/var\/lib\/registry:\/var\/lib\/registry registry:2<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"155\" data-attachment-id=\"3630\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/attachment\/screenshot-2023-06-26-at-10-37-47\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?fit=2854%2C592&amp;ssl=1\" data-orig-size=\"2854,592\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-06-26-at-10.37.47\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?fit=750%2C155&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=750%2C155&#038;ssl=1\" alt=\"start Private Docker Registry\" class=\"wp-image-3630\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=1024%2C212&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=300%2C62&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=768%2C159&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=1536%2C319&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?resize=2048%2C425&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.37.47.png?w=2250&amp;ssl=1 2250w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p>By using this command, a container called &#8220;registry&#8221; is started with port 5000 open, and the official Docker registry image is downloaded. If the server reboots, the container will also restart automatically.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_6_Configure_Docker_Daemon\"><\/span>Step 6: Configure Docker Daemon<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You must set the Docker daemon to trust the SSL certificate in order for your Docker client to be able to communicate with the private registry. Create the file if it doesn&#8217;t already exist. Open the configuration file for the Docker daemon and add the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo nano \/etc\/docker\/daemon.json<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>{\n  \"insecure-registries\": &#91;],\n  \"registry-mirrors\": &#91;],\n  \"insecure-registries\": &#91;\"your-domain-or-ip:5000\"]\n}<\/code><\/pre>\n\n\n\n<p>Replace &#8220;your-domain-or-ip&#8221; with the correct domain name or server&#8217;s IP address.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_7_Restart_Docker_Daemon\"><\/span>Step 7: Restart Docker Daemon<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Restarting the Docker service after making changes to the Docker daemon configuration will make the changes effective:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo systemctl restart docker<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Step_8_Push_and_Pull_Images\"><\/span>Step 8: Push and Pull Images<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pull the Nginx image from Docker Hub:<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo docker pull nginx<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"250\" data-attachment-id=\"3631\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/attachment\/screenshot-2023-06-26-at-10-46-02\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?fit=1844%2C616&amp;ssl=1\" data-orig-size=\"1844,616\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-06-26-at-10.46.02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?fit=750%2C250&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?resize=750%2C250&#038;ssl=1\" alt=\"Push and Pull Images\" class=\"wp-image-3631\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?resize=1024%2C342&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?resize=768%2C257&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?resize=1536%2C513&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/Screenshot-2023-06-26-at-10.46.02.png?w=1844&amp;ssl=1 1844w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Tag the pulled Nginx image with your private registry address:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo docker tag nginx:latest server-ip:5000\/image-name:tag<\/code><\/pre>\n\n\n\n<p>Replace &#8220;image-name&#8221; with the desired name for your image, and &#8220;tag&#8221; with the version or tag you want to assign to the image.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Push the tagged image to your private docker registry:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo docker push server-ip:5000\/image-name:tag<\/code><\/pre>\n\n\n\n<p>Make sure to replace &#8220;image-name&#8221; and &#8220;tag&#8221; with the same values used in the previous step.<\/p>\n\n\n\n<p>These commands will allow Docker to push the Nginx image to your personal registry at server-ip:5000. The docker pull command can then be used on other machines with access to your registry to pull this image from your personal registry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In this tutorial, you have learned how to set up a private Docker registry on Ubuntu 22.04. By following these steps, you can create a secure environment for storing and managing your Docker images within your organization. Having a private docker registry gives you more control over your container images and allows for easier collaboration and deployment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are situations where you might want to set up your own private Docker registry even though Docker Hub offers a public registry for storing and sharing Docker images. In this guide, we&#8217;ll show you how to set up a private Docker registry on Ubuntu 22.04 so you can manage<\/p>\n","protected":false},"author":8,"featured_media":3632,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[549,550,547,536,546,545,548],"class_list":["post-3626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-configure-docker-registry","tag-configure-private-docker","tag-docker-registry","tag-install-docker","tag-private-docker","tag-private-docker-registry","tag-registry-configuration-file"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Configure-a-Private-Docker-Registry-in-Ubuntu-22-04.png?fit=600%2C330&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-Wu","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3954,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-and-configure-docker-swarm-on-ubuntu-22-04\/","url_meta":{"origin":3626,"position":0},"title":"How to Install and Configure Docker Swarm on Ubuntu 22.04","author":"George B.","date":"September 27, 2023","format":false,"excerpt":"This tutorial will show you how to install and configure Docker Swarm on Ubuntu 22.04 ensuring that you harness its full potential for your containerized applications. For effectively scaling and managing containers, Docker Swarm is still a great option. Many developers and DevOps experts prefer it because of its ease\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Install-and-Configure-Docker-Swarm-on-Ubuntu.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3166,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-docker-engine-on-ubuntu\/","url_meta":{"origin":3626,"position":1},"title":"How to Install Docker Engine on Ubuntu","author":"George B.","date":"April 5, 2023","format":false,"excerpt":"What is Docker Engine? Docker Engine is an open-source client-server technology that builds and runs containers using Docker components and services. It acts as a containerization technology that allows users to interact with the Docker daemon through the Docker Engine API. Docker Engine has a declarative model that automatically adjusts\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Docker-Engine-on-Ubuntu.png?fit=600%2C340&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Docker-Engine-on-Ubuntu.png?fit=600%2C340&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Docker-Engine-on-Ubuntu.png?fit=600%2C340&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3608,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-gitlab-ce-with-docker-on-ubuntu-22-04\/","url_meta":{"origin":3626,"position":2},"title":"How to Install GitLab CE with Docker on Ubuntu 22.04","author":"George B.","date":"June 24, 2023","format":false,"excerpt":"Introduction You can quickly set up your own GitLab instance, manage your repositories, and take advantage of its powerful features by installing GitLab CE with Docker. We'll walk you through the steps of installing GitLab CE with Docker on Ubuntu 22.04, ensuring a smooth installation and configuration. We'll also go\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-GitLab-CE-with-Docker-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-GitLab-CE-with-Docker-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-GitLab-CE-with-Docker-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3413,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-and-configure-kubernetes-on-ubuntu-22-04\/","url_meta":{"origin":3626,"position":3},"title":"How to install and configure Kubernetes on Ubuntu 22.04","author":"George B.","date":"May 28, 2023","format":false,"excerpt":"Welcome to our comprehensive guide on installing and configuring Kubernetes on Ubuntu 22. In this tutorial, we will walk you through the process of setting up a Kubernetes cluster on your Ubuntu 22 machine. Whether you are a beginner or an experienced user, this guide will provide you with detailed\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-and-configure-Kubernetes-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-and-configure-Kubernetes-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-install-and-configure-Kubernetes-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2296,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/docker-installation\/","url_meta":{"origin":3626,"position":4},"title":"Docker Installation","author":"Shreyash Sharma","date":"March 8, 2021","format":false,"excerpt":"I suggest you get machine to follow along this part. So here's a little plug of our own: Cloud VPS, for as little as \u20ac2.95 a month. This article is a part of our complete series of articles on Docker. Click here to access the Free Series. While Docker was\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/12122013Docker_twitter.png?fit=750%2C375&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/12122013Docker_twitter.png?fit=750%2C375&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/12122013Docker_twitter.png?fit=750%2C375&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/12122013Docker_twitter.png?fit=750%2C375&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3619,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-wordpress-using-docker-compose\/","url_meta":{"origin":3626,"position":5},"title":"How to Install WordPress using Docker Compose","author":"George B.","date":"June 25, 2023","format":false,"excerpt":"We will walk you through the process of installing WordPress using Docker Compose, allowing you to run your WordPress blog efficiently and effortlessly. WordPress is a popular content management system (CMS) that is used by millions of websites worldwide. Docker Compose, on the other hand, is a powerful tool for\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3626"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3626\/revisions"}],"predecessor-version":[{"id":3633,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3626\/revisions\/3633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3632"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}