How I set up a docker private registry with a web front-end

I wanted to set up a docker registry at home for images I build but which I do not want to be publicly available.  Running the default docker registry container was one solution.  But soon I found myself wishing there were a good front-end for it.

A quick search of both Docker Hub and the internet in general will yield several options to get that front-end.  I chose docker-registry-ui for mine.  It seemed to be a simple, easy-to-implement solution, and for the most part it was.  I will say that the author’s doc does not make some of the steps and choices clear, but most of the doc for this project was fine.  It’s FOSS, so no complaints here.

It utilizes docker-compose, so make sure you have that installed before you get moving.

Throughout this post, I reference the host running the containers as dockerhost.  Replace that with your host’s name, obviously.

Clone the repo

First I cloned the repo from

Make sure you read the examples to see which one best fits your scenario.  I suspect for most this will be the ui-as-standalone option.  I copied that subdirectory into a separate directory so that I could customize it and run docker-compose from there.  For example…

$ cp -r ui-as-standalone ~/docker/

Configure it

If you want to run without requiring authentication, you should edit simple.yml in the root of that subdirectory. There is a credentials.yml if you want to protect the instance by requiring usernames and passwords.

In my case, in simple.yml, I changed:

  • REGISTRY_URL: set it to the hostname and port of the machine running registry.
  • ports: I set my external port (the first number) to 8080. Set yours to what you want. Obviously, if you run other containers on this host, just make sure you’re not using the external port for one of those containers.
  • volumes: I added a volume entry that looks like this: ./registry-data:/var/lib/registry
    Also, since I had a previous registry running, I did a docker cp … to get the docker/ directory and all subfolders into the local directory .registry-data/.  That way the new container would already have my images pre-populated.  When the new registry container loads, it will already have that data.

My final config for docker-compose looks like this:

version: '2.0'
    image: registry:2.7
      - 5000:5000
      - ./registry-data:/var/lib/registry
      - ./registry-config/simple.yml:/etc/docker/registry/config.yml

    image: joxit/docker-registry-ui:latest
      - 8080:80
      - REGISTRY_TITLE=A docker registry
      - SINGLE_REGISTRY=true
      - registry

I also changed registry-config/simple.yml as follows:

  • Access-Control-Allow-Origin: [‘http://dockerhost:8080’]
    This allows you to access the instance from something other than localhost.

My final registry-config/simple.yml looks like this:

version: 0.1
    service: registry
      enabled: true
      blobdescriptor: inmemory
      rootdirectory: /var/lib/registry
  addr: :5000
    X-Content-Type-Options: [nosniff]
    Access-Control-Allow-Origin: ['http://dockhost:8080']
    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
    Access-Control-Allow-Headers: ['Authorization', 'Accept']
    Access-Control-Max-Age: [1728000]
    Access-Control-Allow-Credentials: [true]
    Access-Control-Expose-Headers: ['Docker-Content-Digest']

Run it

Once you’ve done that, it’s a simple step to run your containers:

$ docker-compose -f simple.yml up -d

Check it

Open a browser to http://dockerhost:8080 and see what you get.

Final notes

I did not play with setting up credentials.  It seems as simple as:

  • utilizing both files named credentials.yml rather than simple.yml
  • replacing the default credentials in registry-config/credentials.yml with your own, including a hashed password that you will have to generate

Overall this was a good fit for my needs.

You may also like...