Skip to main content

Harbor

The official website: https://goharbor.io/

Setup

Documentation: https://goharbor.io/docs/2.11.0/install-config/

First, download the latest version from the GitHub release page.

The offline installer is recommended, in case the server cannot access the download source.

Replace the <version> with the actual version you downloaded.

tar xzvf harbor-offline-installer-<version>.tgz

Unzipping results in a harbor folder with the following contents:

harbor/
├─ common.sh
├─ harbor.yml.tmpl
├─ prepare
├─ install.sh

Configuration

Rename harbor.yml.tmpl to harbor.yaml.

If you host the harbor behind nginx, you should only config the http. And set the external_url to your endpoint.

http:
port: 8080

external_url: https://your.example.com
server {
listen 80;
server_name your.example.com;

location / {
return 301 https://$host$request_uri;
}
}

server {
listen 443 ssl;
server_name your.example.com;

ssl_certificate /certs/your.example.com/public.crt;
ssl_certificate_key /certs/your.example.com/private.key;

client_max_body_size 0;
chunked_transfer_encoding on;

location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

proxy_buffering off;
proxy_request_buffering off;
}
}