How to Install Harbor on CentOS 7

Last Updated: Mon, Jan 29, 2018
CentOS Containers Linux Guides Server Apps

Harbor is an open-source enterprise-class registry server that stores and distributes Docker images. Harbor extends the open source Docker Distribution by adding the functionalities usually required by an enterprise, such as security, identity and management. As an enterprise private registry, Harbor offers better performance and security. Having a registry closer to the build and run environment improves the image transfer efficiency. Harbor supports the setup of multiple registries and has images replicated between them. In addition, Harbor offers advanced security features, such as user management, access control and activity auditing.



Getting Started

Before starting, you will need to install the EPEL repo and other required packages to your system.

sudo yum install epel-release wget -y

Once the installation is completed, update your system to the latest version.

sudo yum update -y

Next, restart your system to apply all the updates.

sudo shutdown -r now

In this tutorial, we will use as the domain name pointed to the server. Replace all occurrences of with your actual domain name.

Install Docker and Docker-Compose

Harbor is deployed as several Docker containers. Therefore, it can be deployed on any Linux distribution that supports Docker. The target host requires that Docker and Docker Compose be installed.

Install Docker CE using the repository.

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo
sudo yum install -y docker-ce

Install Docker-Compose using pip.

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

Start Docker.

sudo systemctl start docker


sudo docker run hello-world

Install Harbor

The binary of the installer can be downloaded from the release page. Choose either the online or offline installer.

Online installer:


Offline installer:


Use the tar command to extract the package.

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

Generate your own SSL certificate

The default installation of Harbor uses HTTP - as such, you will need to add the option --insecure-registry to your client's Docker daemon, then restart the Docker service. Installing Harbor with HTTPS is highly recommended. It will save us a lot of time in the future. Generate your own SSL certificate (replace with your host’s FQDN).

mkdir cert && cd cert
openssl req -sha256 -x509 -days 365 -nodes -newkey rsa:4096 -keyout -out

Configure Harbor

Edit the Harbor config file.

vim harbor.cfg

Change hostname to your host's FQDN and enable https.

hostname =
ui_url_protocol = https
ssl_cert = /root/cert/
ssl_cert_key = /root/cert/

Run to finish the installation.


Run Harbor in the background.

docker-compose up -d

Access Harbor Web Interface

Before starting, you will need to allow port 80 through the firewall.

sudo firewall-cmd --reload

You can access the Harbor server on if you have DNS configured. Login using the default username and password.



The installation and basic configuration of Harbor is now complete.

Want to contribute?

You could earn up to $300 by adding new articles