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.
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-worldInstall 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 --versionGenerate 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 --standaloneThe 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.tgzConfigure 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.keyInstall 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-ubuntuPull 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-ubuntuThe 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
