Docker Private Registries (original) (raw)

Last Updated : 2 Sep, 2025

Docker registry is your own private repository where you can store your own Docker images and share them with others. Docker Registry is basically organized into Docker Repositories. Within the docker Repository, you can maintain specific versions of a Docker Image.

**What is Docker Private Registry?

A **Docker Private Registry is a dedicated storage and distribution system for your container images, hosted on your own infrastructure or private cloud. While Docker Hub is an excellent public resource, professional development teams require a secure, fast, and controlled environment for their proprietary application images. A private registry is the cornerstone of a secure and efficient software supply chain.

Why Choose a Private Registry?

Using a public registry like Docker Hub for private business applications is often not feasible. While Docker Hub offers private repositories, a dedicated private registry provides far more significant advantages, especially at scale.

Steps To Setup Private Docker Registry

Follow the below steps to setup the docker registry:

**Run a Private Docker Registry

**Step 1: Pull the Docker registry image using the below request:

$ docker pull registry

This command will pull the docker latest image from the docker registry

Pull registry

**Step 2: Configure and run the docker registry image using the below command:

$ docker run -d -p 5000:5000 --name localregistry registry

Run Container

This command will start the docker container registry on localhost port 5000. The base image used is the registry. The local registry will be the container name.

Now we will also look into how you can pull, push and delete images from the local registry container. When the local registry container is pushed successfully, it will return the container ID in the console.

You can verify by running the below command:

$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

25a66bd4219f registry "/entrypoint.sh /etc…" 10 seconds ago Up 9 seconds 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp localregistry

**Step 3: Pull images from DockerHub.

Let's try to pull some images from DockerHub and push them to your docker private registry. For demonstration, let's one version of the Ubuntu image and the latest Nginx server image.

Pull ubuntu

Pull nginx

**Push an Image to the Private Registry

**Step 1: Tag the images which were pulled from DockerHub.

Tag Images

**Step 2: Push the tagged images to your docker private registry.

docker push

**Push an Image to the Private Registry

**Step 1: Pull the docker nginx image from the private docker registry. We are here pulling the docker image of Nginx: latest hosted at private registry i.e at localhost:5000

docker pull, images