Private Docker Registry

Published on Author admin


Private Docker Registry

(on Debian8)

A Docker registry in the repository of images your created or downloaded. Registry may be public or private. If you using docker in your organisation you’ll definitely want your images to be secured. So, it’s time to deploy your own private docker registry.


Let’s start with the initial conditions. This private docker registry example based on 2 hosts:

  • 1st is docker registry ( OS: Debian 8
  • 2nd is docker test ( OS: Debian 8


# Docker Engine

First of all we need docker engine to be installed on your private docker registry host (

after all we can check docker

# Docker Compose

We also will need docker-compose

# Docker Registry

Firstly, we’ll create directories to store images, certs and auth file. I like all the docker data to be placed in the custom directory /data. I often mount separate disk to /data volume

Create user with password

Create certificates
You can create self-signed certificate or use letsencrypt( if you have a domain name registered.

Next steps are shown for those who are playing with IP as a docker private registry name
on the server)
edit /etc/ssl/openssl.cnf
and add after ‘[ v3_ca ]’ next:
subjectAltName = IP:


Let’s create sertificates:

You can leave everything by default EXCEPT the line
Common Name (e.g. server FQDN or YOUR name) []:

You will need to copy your domain.crt to all servers and put it right to

Otherwise you will have an error at login:

Create file /data/docker_registry_compose/docker-compose.yml:

Starting docker private registry:

My output:

Try it! Checking on the test host(NOT DOCKER REGISTRY)



# Playing with registry


Good luck, have fun! No drama 🙂


Useful links: