✦ For everyone, free.

Practical knowledge for real and everyday life

Home

10.2.2 Hub Private Repositories

A focused guide to Hub Private Repositories, connecting core concepts with practical Docker and container operations.

Hub private repositories restrict a Docker Hub-hosted image's visibility and pull access to specifically authorized accounts, an option available alongside Docker Hub's free public hosting, typically subject to its own usage limits or pricing depending on the account's plan.

Creating a Private Repository

When pushing a new repository to Docker Hub, its visibility can be explicitly configured as private rather than the default public.

docker login
docker push myusername/internal-tool:1.0

The visibility of this newly created repository depends on how it was configured on Docker Hub's side — confirming or setting it to private, if that's the intent, is an important step not automatically implied by the push command itself.

Why Authentication Is Required to Pull a Private Repository

Unlike a public repository, pulling from a private one requires the pulling account to be explicitly authorized.

docker login
docker pull myusername/internal-tool:1.0

Without prior authentication as an authorized account, this pull fails, regardless of the fact that it's hosted on the otherwise broadly accessible Docker Hub.

Why Plan Limits May Apply to Private Repositories

Depending on Docker Hub's current offering, the number of private repositories available on a free account may be limited, with additional private repositories requiring a paid plan.

docker login
docker push myusername/another-private-tool:1.0

Checking current account limits before relying on additional private repositories avoids being unexpectedly blocked by a plan limitation.

Granting Specific Collaborators Access

A private repository's settings typically allow specific additional accounts to be granted access, without making the repository fully public.

docker login -u collaborator-account
docker pull myusername/internal-tool:1.0
Why Hub Private Repositories Matter

Private repository hosting on Docker Hub provides a convenient option for keeping proprietary or sensitive images appropriately restricted, without necessarily needing to operate an entirely separate, self-hosted private registry.

Content in this section