Cloud Native 4 min read

Step‑by‑Step Guide to Installing and Using Harbor Private Docker Registry with Docker Compose

This article explains what Harbor is, why a private Docker registry is needed, and provides a detailed, command‑line tutorial—including installing Docker Compose, downloading and extracting Harbor, configuring it, and pushing images—complete with code snippets and screenshots.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Step‑by‑Step Guide to Installing and Using Harbor Private Docker Registry with Docker Compose

Harbor is an open‑source enterprise‑grade Docker registry project created by VMware China, designed to provide a secure and efficient private image repository for container applications.

Because reliable image management is essential for development and operation, deploying a private registry in a controlled environment improves security and performance.

1. Install Docker Compose

Docker Compose is a CLI tool that defines and runs multi‑container applications using a declarative YAML file.

yum -y install docker-compose

2. Download Harbor

Obtain the offline installer package and extract it to /usr/local/ :

tar -zxvf harbor-offline-installer-v1.9.1.tgz -C /usr/local/

After extraction, navigate to the harbor directory and inspect the files:

cd harbor/

ll

Typical files include harbor.yml , install.sh , and other configuration scripts.

3. Configure Harbor

Edit harbor.yml to set the hostname, port, and authentication details as needed.

vim harbor.yml

4. Prepare the environment

Run the preparation script to generate certificates and initialize directories:

./prepare

5. Install Harbor

Execute the installation script to launch all required containers:

./install.sh

After installation, the web UI and API are accessible at the configured address.

6. Use the registry

Tag a local image for the Harbor repository:

docker tag nginx 192.168.240.57:81/test/nginx

Log in to the Harbor registry:

docker login 192.168.240.57:81

Push the image:

docker push 192.168.240.57:81/test/nginx

The push completes successfully, confirming that the image is stored in Harbor.

Throughout the tutorial, screenshots illustrate each step, showing command output and UI screens.

DockerdevopsDocker-ComposeHarborprivate-registryContainer Registry
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.