---
title: "How to set up a Private, Remote and Virtual Docker Registry"
url: "https://jfrog.com/blog/how-to-set-up-a-private-remote-and-virtual-docker-registry/"
canonical: "https://jfrog.com/blog/how-to-set-up-a-private-remote-and-virtual-docker-registry/"
lang: "en-US"
type: "article"
description: "Learn how to easily manage and organize your Docker images in a Docker registry with just a few simple steps. Create a private local, remote and virtual repository."
date: "2024-03-05T08:00:26"
modified: "2024-06-06T11:22:01"
---
# How to set up a Private, Remote and Virtual Docker Registry

[Blog Home](https://jfrog.com/blog/)

![How to setup Docker Registry](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/How-to-setup-Docker-Registry_863x300.jpg.optimal.jpg)

The simplest way to manage and organize your [Docker images](https://jfrog.com/knowledge-base/a-beginners-guide-to-understanding-and-building-docker-images/) is with a Docker registry. You need reliable, secure, consistent and efficient access to your Docker images that’s shared across your team in a central location, including a place to set up multiple registries that work transparently with the Docker client.

There are three different repository types in JFrog Artifactory that you will use regularly for all of your package types, including Docker container images:

*   [**Local repositories**](https://docs.jfrog.com/artifactory/docs/getting-started) are a place for your internal Docker images.
*   [**Remote repositories**](https://docs.jfrog.com/artifactory/docs/getting-started) are used to proxy remote Docker resources such as Docker Hub.
*   [**Virtual repositories**](https://docs.jfrog.com/artifactory/docs/getting-started) can aggregate multiple Docker registries thus enabling a single endpoint you can use for both pushing and pulling Docker images. This enables the admin to manage the different Docker registries without requiring users of the repository to change repository urls in their environments

Starting with a free trial of the JFrog Platform in the Cloud, you can set up a free local, remote and virtual [Docker Registry](https://docs.jfrog.com/artifactory/docs/docker-repositories) in minutes. This blog post will take you through the steps.

## Before you start

Here’s what you’ll need:

*   [Docker installed](https://docs.docker.com/get-docker/).
*   [JFrog Platform Cloud Trial](https://jfrog.com/start-free). (Free throughout the length of the trial.)

* * *

[Set Up Your Free Private Docker Registry](https://jfrog.com/start-free/)

* * *

## Step 1: Login to your environment and navigate to the Platform Configurations screen

After signing up for a cloud trial, you should have received an email with your environment url and username. The password would have been created during the signup process.  Login to your environment, click the Platform Configurations screen gear icon in the upper left corner, and select the _Repositories_ menu item.

![Step 1 - Login to your environment and navigate to the Platform Configurations screen](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/1_Step-1-Login-to-your-environment-and-navigate-to-the-Platform-Configurations-screen.png)

## Step 2: Add local Docker repository

Used to store your custom Docker image you will create in a later step.

Expand the _Create a Repository_ menu and select the _Local_ menu item. You will be presented with a number of different choices for a package type. Select the Docker package type.

![Step 2 - Add local Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/2_Step-2-Add-local-Docker-repository.png)

Enter the Repository Key “_docker-dev-local_” and keep the rest of the default settings. Click the Create _Local Repository_ button.

![Step 2 - Add local Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/3_Step-2-Add-local-Docker-repository.png)

You may be prompted to set up a Docker client at this point. Skip this for now.

You should now see your new local Docker repository in the Local repository list.

## Step 3: Add remote Docker repository

Used as a caching proxy, to store 3rd party images from Docker Hub or any other external registries.

As in the previous step, expand the _Create a Repository_ menu, but this time select the _Remote_ menu item. Again, select the Docker package type. Enter the Repository Key “_docker-hub-remote_” and keep the rest of the default settings.

![Step 3 - Add remote Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/4_Step-3-Add-remote-Docker-repository.png)

If prompted, skip setting up a client. You should now see your new remote Docker repository in the Remote repository list.

## Step 4: Add virtual Docker repository

Used when creating your custom Docker image. This repository will be set up so that you can push to your local Docker repository and pull from either your local or remote Docker repository.

Expand the _Create a Repository_ menu and select the _Virtual_ menu item. Select the Docker package type.  There are three things you will need to do here:

1.  Enter the Repository Key “_docker_”  
    ![Step 4 - Add virtual Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/5_Step-4-Add-virtual-Docker-repository.png)
2.  Scroll down the settings page and add the local and remote docker repositories you created in Steps 2 and 3 (move them from Available Repositories to Selected Repositories using the arrow buttons). The order of these repositories in the list will determine the order used to resolve the dependencies required for building your docker image.  
    ![Step 4 - Add virtual Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/6_Step-4-Add-virtual-Docker-repository.png)
3.  Select your local repository that you created in Step 2 as the Default Deployment Repository. The Default Deployment Repository is the repository that the docker image you build will be pushed to. Keep the rest of the default settings.  
    ![Step 4 - Add virtual Docker repository](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/7_Step-4-Add-virtual-Docker-repository.png)

Click the _Create Virtual Repository_ button and skip through the client setup prompt. You should now see your new virtual Docker repository in the Virtual repository list.

## Step 5: Fork the JFrog Docker example GitHub repo 

[This repository](https://github.com/jfrog/jfrog-docker-repo-simple-example) contains a simple Dockerfile you can use to build a custom image and is intended to help you understand the important parts of a Dockerfile that need to change in order to use the new Docker repositories you just created. Fork the repo so that you have your own copy to experiment with.

![Step 5 - Fork the JFrog Docker example GitHub repo](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/8_Step-5-Fork-the-JFrog-Docker-example-GitHub-repo.png)

## Step 6: Update the base image reference

Clone your forked repository and using an IDE or a simple text editor on your machine, update the FROM line of the Dockerfile to reference your virtual Docker repository.

```
FROM ${SERVER_NAME}.jfrog.io/${VIRTUAL_REPO_NAME}/alpine:3.11.5
```

The **SERVER\_NAME** is the first part of the URL given to you for your environment: _https://SERVER\_NAME.jfrog.io_

The **VIRTUAL\_REPO\_NAME** is the name “_docker_” that you assigned to your virtual repository in Step 4.

![Step 5 - Fork the JFrog Docker example GitHub repo](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/9_Step-5-Fork-the-JFrog-Docker-example-GitHub-repo.png)

## Step 7: Push custom image to your Docker repository

Using either your IDE or your terminal, login to your virtual repository, build, tag and push your custom image with the following commands (as in Step 6, use your SERVER\_NAME and VIRTUAL\_REPO\_NAME):

```
> docker login SERVER_NAME.jfrog.io
```

```
> docker build --tag SERVER_NAME.jfrog.io/VIRTUAL_REPO_NAME/my-docker-image:latest .
```

```
> docker push SERVER_NAME.jfrog.io/VIRTUAL_REPO_NAME/my-docker-image:latest
```

## Step 8: View the images in your Docker Registry

Leave the Platform Configurations screen using the navigation at the top left.

![Step 8 - View the images in your Docker Registry](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/10_Step-8-View-the-images-in-your-Docker-Registry.png)

Expand the Artifactory menu and click the Artifacts menu item. In the _Artifact Tree View_, expand the _docker_, the _docker-dev-local_ and the _docker-hub-remote_ repositories to see your new artifacts. Click on your image in your _docker-dev-local_ repository to see its details.

![Step 8 - View the images in your Docker Registry](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/06/11_Step-8-View-the-images-in-your-Docker-Registry.png)

## Your Docker Registries

Once you’re done and configured your Docker registries, you’ll be able to store all your Docker images in your [local, remote and virtual repositories](https://www.jfrog.com/confluence/display/JFROG/JFrog+Container+Registry#JFrogContainerRegistry-Local,RemoteandVirtualRepositories).

That’s it!

Now, all that’s left is for you to try it for yourself.

## YOU MAY ALSO LIKE

[Blog Manage Your Docker Builds with JFROG CLI in 5 Easy Steps! Read Now](https://jfrog.com/blog/manage-your-docker-builds-with-jfrog-cli-in-5-easy-steps/)

[Resource Setup JFrog Artifactory as your container registry Learn More](https://jfrog.com/container-registry/)

[Resource A Beginner’s Guide to Docker Images Read Now](https://jfrog.com/knowledge-base/a-beginners-guide-to-understanding-and-building-docker-images/)