Cloud Native 12 min read

Step‑by‑Step Guide to Install and Configure Harbor Private Docker Registry on Ubuntu

This tutorial walks through preparing an Ubuntu host, installing Docker CE and Docker Compose, generating TLS certificates with acme.sh, downloading and configuring the Harbor registry, and finally pushing and pulling Docker images to verify a secure private Docker registry setup.

Architect's Tech Stack
Architect's Tech Stack
Architect's Tech Stack
Step‑by‑Step Guide to Install and Configure Harbor Private Docker Registry on Ubuntu

This article explains how to set up an enterprise‑grade private Docker registry using Harbor on an Ubuntu 17.04 x64 server.

Harbor, an open‑source project from VMware, extends the basic Docker Registry with a web UI, role‑based access control, LDAP/AD integration, and audit logging, providing better performance and security for container images.

Environment preparation : the host requires Ubuntu 17.04, Docker 17.12.0‑ce, Docker Compose, Python 3, a static IP (198.13.48.154) and a DNS‑resolved domain such as hub.ymq.io .

Install Docker CE using the official repository: sudo apt-get update sudo apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install docker-ce sudo docker run hello-world

Install Docker Compose by downloading the binary and making it executable: sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version

Generate TLS certificates with acme.sh (replace the domain with your own): curl https://get.acme.sh | sh cd ~/.acme.sh/ sudo apt-get install socat sh acme.sh --issue -d hub.ymq.io --standalone The generated fullchain.cer and hub.ymq.io.key are stored under /root/.acme.sh/hub.ymq.io/ .

Download and extract Harbor (latest version V1.3.0 at the time of writing): wget https://storage.googleapis.com/harbor-online-installer/harbor-online-installer-v1.3.0.tgz tar -zxvf harbor-online-installer-v1.3.0.tgz

Configure Harbor by editing harbor.cfg (set your hostname and TLS files): hostname = hub.ymq.io ui_url_protocol = https customize_crt = off ssl_cert = /opt/certs/fullchain.cer ssl_cert_key = /opt/certs/hub.ymq.io.key

Install Harbor with the provided script: sudo ./install.sh

Access the UI at https://hub.ymq.io using the default credentials admin/Harbor12345 , create a project (e.g., myproject ), and log in from the command line: docker login hub.ymq.io

Push an image (example with Ubuntu 16.04): docker pull ubuntu:16.04 docker tag ubuntu:16.04 hub.ymq.io/myproject/my-ubuntu docker push hub.ymq.io/myproject/my-ubuntu

Pull the image back to verify the registry works: docker image rm ubuntu:16.04 hub.ymq.io/myproject/my-ubuntu docker pull hub.ymq.io/myproject/my-ubuntu

The article also shows how to view images, delete them, and check operation logs in the Harbor UI, and points to the official installation guide at https://github.com/vmware/harbor/blob/master/docs/installation_guide.md .

DockerTLSDocker-ComposeHarborprivate-registryUbuntuRegistryacme.sh
Architect's Tech Stack
Written by

Architect's Tech Stack

Java backend, microservices, distributed systems, containerized programming, and more.

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.