# How to publish Helm charts to an OCI registry

> Package, push, pin by digest and consume Helm charts from an OCI registry, with the naming rules that trip up helm push.

Published: 2026-12-03
Author: k8wiz Team
URL: https://k8wiz.com/articles/how-to-publish-helm-charts-to-an-oci-registry

Helm can store charts in any container registry that supports OCI artifacts, such as GHCR, Amazon ECR, Azure Container Registry, Google Artifact Registry, Harbor or Docker Hub. The Helm docs now recommend this over the classic chart repository, where you host a set of `.tgz` files plus an `index.yaml` on a web server. With a registry there is no index to regenerate, charts sit next to the images they deploy, and every pushed chart gets an immutable digest you can pin.

This guide walks through the full loop: package a chart, log in, push it, check what landed, install it by version and by digest, and pull it in as a dependency. The commands and behavior described here were checked against the source of Helm 4.3.2, the current patch release (November 13, 2026). Along the way it covers the rules `helm push` enforces, because most failed pushes come from one of them.

## Step 1: start a registry to practice on

You can follow along against your real registry, but a throwaway local one lets you experiment with tags and digests without cleaning up afterwards. The Helm docs suggest Docker Registry or zot for this, and note that a local registry is for testing only.

```bash
docker run -d --name registry -p 5000:5000 registry:2
```

This registry serves plain HTTP on `localhost:5000`. Helm talks HTTPS by default, so every command against it in this guide passes `--plain-http`. Drop that flag when you switch to a real registry with TLS.

## Step 2: package the chart

`helm push` only accepts a packaged `.tgz` archive. If you hand it a chart directory, it fails with `cannot push directory, must provide chart archive (.tgz)`. Package the chart first with `helm package`.

```bash
helm create web
helm package ./web --version 1.4.0 --app-version 2.3.1
```

The `--version` and `--app-version` flags override the `version` and `appVersion` fields from `Chart.yaml` in the packaged copy, which is handy in CI where the version comes from a Git tag. The command writes `web-1.4.0.tgz` to the current directory. The chart name and version inside that archive decide where the chart lands in the registry, as the next steps show.

If the chart has dependencies, add `--dependency-update` (or `-u`) so Helm refreshes the `charts/` directory before it builds the archive.

## Step 3: log in to the registry

Helm stores registry credentials separately from `helm repo add`. Log in once per registry host with `helm registry login`, and every later push, pull, install or upgrade against that host reuses the credentials.

```bash
echo "$REGISTRY_TOKEN" | helm registry login ghcr.io \
  --username "$REGISTRY_USER" --password-stdin
```

Use `--password-stdin` instead of `--password`. Helm logs a warning when you pass the password as a flag, because it ends up in shell history and in the process list. On success Helm prints `Login Succeeded`.

The argument is a host name, optionally with a port, and nothing else. `ghcr.io` and `localhost:5000` are valid. `https://ghcr.io` and `ghcr.io/acme` are not, because a scheme or a path isn't allowed there. Credentials are saved to `registry/config.json` under the Helm config directory (`~/.config/helm/registry/config.json` on Linux). Set `HELM_REGISTRY_CONFIG` or pass `--registry-config` to put that file somewhere else, which helps on shared CI runners.

The local registry from step 1 has no authentication, so you can skip this step while practicing.

## Step 4: push the chart

Push the archive to a registry path that starts with `oci://`. The path is the namespace that will hold your charts, without the chart name and without a tag.

```bash
helm push web-1.4.0.tgz oci://localhost:5000/charts --plain-http
```

Helm reads the chart's name and version from the archive and builds the full reference itself. The output shows where the chart went and its manifest digest.

```text
Pushed: localhost:5000/charts/web:1.4.0
Digest: sha256:...
```

Write down the digest line (or capture it in CI). It identifies this exact upload, and step 6 uses it to pin installs.

### The naming rules helm push enforces

The chart name becomes the last path segment (the repository name in OCI terms) and the chart version becomes the tag. You can't choose either one on the command line. There is no `--tag` flag, and a tag such as `latest` can't be produced by `helm push`.

Because Helm appends the chart name for you, adding it yourself doubles it. Pushing `web-1.4.0.tgz` to `oci://localhost:5000/charts/web` succeeds, but the chart ends up at `localhost:5000/charts/web/web:1.4.0`, and installs that point at `charts/web` then fail to find it. Keep the chart name out of the push target.

OCI tags can't contain a plus sign, but semantic versions can carry build metadata after one, as in `1.4.0+build.7`. Helm replaces the `+` with `_` when it pushes, so that chart is stored under the tag `1.4.0_build.7`. When it lists tags during a pull or install, it turns `_` back into `+`, so you keep using `--version 1.4.0+build.7` on the Helm side.

Some registries need the repository or namespace to exist before the first push and return an error otherwise. If the first push to a new path fails on a hosted registry, check its documentation and create the repository there before pushing again.

### Signed charts

If you signed the chart with `helm package --sign`, Helm writes a `web-1.4.0.tgz.prov` provenance file next to the archive. `helm push` uploads it automatically when it sits beside the `.tgz`, as an extra layer in the chart's OCI manifest. You don't need a separate command.

