Tutorials  /  Container & Cloud

Install Harbor Docker Registry on CentOS 7 with HTTPS

Ccentron Redaktion · July 2025 ·4 min read ·Container & Cloud, Tutorial

Harbor is a robust, open-source container registry designed for enterprise use. It stores and distributes Docker images and extends the functionality of the standard Docker Distribution by integrating enterprise-level features such as identity management, security, and access control. As a private registry, Harbor enhances both performance and protection by locating the registry closer to your build and execution environments. It also supports the use of multiple registries with image replication and offers features such as user access controls and activity auditing.

System Requirements

  • A CentOS 7 server instance with at least 1 GB of RAM.
  • A non-root user account with sudo privileges.
K8

Matching infrastructure at centron

From container to cluster: managed Kubernetes with cStack starts at €29.99 per month – control plane, autoscaler and traffic included. Explore managed Kubernetes →

Initial Setup

To begin, install the EPEL repository and necessary packages:

Console
sudo yum install epel-release wget -y

Afterwards, update your system packages:

Console
sudo yum update -y

Then, reboot the system to apply all updates:

Console
sudo shutdown -r now

In this guide, the domain harbor.example.com is used. Replace it with your own domain as necessary.

Install Docker and Docker Compose

Since Harbor runs as multiple Docker containers, Docker and Docker Compose must be installed on the target machine.

Install Docker CE

Console
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce

Install Docker Compose

Console
sudo yum install -y python-pip
pip install docker-compose

Now, start the Docker service:

Console
sudo systemctl start docker

Verify Docker installation:

Console
sudo docker run hello-world

Install Harbor

Download Harbor's installation files from the release page. You may opt for either the online or offline installer.

Online Installer

Console
wget https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-online-installer-v1.2.0.tgz

Offline Installer

Console
wget https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-offline-installer-v1.2.0.tgz

Extract the downloaded package:

Code
tar -xvf harbor-online-installer-1.2.0.tgz

Create an SSL Certificate

By default, Harbor installs over HTTP. To avoid adding the --insecure-registry flag to Docker clients and improve security, use HTTPS. Generate an SSL certificate (replace harbor.example.com with your domain):

Console
mkdir cert && cd cert
openssl req -sha256 -x509 -days 365 -nodes -newkey rsa:4096 -keyout harbor.example.com.key -out harbor.example.com.crt

Configure Harbor

Open the Harbor configuration file with a text editor:

Edit: vim harbor.cfg

Update the following fields:

  • hostname = harbor.example.com
  • ui_url_protocol = https
  • ssl_cert = /root/cert/harbor.example.com.crt
  • ssl_cert_key = /root/cert/harbor.example.com.key

Start the Harbor installation script:

Code
./install.sh

Run Harbor as a background process:

Console
docker-compose up -d

Accessing the Harbor Web UI

First, ensure that port 80 is open through the system firewall:

Console
sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
sudo firewall-cmd --reload

With DNS configured correctly, access Harbor via http://harbor.example.com. Log in with the default credentials:

  • Username: admin
  • Password: Harbor12345

Conclusion

By following this guide, you've successfully deployed Harbor on a CentOS 7 server. With its robust features such as container image replication, secure authentication, and integrated role-based access control, Harbor provides a scalable and secure private registry solution for your containerized infrastructure. Be sure to configure your domain and SSL properly to fully leverage Harbor’s capabilities in production.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Container & Cloud
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren