Harbor is an open-source cloud-native registry that provides a secure and scalable platform for storing, signing, and distributing container images. Developed by VMware, Harbor offers enterprises and developers a comprehensive solution for managing container artifacts, ensuring compliance, and promoting collaboration across the software development lifecycle.

In this guide, we will show you how to install the Harbor registry on Ubuntu 24.04.

Step 1 – Install Docker CE

By default, the latest Docker version is unavailable in the Ubuntu default repo, so you will need to install it from their official repo.

First, install all the necessary dependencies:

apt update -y
apt install ca-certificates curl gnupg lsb-release -y

Next, create a directory to store the Docker GPG key.

mkdir -p /etc/apt/keyrings

Next, download the GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Next, add the Docker repository to the APT source file.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu   $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

Next, update the repository cache:

apt update -y

Finally, install Docker CE and other required tools using the following command:

apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y

You can verify the status of the Docker service using the following command:

systemctl status docker

Output:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: active (running) since Mon 2025-05-19 04:47:49 UTC; 3s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 20631 (dockerd)
      Tasks: 9
     Memory: 20.9M (peak: 21.0M)
        CPU: 339ms
     CGroup: /system.slice/docker.service
             └─20631 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Step 2 – Install Harbor

First, download the latest version of Harbor from the Git repository.

curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i -

Once the download is completed, extract the downloaded file using the tar command:

tar -xzvf harbor-online-installer-v2.12.3.tgz

Next, move the extracted directory to the /opt directory.

mv harbor /opt/

Next, navigate to the Harbor directory and copy the Harbor configuration file.

cd /opt/harbor
cp harbor.yml.tmpl harbor.yml

Next, edit the Harbor configuration file.

nano harbor.yml

Change the following lines:

hostname: reg.example.com

harbor_admin_password: Harbor12345

Remove the following lines:

https:
  # https port for harbor, default is 443
  port: 443
  # The path of cert and key files for nginx
  certificate: /your/certificate/path
  private_key: /your/private/key/path

Save and close the file when you are done.

Next, run the following command to install the Harbor:

./install.sh

You will see the following output:

[Step 4]: starting Harbor ...
[+] Running 9/10
 ⠧ Network harbor_harbor        Created                                                                                                                            1.8s 
 ✔ Container harbor-log         Started                                                                                                                            0.4s 
 ✔ Container harbor-db          Started                                                                                                                            0.9s 
 ✔ Container harbor-portal      Started                                                                                                                            0.8s 
 ✔ Container redis              Started                                                                                                                            1.0s 
 ✔ Container registry           Started                                                                                                                            0.7s 
 ✔ Container registryctl        Started                                                                                                                            1.0s 
 ✔ Container harbor-core        Started                                                                                                                            1.2s 
 ✔ Container nginx              Started                                                                                                                            1.6s 
 ✔ Container harbor-jobservice  Started                                                                                                                            1.6s 
✔ ----Harbor has been installed and started successfully.----

You can verify all running containers using the following command:

docker compose ps

Output:

NAME                IMAGE                                 COMMAND                  SERVICE       CREATED         STATUS                            PORTS
harbor-core         goharbor/harbor-core:v2.12.3          "/harbor/entrypoint.…"   core          4 seconds ago   Up 2 seconds (health: starting)   
harbor-db           goharbor/harbor-db:v2.12.3            "/docker-entrypoint.…"   postgresql    4 seconds ago   Up 3 seconds (health: starting)   
harbor-jobservice   goharbor/harbor-jobservice:v2.12.3    "/harbor/entrypoint.…"   jobservice    4 seconds ago   Up 1 second (health: starting)    
harbor-log          goharbor/harbor-log:v2.12.3           "/bin/sh -c /usr/loc…"   log           4 seconds ago   Up 3 seconds (health: starting)   127.0.0.1:1514->10514/tcp
harbor-portal       goharbor/harbor-portal:v2.12.3        "nginx -g 'daemon of…"   portal        4 seconds ago   Up 3 seconds (health: starting)   
nginx               goharbor/nginx-photon:v2.12.3         "nginx -g 'daemon of…"   proxy         4 seconds ago   Up 2 seconds (health: starting)   0.0.0.0:80->8080/tcp, [::]:80->8080/tcp
redis               goharbor/redis-photon:v2.12.3         "redis-server /etc/r…"   redis         4 seconds ago   Up 3 seconds (health: starting)   
registry            goharbor/registry-photon:v2.12.3      "/home/harbor/entryp…"   registry      4 seconds ago   Up 3 seconds (health: starting)   
registryctl         goharbor/harbor-registryctl:v2.12.3   "/home/harbor/start.…"   registryctl   4 seconds ago   Up 3 seconds (health: starting)    

Step 3 – Access Harbor Web UI

At this point, the Harbor registry is installed in the Docker container. You can now access it using the URL http://reg.example.com. You will see the Harbor login page:

Provide the default username admin and the password that you have configured via the configuration file harbor.yml, then click on the LOG IN button. You will see the Harbor dashboard on the following page.

Conclusion

By deploying Harbor, you gain control over your container image lifecycle, ensuring compliance with security policies, regulatory requirements, and best practices for containerized application development and deployment. Harbor’s intuitive user interface, RESTful API, and integration capabilities enable seamless integration with your existing infrastructure, CI/CD pipelines, and identity providers, fostering collaboration and accelerating software delivery cycles. You can now try to host your own image hosting registry using Harbor on dedicated server hosting from Atlantic.Net!