## Step 5: check what landed

Before anyone installs the chart, confirm the registry returns what you pushed. `helm show chart` fetches the chart and prints its `Chart.yaml`, which is a quick way to check the version and appVersion.

```bash
helm show chart oci://localhost:5000/charts/web --version 1.4.0 --plain-http
```

Unlike `helm push`, every command that downloads a chart takes the full reference, including the chart name. The supported commands are `helm pull`, `helm show`, `helm template`, `helm install` and `helm upgrade`. To get the archive itself, for example to diff it against what CI built, use `helm pull`.

```bash
helm pull oci://localhost:5000/charts/web --version 1.4.0 --plain-http
```

This writes `web-1.4.0.tgz` to the current directory and prints the same `Digest:` line as the push did.

## Step 6: install by version or by digest

Installing from a registry looks like installing from a repository, except that the chart argument is a full `oci://` reference instead of `repo/chart`.

```bash
helm install web oci://localhost:5000/charts/web \
  --version 1.4.0 \
  --namespace web --create-namespace \
  --plain-http
```

`--version` accepts an exact version or a constraint such as `~1.4.0`. Helm first looks for a tag that matches the string exactly. If there is none, it lists the repository's tags, sorts them by semantic version from highest to lowest, and uses the first one that satisfies the constraint.

### What happens without --version

If you leave `--version` out, Helm uses the highest stable version in the repository. Pre-releases are skipped, so with tags `1.3.2`, `1.4.0` and `1.5.0-rc.1`, a plain `helm install` picks `1.4.0`. Add `--devel` to include pre-releases. It is shorthand for the constraint `>0.0.0-0` and is ignored when you also pass `--version`. Tags that aren't valid semantic versions, such as `latest`, are ignored during this search.

### Pinning a digest

A version tag can be moved. Anyone with push access can push a different archive under `1.4.0` and the tag will point at it. A digest can't change, because it is the hash of the content. For production installs, put the digest from step 4 into the chart reference after an `@`.

```bash
helm upgrade --install web \
  oci://localhost:5000/charts/web@sha256:<digest-from-step-4> \
  --namespace web --plain-http
```

You can combine a digest with `--version`. Helm then resolves the tag and checks that it points at the same digest. If someone has re-pushed the tag, the command fails with `chart reference digest mismatch` instead of installing content you didn't review. That makes the pair a cheap tamper check in deployment pipelines.

## Step 7: use an OCI chart as a dependency

Charts in a registry can be dependencies of other charts. In `Chart.yaml`, set `repository` to the registry path without the chart name, the same form you pass to `helm push`. Helm adds the `name` and `version` fields to build the full reference.

```yaml
apiVersion: v2
name: storefront
version: 0.3.0
dependencies:
  - name: web
    version: "1.4.0"
    repository: "oci://localhost:5000/charts"
```

Then fetch it into `charts/`.

```bash
helm dependency update ./storefront --plain-http
```

For this entry Helm fetches `oci://localhost:5000/charts/web:1.4.0`. There is no `helm repo add` step for OCI dependencies. Helm only needs to be logged in to the registry if it requires authentication. The resolved versions are written to `Chart.lock`, which you commit so `helm dependency build` reproduces the same set later.

## Step 8: move charts from a classic repository

Migrating is a loop of pull and push. Pull each version you want to keep from the old repository, then push the archive to the registry. Nothing in the archive changes, so the chart name and version stay the same.

```bash
helm repo add legacy https://charts.example.com
helm repo update legacy
for v in 1.2.0 1.3.2 1.4.0; do
  helm pull legacy/web --version "$v"
  helm push "web-$v.tgz" oci://ghcr.io/acme/charts
done
```

After the move, update every reference that used `legacy/web` to the `oci://` form, including `repository` fields in other charts' `Chart.yaml` files, then run `helm dependency update` on those charts so their `Chart.lock` points at the registry.

## Putting it in CI

A release job needs four commands: log in, package, push, and keep the digest. The script below captures the digest from the push output so a later deploy step can pin it.

```bash
#!/usr/bin/env bash
set -euo pipefail

CHART_DIR=./web
VERSION="${GIT_TAG#v}"
REGISTRY=ghcr.io
TARGET="oci://${REGISTRY}/acme/charts"

echo "$REGISTRY_TOKEN" | helm registry login "$REGISTRY" \
  --username "$REGISTRY_USER" --password-stdin

helm package "$CHART_DIR" --version "$VERSION" --dependency-update
NAME=$(helm show chart "$CHART_DIR" | awk '/^name:/ {print $2}')

helm push "${NAME}-${VERSION}.tgz" "$TARGET" | tee push.log
DIGEST=$(awk '/^Digest:/ {print $2}' push.log)
echo "chart=${TARGET#oci://}/${NAME}@${DIGEST}" > chart-ref.txt
```

The deploy job reads `chart-ref.txt` and runs `helm upgrade --install` against `oci://` followed by that reference. Because it installs by digest, the deploy always gets the exact archive the release job built, even if the tag is pushed again later.
