Docker hub is an online cloud service which provides a platform for users to get images for container as well as for sharing their images to other users. This is a great way to import or export images but some users might want an offline registry service in their local machine. Docker provides a way for users to do this through a ready to be hosted docker image itself.
To install docker registry in local machine, run following command in docker client:
$ docker run -d -p 5000:5000 --restart=always --name registry registry:2
To setup authentication and TLS for secure connection, visit the official docker page.