Creating and Managing Private Docker Hub Repositories
Setting up private Docker Hub repositories, configuring team organizations, managing Access Tokens, setting up automated security scans, and controlling repository visibility.
Published on • November 18, 2026
AI Assistant

Docker Hub is the default global container registry used by millions of developers. While public repositories share container images openly with the world, enterprise teams and proprietary software developers require Private Repositories to restrict access to authenticated team members and automated CI/CD systems.
In this tutorial, we will walk through creating private repositories on Docker Hub, organizing permissions using Docker Teams, creating scoped Personal Access Tokens (PATs), and enabling automated security scanning.
Public vs Private Repositories on Docker Hub
+-----------------------------------------------------------------------------------+
| Public Repositories |
| - Readable by anyone globally without authentication |
| - Subject to anonymous pull rate limits (100 pulls / 6 hours) |
| - Ideal for open-source projects, base layers, and public tools |
+-----------------------------------------------------------------------------------+
| Private Repositories |
| - Access restricted to explicitly authorized accounts and team roles |
| - Protected against public scanning, unauthorized pulls, and data leaks |
| - Requires authentication via `docker login` |
+-----------------------------------------------------------------------------------+
Step 1: Creating a Private Repository
You can create private repositories via the Docker Hub Web console or programmatically using the Docker Hub API.
Via Docker Hub Console
- Log in to hub.docker.com.
- Click Create Repository.
- Choose your Namespace (Personal account or Organization).
- Enter the Repository Name (e.g.,
payment-gateway). - Select Private under Visibility settings.
- Click Create.
Registry URL Format:
docker.io/<organization-or-username>/<repository-name>:<tag>
Step 2: Authenticating with Personal Access Tokens (PATs)
Never use your personal account password in CI/CD build scripts or production servers. Instead, generate Personal Access Tokens (PATs) with least-privilege permissions.
Generating a PAT on Docker Hub
- Navigate to Account Settings -> Security -> New Access Token.
- Set a descriptive description (e.g.,
GitHub Actions Production Builder). - Select Access Permissions:
- Read-only: Best for deployment nodes and Kubernetes cluster image pull secrets.
- Read & Write: Best for CI/CD build pipelines pushing new images.
- Admin: For administrative automation.
- Copy the generated token string.
Authenticating via Terminal / CLI
# Log in using your username and generated PAT as the password
echo "dckr_pat_1234567890abcdef..." | docker login --username devops-bot --password-stdin
Step 3: Pushing to a Private Repository
Once authenticated, tag your local build with your Docker Hub organization/username namespace and push:
# 1. Build local container image
docker build -t payment-service:v1.2.0 .
# 2. Tag for target private repository
docker tag payment-service:v1.2.0 myorg/payment-gateway:v1.2.0
# 3. Push to private repository
docker push myorg/payment-gateway:v1.2.0
If an unauthenticated user attempts to pull myorg/payment-gateway:v1.2.0, Docker returns:
Error response from daemon: repository myorg/payment-gateway not found: does not exist or requires 'docker login'
Step 4: Organization and Team Management
For enterprise development teams, manage permissions using Organizations and Teams:
+-----------------------------------------------------------------------------------+
| Organization: myorg |
+-----------------------------------------------------------------------------------+
| ├── Team: Developers --> Permission: Read & Write on 'dev-*' repositories |
| ├── Team: SRE / Ops --> Permission: Read-Only on all repositories |
| └── Team: CI Robots --> Permission: Scoped Access Tokens per repo |
+-----------------------------------------------------------------------------------+
- Create Team: Create teams such as
frontend-devsorbackend-devs. - Assign Member Roles: Assign users as Owners, Editors, or Members.
- Repository Permissions: Grant granular permissions (Read-Only, Read & Write, or Admin) per team for specific repositories.
Step 5: Enabling Automated Security Vulnerability Scanning
Docker Hub provides automated CVE scanning powered by Docker Scout:
- In Docker Hub, navigate to your private repository.
- Under Repository Settings, enable Automatic Image Scanning.
- Every time a new tag is pushed, Docker Scout analyzes embedded packages against vulnerability databases and reports critical CVEs directly in the dashboard.
Summary Checklist for Private Repositories
| Action | Best Practice |
|---|---|
| Authentication | Always use Personal Access Tokens (PATs) instead of account passwords. |
| Least Privilege | Grant Read-Only PATs to deployment environments; Read-Write PATs to CI. |
| Governance | Group users into Teams under a shared Docker Hub Organization. |
| Security | Enable automated Docker Scout scanning on all private repositories. |
Setting up private Docker Hub repositories with proper access controls guarantees that your proprietary application images remain secure and manageable.