DockerSelf-Hosting

Harbor with Docker: Your Own Private Container Registry with Trivy Scanning and a Docker Hub Cache (Linux Server, Windows and Mac Clients)

Before you start

  • 20 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

Harbor is a free, open-source container registry you run yourself: a private place to store Docker images, with logins, projects, vulnerability scanning with Trivy and a cache for Docker Hub.

Harbor official logo

Logo: the official Harbor project (github.com/goharbor/harbor, file docs/img/harbor_logo.png at tag v2.16.0)

With Harbor your own images stay on your own machine, only people and robots you allow can pull them, and Harbor can refuse images with serious known vulnerabilities. It can also cache images from Docker Hub, which saves bandwidth and pull limits. The Harbor server runs on Linux only. Windows and Mac computers are clients: they use docker login, docker push and docker pull through Docker Desktop, and Steps 5 and 6 give those steps.

WhatValue (official sources, read December 2026)
Current versionHarbor v2.16.0, released 10 November 2026
Image tagsgoharbor/*:v2.16.0 (we checked Docker Hub: amd64 and arm64)
Time neededAbout 45 minutes (our estimate, not measured)
SizeMinimum 2 CPU, 4 GB RAM, 40 GB disk; recommended 4 CPU, 8 GB, 160 GB
PortsTCP 443 (HTTPS) and 80 (redirect) on the Linux host
LicenceApache-2.0; CNCF graduated project
Official docsgoharbor.io/docs/2.16.0

Official Harbor documentation screenshot: the New Project dialog with a proxy cache switch, an endpoint for Docker Hub and a bandwidth limit

Image: the official Harbor docs (Configure a Proxy Cache, file docs/img/add-proxy-cache-project.png on goharbor.io, docs licence CC-BY-4.0). It may show an older look than v2.16.0.

At a glance:

  • What it is: a set of about ten containers started by one installer script.
  • Good for: private images, CI robots, scan-before-pull rules, a Docker Hub cache.
  • Not for: a tiny single user who only needs the plain Docker registry image; Harbor is heavier.
  • Sign-in: built-in accounts, or OIDC (our Authentik guide covers the provider side).

Which version. We pin v2.16.0. The official docs mark 2.16.0 as latest, while GitHub's "Latest" badge sits on v2.15.5 (12 November 2026), a maintenance release of the older line. We read the issues opened since 10 November and found none that stops a normal fresh install. Open ones to know: 24445 (arm64 hosts with 64k memory pages), 24414 (scanner pull blocked by its own rule) and 24465 (an upgrade that skips releases starts an empty database).

How it fits together#

Clients talk HTTPS to Harbor's nginx; the core checks login and rules, the registry stores image layers on disk, the database keeps accounts and projects, and Trivy scans images with a database it downloads.

Harbor flow: Docker clients and browsers reach nginx on port 443, directly or through Traefik or Caddy; nginx passes the web UI and API to the core and image traffic to the registry; the core uses PostgreSQL, Valkey and Trivy, and fetches Docker Hub images and the Trivy database from the internet

Drawn for this guide from the official docs, the installer files and the Compose template at v2.16.0. The proxy route (dashed) is optional.

Four words: a project is a folder of repositories with its own members. A robot account is a login for a program, not a person. A proxy cache project pulls from another registry on demand and keeps a copy. Garbage collection removes layers no image uses any more.

Before you start#

You need one always-on Linux machine for the server, and any computer for the client.

SystemWhat to have
Linux serverx86-64 or arm64, Docker Engine above 20.10, Docker Compose plugin above 2.3, OpenSSL, internet access
Windows clientWindows 10 or later, Docker Desktop, PowerShell, ssh and scp (built in)
Mac clientDocker Desktop, Terminal

Why not Windows or Mac for the server? The README at v2.16.0 lists system requirements "on a Linux host". Maintainers answered "Harbor doesn't support in Windows platform" (issue 20825), where the database stopped with initdb: error: could not change permissions of "/var/lib/postgresql/data/pg14/postgresql.conf": Operation not permitted. Use a spare PC, a mini PC or a Linux virtual machine.

Run in terminalbash
docker --version
docker compose version
openssl version

Checklist:

  • [ ] All three commands print a version on the Linux host
  • [ ] Ports 80 and 443 are free on that host
  • [ ] You have a name for Harbor, such as harbor.home.arpa, that every client can resolve (DNS or the hosts file)
  • [ ] A password manager is open: you will create two passwords
  • [ ] For the HTTPS section only: a public domain, DNS record and Traefik or Caddy

Tested by DIY Lab Hub: not yet. Commands come from the official docs and the installer files at v2.16.0, read in December 2026. We did not run them. We did download the installer and checked its checksum.

Tip: Harbor needs a real host name. It refuses localhost and 127.0.0.1, because clients must reach it from outside.

Step 1: Download and verify the installer#

Everything lives under ~/docker_volumes/harbor. The online installer is a 12 KB archive; it pulls the images from Docker Hub later. Use the offline installer (about 770 MB) for a host without internet.

Linux#

Run in terminalbash
mkdir -p ~/docker_volumes/harbor/{installer,data,logs,backups,certs}
cd ~/docker_volumes/harbor
curl -LO https://github.com/goharbor/harbor/releases/download/v2.16.0/harbor-online-installer-v2.16.0-amd64.tgz
md5sum harbor-online-installer-v2.16.0-amd64.tgz
tar xzvf harbor-online-installer-v2.16.0-amd64.tgz -C installer

On an arm64 host use harbor-online-installer-v2.16.0-arm64.tgz. The release file md5sum lists 33766514362bff95fa4ca562ad1c96ab for the amd64 file; ours matched. The docs still mention .asc signature files, but v2.16.0 ships .sigstore.json bundles instead.

Windows (PowerShell)#

The server runs on Linux, so run the Linux commands above on that host. Log in from PowerShell first:

Run in terminalpowershell
ssh <user>@<linux-host>

Mac (Terminal)#

Same commands as Windows, in Terminal:

Run in terminalbash
ssh <user>@<linux-host>

Check it worked. The checksum matches and ls installer/harbor shows common.sh, harbor.yml.tmpl, install.sh, LICENSE and prepare. Keep this folder: upgrades need it.

Step 2: Create a certificate for Harbor#

Home setup, no public domain: we make our own certificate authority (CA) and sign Harbor's certificate with it, as the official docs describe. With a public domain skip to the Traefik section.

Linux#

Run in terminalbash
cd ~/docker_volumes/harbor/certs
openssl genrsa -out ca.key 4096
openssl req -x509 -new -nodes -sha512 -days 3650 -subj "/O=Home/CN=Harbor Home CA" -key ca.key -out ca.crt
openssl genrsa -out harbor.home.arpa.key 4096
openssl req -sha512 -new -subj "/O=Home/CN=harbor.home.arpa" -key harbor.home.arpa.key -out harbor.home.arpa.csr
cat > v3.ext << 'EOF'
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[alt_names]
DNS.1=harbor.home.arpa
EOF
openssl x509 -req -sha512 -days 3650 -extfile v3.ext -CA ca.crt -CAkey ca.key -CAcreateserial -in harbor.home.arpa.csr -out harbor.home.arpa.crt
chmod 600 ca.key harbor.home.arpa.key

Windows (PowerShell)#

Make the certificate on the Linux host (over ssh), then copy only the public file ca.crt to this PC for Step 5:

Run in terminalpowershell
scp <user>@<linux-host>:~/docker_volumes/harbor/certs/ca.crt $HOME\Downloads\ca.crt

Mac (Terminal)#

Same idea:

Run in terminalbash
scp <user>@<linux-host>:~/docker_volumes/harbor/certs/ca.crt ~/Downloads/ca.crt

Check it worked. The folder holds ca.crt, ca.key, harbor.home.arpa.crt and harbor.home.arpa.key. ca.key never leaves the server.

Tip: If clients will use an IP address instead of a name, add IP.1=<address> under [alt_names]. A name is better: it keeps working when the address changes.

Step 3: Edit harbor.yml#

Linux#

Run in terminalbash
cd ~/docker_volumes/harbor/installer/harbor
cp harbor.yml.tmpl harbor.yml
chmod 600 harbor.yml
openssl rand -hex 16
openssl rand -hex 16

Write the two random strings into your password manager, then edit harbor.yml (replace <user>). Hex strings avoid YAML trouble. Change only these keys and leave the rest of the template alone, including _version: 2.16.0:

File contentyaml
hostname: harbor.home.arpa

https:
  port: 443
  certificate: /home/<user>/docker_volumes/harbor/certs/harbor.home.arpa.crt
  private_key: /home/<user>/docker_volumes/harbor/certs/harbor.home.arpa.key

harbor_admin_password: <admin-password>

database:
  password: <database-password>

data_volume: /home/<user>/docker_volumes/harbor/data

log:
  local:
    location: /home/<user>/docker_volumes/harbor/logs

The template ships with harbor_admin_password: Harbor12345 and database.password: root123. Its own comment says to change the database password "before any production use". The admin password is read only the first time Harbor starts; later changes are made in the web page. The documented default for data_volume is /data. We use a folder in your home because our layout asks for it; if your home is encrypted, on a network mount or under SELinux rules, use /data instead.

Windows (PowerShell)#

Edit the file on the Linux host (ssh, then nano harbor.yml). Never keep a copy with real passwords on your PC.

Mac (Terminal)#

Same as Windows: ssh <user>@<linux-host>, then nano harbor.yml.

Check it worked. grep -E 'hostname|password' harbor.yml shows your new values and not reg.mydomain.com, Harbor12345 or root123.

Tip: Harbor stops with Please specify hostname when hostname is still the template's reg.mydomain.com, and with 127.0.0.1 can not be the hostname (checks in prepare, source at v2.16.0).

Step 4: Run the installer with Trivy#

Linux#

Run in terminalbash
cd ~/docker_volumes/harbor/installer/harbor
sudo ./install.sh --with-trivy
sudo docker compose ps

The script runs the goharbor/prepare:v2.16.0 container, which writes the configuration and a docker-compose.yml, then starts everything. Trivy downloads its vulnerability database from ghcr.io, so the host needs internet. Harbor's own Compose file uses restart: always. Do not edit it: ./prepare rewrites it.

Windows (PowerShell)#

Run it over ssh, as in Step 1. Then add the name to the hosts file of this PC so a browser finds Harbor (Administrator PowerShell):

Codepowershell
Add-Content C:\Windows\System32\drivers\etc\hosts "<linux-host-ip> harbor.home.arpa"

Mac (Terminal)#

Run in terminalbash
echo "<linux-host-ip> harbor.home.arpa" | sudo tee -a /etc/hosts

Check it worked. The official docs show every container Up. We expect harbor-log, registry, registryctl, harbor-db, harbor-core, harbor-portal, harbor-jobservice, redis (a Valkey image), nginx and trivy-adapter. Open https://harbor.home.arpa and sign in as admin. The browser warns about the unknown CA until Step 5. A public project named library exists already.

Step 5: Make your Docker clients trust Harbor#

Without this, docker login fails with x509: certificate signed by unknown authority. Docker reads a folder named like the registry host and treats every *.crt file in it as a trusted CA. A .cert file means a client certificate. Harbor's HTTPS page tells you to copy a server certificate as .cert and .key; you do not need that, and a CA saved as .cert gives Missing key KEY_NAME for client certificate CERT_NAME. CA certificates should use the extension .crt. (Docker docs).

Linux#

Run this on each Linux client (the server too, if it pushes images):

Run in terminalbash
sudo mkdir -p /etc/docker/certs.d/harbor.home.arpa
sudo cp ca.crt /etc/docker/certs.d/harbor.home.arpa/ca.crt
docker login harbor.home.arpa

Rootless Docker reads ~/.config/docker/certs.d instead. If Harbor uses another port, include it in the folder name (harbor.home.arpa:8443). The Harbor page also restarts Docker (sudo systemctl restart docker) afterwards; try without first.

Windows (PowerShell)#

Docker Desktop builds its trust list from the Windows certificate store. Import the CA in an Administrator PowerShell, then restart Docker Desktop:

Codepowershell
Import-Certificate -FilePath "$HOME\Downloads\ca.crt" -CertStoreLocation Cert:\LocalMachine\Root

Alternative from the Docker docs: put ca.crt in $HOME\.docker\certs.d\harbor.home.arpa\; Docker Desktop copies that folder into its virtual machine at start.

Mac (Terminal)#

Add the CA to the keychain that Docker Desktop reads, then restart Docker Desktop (Docker docs):

Run in terminalbash
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/Downloads/ca.crt

Check it worked. docker login harbor.home.arpa asks for a user name and password (use admin for now) and prints Login Succeeded.

Tip: Never put your Harbor in Docker's insecure-registries list as a shortcut. Docker Desktop ignores certificates for registries on that list, and everything then travels unprotected.

Step 6: Create a project, a robot account and push an image#

Use the browser for these clicks. Projects, New Project: name myproj, leave Public off. Open the project, Robot Accounts, New Robot Account: name ci, give it Pull and Push (Push needs Pull). Copy or export the secret now: Harbor does not store it, though you can refresh it later. Robot accounts cannot sign in to the web page. The user name has the form robot$myproj+ci, with the default prefix robot$.

The dollar sign is the trap. A shell reads $myproj as a variable and the login fails with unauthorized: authentication required; Harbor's log then says Failed to get user from DB, username: robot-ci, error: user robot-ci not found (issue 9429, issue 8054). Use single quotes.

Linux#

Run in terminalbash
echo '<robot-secret>' | docker login harbor.home.arpa -u 'robot$myproj+ci' --password-stdin
docker pull alpine:3.22
docker tag alpine:3.22 harbor.home.arpa/myproj/alpine:3.22
docker push harbor.home.arpa/myproj/alpine:3.22
docker pull harbor.home.arpa/myproj/alpine:3.22

Windows (PowerShell)#

Save the secret in a file first (secret.txt), and delete it when done:

Codepowershell
Get-Content .\secret.txt | docker login harbor.home.arpa -u 'robot$myproj+ci' --password-stdin
docker pull alpine:3.22
docker tag alpine:3.22 harbor.home.arpa/myproj/alpine:3.22
docker push harbor.home.arpa/myproj/alpine:3.22
docker pull harbor.home.arpa/myproj/alpine:3.22

Mac (Terminal)#

Same commands as Linux.

Check it worked. Login Succeeded, then the push prints layer lines, and myproj lists the repository alpine with tag 3.22 in the browser.

Tip: The project must exist before the first push. Pushing to harbor.home.arpa/newname/app without creating newname fails.

Put it behind HTTPS with Traefik#

Skip this at home. For https://harbor.<your-domain> you need a domain, a DNS record and ports 80 and 443 on a machine that already runs Traefik or Caddy. We follow Harbor's own advice for a reverse proxy: remove the https block and set external_url, so Harbor builds its login and redirect addresses with the public name. We have not run this.

In harbor.yml comment out the whole https: block (port, certificate and private key), keep a real hostname, and add:

File contentyaml
external_url: https://harbor.<your-domain>

Then run sudo ./prepare --with-trivy. Harbor's nginx now listens on port 8080 inside Docker. Create the shared network once with docker network create proxy, and save this next to Harbor's docker-compose.yml as docker-compose.override.yml (Compose reads it by itself and prepare does not touch it; !reset removes the published ports):

File contentyaml
services:
  proxy:
    ports: !reset []
    networks:
      - harbor
      - proxy
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.http.routers.harbor.rule=Host(`harbor.<your-domain>`)"
      - "traefik.http.routers.harbor.entrypoints=https"
      - "traefik.http.routers.harbor.tls=true"
      - "traefik.http.routers.harbor.tls.certresolver=le"
      - "traefik.http.services.harbor.loadbalancer.server.port=8080"

networks:
  proxy:
    external: true

The service is called proxy in Harbor's file; its container is named nginx. Our Traefik guide uses the entrypoint https and the resolver le.

With Traefik#

Add one flag to Traefik itself. Traefik v3 limits reading a whole request, body included, to 60 seconds by default (entrypoints reference). A big layer upload takes longer. In Traefik's command: list add:

File contentyaml
      - "--entrypoints.https.transport.respondingTimeouts.readTimeout=0"

Then sudo docker compose up -d in Harbor's folder. Harbor's nginx keeps the X-Forwarded-Proto that Traefik sends and sets no upload size limit (we read its template at v2.16.0). Check it worked. curl -I https://harbor.<your-domain>/ returns an HTTP status over HTTPS with a valid certificate.

Without Traefik: Caddy#

Use the same harbor.yml change and override file without the labels: block. Run Caddy in its own folder, on the same proxy network:

File contentyaml
services:
  caddy:
    image: caddy:2.11.9
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80/tcp"
      - "443:443/tcp"
      - "443:443/udp"
    volumes:
      - ./conf:/etc/caddy:ro
      - ./data:/data
      - ./config:/config
    networks:
      - proxy

networks:
  proxy:
    external: true

Save conf/Caddyfile:

File contenttext
harbor.example.com {
    reverse_proxy nginx:8080
}

Caddy reaches Harbor by container name, so write nginx:8080, never 127.0.0.1. Home-only names can use tls internal; each device must then trust Caddy's root certificate, see our Caddy guide. Check it worked. curl -I https://harbor.example.com/ shows an HTTP status line over HTTPS, and docker login harbor.example.com needs no Step 5.

Scan images with Trivy and block risky pulls#

Trivy was installed by --with-trivy; see our Trivy guide for the tool itself. In the browser open your project, then Configuration. Tick Automatically scan images on push. Tick Prevent vulnerable images from running and pick a severity: images at that level or higher can no longer be pulled.

Official Harbor documentation screenshot: project Configuration tab with the Prevent vulnerable images from running box ticked and a severity list

Image: the official Harbor docs (Project Configuration, file docs/img/prevent-vulnerable-images.png on goharbor.io). It may show an older look than v2.16.0.

Push an old image to test. A blocked pull answers with HTTP 412 and a text from the source at v2.16.0: current image with N vulnerabilities cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of "..." or higher from running.' An image that was never scanned is blocked too: The image has not been scanned for vulnerabilities and cannot be pulled due to configured policy .... That is why scan-on-push matters.

Three honest limits. This stops pulls from Harbor; it does not stop a container that already runs. Trivy does not scan every artifact type: some index manifests show as not scanned, which the maintainers call by design (issue 24254). A project can carry a CVE allowlist for findings you accept.

Cache Docker Hub with a proxy cache project#

Docker Hub limits pulls: 100 per 6 hours for anonymous users per IPv4 address (200 for a free signed-in account), as the Docker docs say. A proxy cache keeps copies on your Harbor, so your machines pull from it.

As admin: Registries, New Endpoint, provider Docker Hub, URL https://hub.docker.com; add a Docker Hub account to be recognised as signed in. Then Projects, New Project, name dockerhub, switch Proxy Cache on and choose the endpoint (see the screenshot above). Pull with the project name as prefix, and library/ for official images:

Run in terminalbash
docker pull harbor.home.arpa/dockerhub/library/alpine:3.22

The commands are identical in PowerShell and Terminal. Know four things. You cannot push to a proxy cache project. Everyone with access to it can pull whatever the endpoint account can see, so use a low-privilege account. New proxy projects get a 7-day retention policy by default. Harbor asks Docker Hub with a HEAD request whether an image changed, which does not count as a pull; only changed images do. A pull your Docker client answers from its own local cache may not create the repository entry in a second proxy project (issue 23410, expected behaviour per a maintainer).

Keep it tidy: users, retention and cleanup#

  • People. Add users under Administration, Users, then add them to projects with a role. Change the admin password in the web page now.
  • Single sign-on. Switching to OIDC is only possible while no local user besides admin exists, so decide first. Docker cannot follow browser redirects, so OIDC users log in to Docker with a CLI secret from their profile. OIDC servers on Harbor's verified list do not include Authentik, so treat that pairing as untested by us.
  • Retention. In each project, set a tag retention rule so old tags disappear.
  • Cleanup. Deleting images frees no disk space. Under Administration, Clean Up, run Garbage Collection (try Dry Run first) or schedule it. Layers uploaded in the last 2 hours are spared.

Security and testing#

ControlHow
PasswordsAdmin and database passwords replaced before first start; secrets in a password manager
HTTPSBefore any client outside the host; never insecure-registries
PortsOnly 80 and 443 reach Harbor; behind a proxy the host publishes none
People and robotsPrivate projects; one robot per job with the least permissions and an expiry; never use admin in CI
Filesharbor.yml and ca.key mode 600; data/secret holds Harbor's keys
ScanningScan on push plus a prevent-vulnerable rule
Admin accountCreated locally; keep it even when you add OIDC

Quick tests on the Linux host (we did not run them):

Run in terminalbash
cd ~/docker_volumes/harbor/installer/harbor
sudo docker compose ps
curl -I https://harbor.home.arpa/api/v2.0/ping --cacert ~/docker_volumes/harbor/certs/ca.crt
sudo ls /home/<user>/docker_volumes/harbor/logs

Common mistakes#

MistakeWhy it happensDo this instead
unauthorized: authentication required for a robotThe shell expanded $myproj in robot$myproj+ci (issue 9429)Single quotes around the user name
x509: certificate signed by unknown authorityThe client does not trust your CAca.crt in certs.d (Linux), certificate store or keychain (Docker Desktop)
Default passwords keptThe template ships Harbor12345 and root123Replace both in Step 3
Editing harbor_admin_password later and nothing changesIt only applies the first time Harbor startsChange it in the web page
502 Bad Gateway after recreating containersnginx keeps the old container addresses (issue 24155)sudo docker compose restart proxy
Big push dies behind TraefikDefault 60 s request read limitSet readTimeout=0 on the entrypoint
502 on a multi-GB layerThe registry ran out of memory (issue 11687)More RAM, or "max-concurrent-uploads": 1 in Docker's daemon.json
Disk still full after deleting imagesSpace returns only after garbage collectionDry run, then run garbage collection
Upgrading across several releasesSkipped steps can leave an empty database (issue 24465)One minor release at a time, backup first
Pushing to a proxy cache projectThose projects are read-only for pushesPush to a normal project
AI assistants: --with-chartmuseum, --with-notary, --with-clair, harbor.cfgOld Harbor 1.x tutorialsOnly --with-trivy; settings live in harbor.yml
AI assistants: hostname: localhost, port 5000, "Harbor on Docker Desktop"Mixed up with the plain Docker registryA real host name on 443, Harbor server on Linux

Tip: Run docker login once from a second computer before you trust the setup. A login that works on the server itself proves nothing about certificates.

Troubleshooting#

ProblemSolution
A container is not Upsudo docker compose ps, then sudo docker logs harbor-core --tail 100; logs also sit in your logs folder
harbor-db or redis restartsRead its log; check free disk with df -h and df -i
Web page works, docker push failsCheck the project exists, the robot has Push and Pull, and the host name matches exactly
Scans never finishThe host cannot reach ghcr.io; check DNS and proxy settings
Changed harbor.yml has no effectsudo docker compose down, sudo ./prepare --with-trivy, sudo docker compose up -d

Exact error texts#

  • Please specify hostname: hostname is still reg.mydomain.com.
  • 127.0.0.1 can not be the hostname: use a real name.
  • KeyError: 'job_loggers': an old harbor.yml lacks keys; start from the shipped harbor.yml.tmpl (docs).
  • <jemalloc>: Unsupported system page size in the redis log: arm64 with 64k pages, issue 24445.
  • 412 PROJECTPOLICYVIOLATION on pull: the scan rule blocked it; scan the image or lower the severity.

Known bugs (open, December 2026)#

24445 (valkey crash on arm64 64k pages), 24414 (scanner pull blocked by its own policy, robot Basic auth), 24465 (silent empty database on a skipped upgrade), 24481 (proxy cache deletes untagged artifacts).

Updates and backups#

Update. Read the release notes and the upgrade page first. It covers upgrades from v2.14.0 and later and tells you to back up first. The maintainers support one minor step at a time (issue 24465), and 2.16 moved PostgreSQL to version 18. The documented path: stop Harbor, move the old installer folder away, copy data/database, unpack the new installer, migrate harbor.yml, run install.sh:

Run in terminalbash
docker run -it --rm -v /:/hostfs goharbor/prepare:<new-version> migrate -i <path>/harbor.yml

What to back up. The data folder (images, database and secret keys) and the installer folder (harbor.yml, common/config). Without data/secret, stored passwords cannot be decrypted. The official backup page covers Kubernetes only, so this is our cold backup. It stops Harbor for the duration.

Linux#

Save as ~/docker_volumes/harbor/backup.sh:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
base="$HOME/docker_volumes/harbor"
cd "$base/installer/harbor"
docker compose down
tar --numeric-owner -czf "$base/backups/harbor-$(date +%F).tar.gz" -C "$base" data installer certs
docker compose up -d

Run it as root so it can read the data: chmod 700 backup.sh, then sudo crontab -e and add 0 3 * * * HOME=/home/<user> /home/<user>/docker_volumes/harbor/backup.sh. The archive holds secrets and all images: keep it private and copy it off the machine.

Windows (PowerShell)#

The server is Linux. Pull the archive to your PC:

Run in terminalpowershell
scp <user>@<linux-host>:~/docker_volumes/harbor/backups/harbor-<date>.tar.gz $HOME\Backups\

For a daily copy, schedule that line in Task Scheduler (powershell.exe -NoProfile -File <path>) at 03:30.

Mac (Terminal)#

Same scp as Windows, with ~/Backups/ as the target; schedule it with crontab -e.

Restore test on a new machine#

Install Docker, unpack the archive in ~/docker_volumes/harbor with sudo tar --numeric-owner -xzf, then start Harbor from installer/harbor and log in:

Run in terminalbash
cd ~/docker_volumes/harbor/installer/harbor
sudo docker compose up -d
docker login harbor.home.arpa
docker pull harbor.home.arpa/myproj/alpine:3.22

The pull should work with your old robot secret. We did not run this.

Performance and resources#

The docs give 2 CPU and 4 GB as the minimum and 4 CPU and 8 GB as the recommended size, with 40 GB and 160 GB of disk; images decide the real disk need. We measured nothing. Watch with docker stats. harbor.yml has jobservice.max_job_workers (template default 10) and a cache block that is off by default; the docs recommend turning the cache on for many concurrent pulls. Put the data folder on an SSD.

FAQ#

Is Harbor free? Yes, under Apache-2.0. You pay only for the machine and its disk.

Can I run the Harbor server on Windows or Mac? No. Only Linux is supported. Windows and Mac computers use it as clients through Docker Desktop.

Harbor or the plain Docker registry? The plain registry image is tiny but has no web page, no projects, no scanning. Harbor adds those, at the cost of about ten containers.

Can Forgejo or Gitea replace it? Both have a package registry (see our Forgejo guide). It suits small setups; Harbor adds scanning rules, robots and a cache.

Does replication replace a backup? No. It copies images, not accounts, settings or keys.

Sources#

Checked against the official docs on 2026-12-01.