Skip to content

Commit 3258ad6

Browse files
committed
Update docs to improve user experience
Signed-off-by: chethanm99 <chethanm1399@gmail.com>
1 parent dc8de69 commit 3258ad6

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

docs/install-config/configure-https.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ title: Configure HTTPS Access to Harbor
33
weight: 30
44
---
55

6+
**Important: Using Existing Third-Party Certificates**
7+
8+
If you already have a TLS certificate and key from a trusted authority (e.g., Let's Encrypt, DigiCert, GoDaddy), you can skip the self-signed certificate generation steps on this page. Simply place your certificate and key files on the Harbor host and provide their paths in the `harbor.yml` file, as described in ./configure-yml-file.md. This is the recommended approach for all production environments.
9+
610
By default, Harbor does not ship with certificates. It is possible to deploy Harbor without security, so that you can connect to it over HTTP. However, using HTTP is acceptable only in air-gapped test or development environments that do not have a connection to the external internet. Using HTTP in environments that are not air-gapped exposes you to man-in-the-middle attacks. In production environments, always use HTTPS.
711

812
To configure HTTPS, you must create SSL certificates. You can use certificates that are signed by a trusted third-party CA, or you can use self-signed certificates. This section describes how to use [OpenSSL](https://www.openssl.org/) to create a CA, and how to use your CA to sign a server certificate and a client certificate. You can use other CA providers, for example [Let's Encrypt](https://letsencrypt.org/).
@@ -84,33 +88,38 @@ The certificate usually contains a `.crt` file and a `.key` file, for example, `
8488
8589
## Provide the Certificates to Harbor and Docker
8690
87-
After generating the `ca.crt`, `yourdomain.com.crt`, and `yourdomain.com.key` files, you must provide them to Harbor and to Docker, and reconfigure Harbor to use them.
91+
After generating the `ca.crt`, `yourdomain.com.crt`, and `yourdomain.com.key` files for your self-signed certificate, you must provide them to Harbor and to the Docker daemon.
92+
93+
1. Create the Certificate Directory for Harbor.
94+
95+
The `/data/cert/` directory is the default location where Harbor looks for its certificates, but this directory does not exist by default. You must create it first.
8896
89-
1. Copy the server certificate and key into the certficates folder on your Harbor host.
97+
```sh
98+
sudo mkdir -p /data/cert/
99+
100+
1. Copy the Server Certificate and Key to the Harbor Directory
90101
91102
```sh
92103
cp yourdomain.com.crt /data/cert/
93-
cp yourdomain.com.key /data/cert/
104+
sudo cp yourdomain.com.key /data/cert/
94105
```
95106
96-
1. Convert `yourdomain.com.crt` to `yourdomain.com.cert`, for use by Docker.
107+
1. Configure the Docker Daemon to Trust the Certificate
97108
98-
The Docker daemon interprets `.crt` files as CA certificates and `.cert` files as client certificates.
109+
To allow the Docker client to push and pull images, the Docker daemon must also trust the certificate so ,convert your server certificate from .crt to .cert, as the Docker daemon requires this extension.
99110
100111
```sh
101-
openssl x509 -inform PEM -in yourdomain.com.crt -out yourdomain.com.cert
112+
openssl x509 -inform PEM -in yourdomain.com.crt -out yourdomain.com.cer
102113
```
103-
104-
1. Copy the server certificate, key and CA files into the Docker certificates folder on the Harbor host. You must create the appropriate folders first.
114+
Next, create a dedicated directory for your Harbor domain and copy all three certificate files into it.
105115
106116
```sh
117+
mkdir -p /etc/docker/certs.d/yourdomain.com/
107118
cp yourdomain.com.cert /etc/docker/certs.d/yourdomain.com/
108119
cp yourdomain.com.key /etc/docker/certs.d/yourdomain.com/
109120
cp ca.crt /etc/docker/certs.d/yourdomain.com/
110121
```
111122
112-
If you mapped the default `nginx` port 443 to a different port, create the folder `/etc/docker/certs.d/yourdomain.com:port`, or `/etc/docker/certs.d/harbor_IP:port`.
113-
114123
1. Restart Docker Engine.
115124
116125
```sh
@@ -119,14 +128,14 @@ After generating the `ca.crt`, `yourdomain.com.crt`, and `yourdomain.com.key` fi
119128
120129
You might also need to trust the certificate at the OS level. See [Troubleshooting Harbor Installation](troubleshoot-installation.md#https) for more information.
121130
122-
The following example illustrates a configuration that uses custom certificates.
131+
The following example illustrates the final directory structure for Docker, which uses your custom certificates.
123132
124133
```
125134
/etc/docker/certs.d/
126135
└── yourdomain.com:port
127-
├── yourdomain.com.cert <-- Server certificate signed by CA
128-
├── yourdomain.com.key <-- Server key signed by CA
129-
└── ca.crt <-- Certificate authority that signed the registry certificate
136+
├── yourdomain.com.cert
137+
├── yourdomain.com.key
138+
└── ca.crt
130139
```
131140
132141
## Deploy or Reconfigure Harbor

docs/install-config/download-installer.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ The installation processes are almost the same for the online and offline instal
7373
7474
- To secure the connections to Harbor, see [Configure HTTPS Access to Harbor](configure-https.md).
7575
- To configure your Harbor installation, see [Configure the Harbor YML File](configure-yml-file.md).
76+
77+
### Notes on the Installer Directory
78+
79+
You can extract the Harbor installer in any location. The user running the installation script must have permissions to execute Docker commands (usually by being in the `docker` group).
80+
81+
This directory is used only for installation and configuration. It is not where Harbor's permanent data is stored. All Harbor services run inside Docker containers, and their data is stored in Docker volumes. You should keep this directory so you can manage your Harbor instance later (e.g., for upgrades or configuration changes).

docs/working-with-projects/working-with-images/pulling-pushing-images.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ Push the image:
6262
```sh
6363
docker push <harbor_address>/demo/ubuntu:14.04
6464
```
65+
**Understanding the Image Name Structure**
66+
67+
In Harbor, a fully qualified image name has three main parts: <project_name>/<repository_name>:<tag>. This is a critical concept for pushing images and configuring deployment tools.
68+
69+
Using the example <harbor_address>/demo/ubuntu:14.04:
70+
demo: This is the Project you created in the Harbor UI.
71+
ubuntu: This is the Repository name inside the demo project. A repository holds all the tags for a single image.
72+
14.04: This is the Tag, which usually represents a specific version of the image.
73+
74+
When configuring deployment tools (like Kubernetes or Kamal), ensure your target image name is set to the format <project_name>/<repository_name>
6575

6676
### Pushing Windows Images
6777

0 commit comments

Comments
 (0)