In this tutorial, we will show you how to install Harbor on Ubuntu 22.04 LTS. In the realm of containerization and application deployment, Docker has redefined the way we package, distribute, and manage software. Docker images are at the heart of this revolution, and the need for a robust registry to store, manage, and secure these images has never been more critical. This is where the Harbor Docker Image Registry steps in. It is an open-source container image registry that offers features like security, vulnerability scanning, and identity management.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Harbor Docker image registry on Ubuntu 22.04. You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Harbor.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install Harbor on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. Before you start, it’s a good practice to update your system to the latest packages and security patches. Open the terminal and run the following commands:
sudo apt update sudo apt upgrade
Step 2. Installing Required Packages.
Harbor installation requires some additional packages like
jq. You can install them using the following command:
sudo apt install curl wget jq
These packages are essential for fetching resources and processing JSON data.
Step 3. Installing Harbor Docker Image Registry Dependencies.
Now, let’s install some prerequisites for Harbor. First, install
sudo apt install docker-compose
After Docker is installed, run the following
systemctl command to verify the current status of the Docker service:
sudo systemctl enabled docker sudo systemctl status docker
You can verify the version of the installation with:
With the dependencies in place, let’s obtain the Harbor release package. You can choose the version you want from the Harbor GitHub releases page. Use
curl to download it:
curl -LO https://github.com/goharbor/harbor/releases/download/v2.9.1/harbor-online-installer-v2.9.1.tgz
Next, navigate to the directory where you downloaded the Harbor release package and extract it. After extracting, you will find a
harbor.yml configuration file. Customize this file to suit your environment. You can use a text editor like
nano to make changes:
Inside this configuration file, you can specify various settings like your domain, storage settings, and authentication methods.
Now it’s time to install Harbor with your customized configuration. Use the following command:
This script will execute the installation, taking your configuration into account. The installation process might take a moment.
Once the installation is complete, you can start and enable Harbor services. Docker Compose is used to manage these services. Run the following commands:
sudo docker-compose up -d
This command starts Harbor services in detached mode, allowing them to run in the background.
Step 4. Access Harbor Web Interface,
Harbor’s web interface provides a user-friendly way to manage container images. To access it, open your web browser and enter the following URL:
your_domain_or_IP with your server’s domain or IP address. You’ll be greeted with the Harbor login page.
Congratulations! You have successfully installed Harbor. Thanks for using this tutorial for installing the Harbor Docker image registry on the Ubuntu system. For additional help or useful information, we recommend you check the official Harbor website.