Skip to content

Harbor

1. What Is Harbor?

Harbor is an open-source, enterprise-grade container registry used to store, manage, and serve container images (Docker/OCI) and Helm charts. It is built on top of the standard Docker Registry but adds a lot of enterprise features you wonโ€™t find in the vanilla registry. (OneDPM)

๐Ÿ”‘ Key Points

  • Harbor stores container images and OCI artifacts (like Helm charts). (็‘žๆฉ็ฌ”่ฎฐ)
  • It provides a Web UI, access control & RBAC, audit logs, vulnerability scanning, and replication between registries. (OneDPM)
  • Itโ€™s widely used in DevOps/CICD pipelines in enterprises and internal infrastructure. (็‘žๆฉ็ฌ”่ฎฐ)

2. Why Use Harbor?

Compared with a simple Docker Registry:

โœ… Web UI to browse images

โœ… Role-Based Access Control (RBAC)

โœ… LDAP/AD integration

โœ… Vulnerability scanning (e.g., Trivy)

โœ… Mirroring/replication between multiple Harbor instances

โœ… Project-level isolation

โœ… Helm chart repository support (็‘žๆฉ็ฌ”่ฎฐ)

These features make Harbor suitable for teams and enterprises that need secure and manageable image storage. (OneDPM)

3. Prerequisites

Before installing Harbor, make sure you have:

๐Ÿ”น A VM/server with Linux (e.g., Ubuntu/CentOS)

๐Ÿ”น Docker installed (Docker 20.10+ recommended)

๐Ÿ”น docker-compose installed

๐Ÿ”น 40 GB+ disk space (more if you store lots of images) (็Ž‹ๆฅšๆฑŸ)

4. Installing Harbor (Quick Guide)

Harbor provides installers that automate deployment using Docker and docker-compose. Official docs cover a full install process. (Harbor)

1) Download the Harbor Installer

Go to the Harbor releases page on GitHub and fetch the latest version:

wget https://github.com/goharbor/harbor/releases/download/<version>/harbor-online-installer-<version>.tgz
tar -zxvf harbor-online-installer-<version>.tgz
cd harbor

2) Configure Harbor

Copy the sample config file:

cp harbor.yml.tmpl harbor.yml

Then edit harbor.yml:

  • Set your serverโ€™s hostname or IP under hostname:
  • Optionally set HTTPS certificates if you want secure access
  • Define the admin password (่…พ่ฎฏไบ‘)

3) Run the Installer

Once configured:

sudo ./install.sh

This generates docker-compose files and starts all Harbor microservices automatically. (่…พ่ฎฏไบ‘)

5. Logging Into Harbor

After installation completes:

  1. Open a browser to http://<your-host>:<port>
  2. Login with default credentials:

6. Pushing and Pulling Images

Once Harbor is up, you can push and pull container images just like any other registry.

Example (replace with your host/project):

docker login <your-harbor-host>
docker pull nginx:latest
docker tag nginx:latest <your-harbor-host>/library/nginx:latest
docker push <your-harbor-host>/library/nginx:latest

If youโ€™re using HTTP instead of HTTPS, you may need to mark the registry as insecure in your Docker daemon config (insecure-registries). (็Ž‹ๆฅšๆฑŸ)

7. Useful Harbor Features

๐Ÿ—‚ Projects & Repositories

Harbor groups images into projects. Each project can be public or private and has fine-grained access control. (็‘žๆฉ็ฌ”่ฎฐ)

๐Ÿ” Vulnerability Scanning

Harbor integrates scanners (Trivy, Clair) that analyze images for CVEs and report findings directly in the UI. (็‘žๆฉ็ฌ”่ฎฐ)


๐Ÿ” Replication

Harbor can replicate images across multiple Harbor instances (useful for multi-region/high-availability setups). (็‘žๆฉ็ฌ”่ฎฐ)

8. Tips for Beginners

โœ… Use HTTPS in production (prevents insecure registry issues). (Harbor)

โœ… Back up Harborโ€™s PostgreSQL database and image storage regularly.

โœ… Explore Harborโ€™s Web UI first โ€” itโ€™s a great way to understand projects and images visually.

โœ… Integrate Harbor with your CI/CD pipelines (GitLab, GitHub Actions, etc.) for automated pushing.

9. Where to Learn More

โœ” Official docs (install, admin, API, replication): https://goharbor.io/docs/ (Harbor)

โœ” GitHub repo with installers and examples: https://github.com/goharbor/harbors