02 November 2019 Docker Server

Setup your own Docker registry

Here is a short introduction on how to install your own Docker registry.


You need to have a working Docker environment and need basic knowledge of Docker containers and Dockerfiles.


We are using the public Docker registry image.

ahmet@testserver1:~$ docker pull registry:latest
Using default tag: latest
latest: Pulling from library/registry
c87736221ed0: Pull complete
1cc8e0bb44df: Pull complete
54d33bcb37f5: Pull complete
e8afc091c171: Pull complete
b4541f6d3db6: Pull complete
Digest: sha256:8004747f1e8cd820a148fb7499d71a76d45ff66bac6a29129bfdbfdc0154d146
Status: Downloaded newer image for registry:latest

Start the container:

ahmet@testserver1:~$ docker run -d -p 5000:5000 --restart always --name registry registry:latest

Check connectivity:

ahmet@testserver1:~$ curl -X GET http://localhost:5000/v2/_catalog

Since this is working fine, we can continue pushing our first image to our registry.

Push & Pull

Lets pull a simple alpine image, retag it and push it to our registry:

ahmet@testserver1:~$ docker pull alpine:latest
latest: Pulling from library/alpine
89d9c30c1d48: Pull complete
Digest: sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a
Status: Downloaded newer image for alpine:latest
ahmet@testserver1:~$ docker tag alpine:latest

Now let us check our catalogue:

ahmet@testserver1:~$ docker push
The push refers to repository []
03901b4a2ea8: Pushed
latest: digest: sha256:acd3ca9941a85e8ed16515bfc5328e4e2f8c128caa72959a58a127b7801ee01f size: 528
ahmet@testserver1:~$ curl -X GET http://localhost:5000/v2/_catalog

We are now able to pull our pushed image:

ahmet@testserver1:~$ docker rmi
ahmet@testserver1:~$ docker pull
Using default tag: latest
latest: Pulling from ymalpine
Digest: sha256:acd3ca9941a85e8ed16515bfc5328e4e2f8c128caa72959a58a127b7801ee01f
Status: Downloaded newer image for


This is the shortest way to install a Docker registry. But there are still some steps missing.

  1. Persistency: All pushed images will be gone after deleting the container. Think about using a docker volume.
docker run -d -p 5000:5000 --restart=always --name registry -v [DEIN PFAD]:/var/lib/registry registry:latest
  1. Use a Docker registry ui: https://github.com/Joxit/docker-registry-ui

  2. Install a reverse proxy with htpasswd and make it accessible via https. Otherwise it will only work locally and everyone could access your registry!

If you take those mentioned steps, your registry is production ready for small groups. If you are interested in enterprise or managed service, you can take a look at JFrog, Nexus, Gitlab and Github. These are only a few of many solutions.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket
comments powered by Disqus
Impressum · Datenschutzerklärung · Haftungsausschluss