---
title: "Helm cheat sheet"
description: "Helm 4.2 commands, one line each: repositories, OCI registries, install and upgrade, values, templates, releases, rollbacks, chart building and pitfalls."
url: "https://opsfolk.com/cheat-sheets/helm"
category: "Kubernetes"
checked_on: "Helm 4.2"
reviewed: "2026-11-29"
updated: "2026-11-29T16:46:58.387Z"
sections: 10
entries: 90
---

# Helm cheat sheet

The Helm commands you reach for every day, from adding a repository and installing a chart to reading a release's values and rolling it back, checked on Helm 4.2.

Checked on Helm 4.2, reviewed 2026-11-29.

Names such as `api`, `web`, `prod` and `bitnami` are examples: put your own release, namespace or repository there. A release lives in a namespace, so every command about one takes `-n <namespace>`, or the context's default when you leave it out. Helm 4 renamed a few flags of Helm 3; where one changed, its row says what it was called.

## Repositories and search

Add the repositories charts come from, keep their indexes fresh and find a chart.

```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
```

Add a chart repository under a name of your choosing.

- Tip: `--username` and `--password-stdin` add one that asks for credentials.

```bash
helm repo update
```

Download the latest index of every repository, so search and install see new versions.

```bash
helm repo update bitnami
```

Update one repository's index only.

```bash
helm repo list
```

List the repositories you added, with their URLs.

```bash
helm repo remove bitnami
```

Forget a repository; releases installed from it are left as they are.

```bash
helm search repo postgres
```

Search the charts of the repositories you added, by name and description.

```bash
helm search repo bitnami/postgresql --versions
```

List every version of a chart, with the app version each one ships.

- Tip: `--version '^16.0.0'` narrows the list to a semver range.

```bash
helm search hub ingress-nginx
```

Search Artifact Hub, the public index of charts, for one you have not added.

- Tip: `--list-repo-url` prints the repository to `helm repo add` for each result.

```bash
helm show readme bitnami/postgresql
```

Read a chart's README without installing it.

```bash
helm show chart bitnami/postgresql
```

Print a chart's `Chart.yaml`: its version, app version and dependencies.

```bash
helm pull bitnami/postgresql --version 16.4.0 --untar
```

Download a chart and unpack it into a folder, to read its templates.

## OCI registries

Charts stored as OCI artifacts, in the same registries as images.

> A chart in a registry is named by an `oci://` address and needs no `helm repo add`: install, pull and show take the address itself.

```bash
echo "$TOKEN" | helm registry login ghcr.io -u my-user --password-stdin
```

Sign in to a registry, reading the password or token from standard input.

- Warning: `-p` on the command line leaves the token in your shell's history.

```bash
helm registry logout ghcr.io
```

Remove the credentials Helm stored for a registry.

```bash
helm install api oci://ghcr.io/acme/charts/api --version 1.4.0
```

Install a chart straight from a registry.

```bash
helm show values oci://ghcr.io/acme/charts/api --version 1.4.0
```

Read the default values of a chart in a registry.

```bash
helm pull oci://ghcr.io/acme/charts/api --version 1.4.0
```

Download a chart from a registry as a `.tgz`.

```bash
helm push api-1.4.0.tgz oci://ghcr.io/acme/charts
```

Push a packaged chart; its name and version come from the archive.

- Tip: The address ends at the namespace: Helm appends the chart's name itself.

```bash
helm upgrade --install api oci://ghcr.io/acme/charts/api@sha256:<digest>
```

Pin a chart to its digest, so a tag pushed again cannot change what you install.

## Install and upgrade

Put a chart on the cluster as a release, then move it to new values or a new version.

```bash
helm install api bitnami/nginx -n web --create-namespace
```

Install a chart as the release `api`, making the namespace if it does not exist.

```bash
helm install bitnami/nginx --generate-name
```

Install with a name Helm makes up, such as `nginx-1712345678`.

```bash
helm install api ./api
```

Install a chart from a folder on disk, or from a packaged `.tgz`.

```bash
helm upgrade --install api bitnami/nginx -n web -f values-prod.yaml
```

Install the release if it is not there, upgrade it if it is: the one command for CI.

- Tip: `-i` is short for `--install`.

```bash
helm upgrade api bitnami/nginx --version 18.2.0 --reuse-values
```

Move a release to another chart version and keep the values it already has.

```bash
helm upgrade --install api ./api --wait --timeout 10m
```

Wait until the release's Deployments and pods are ready before returning, failing after 10 minutes.

- Tip: Without `--wait`, Helm 4 waits for hooks only (`hookOnly`) and returns once the resources are sent.

```bash
helm upgrade --install api ./api --rollback-on-failure
```

Roll back to the last good revision when the upgrade fails, or uninstall a failed first install.

- Tip: Helm 3 called it `--atomic`, which Helm 4 still takes with a warning. It turns `--wait` on.

```bash
helm upgrade api ./api --cleanup-on-fail
```

Delete the resources an upgrade created when it fails, so the next try does not meet them.

```bash
helm upgrade --install api ./api --dry-run=server
```

Render the chart and have the API server validate the result, changing nothing.

- Warning: The output includes Secrets in the clear; `--hide-secret` leaves them out.

```bash
helm upgrade api ./api --force-replace
```

Delete and recreate resources that cannot be updated in place.

- Tip: Helm 3 called it `--force`.
- Warning: Pods are deleted and recreated: expect downtime.

```bash
helm install api ./api --take-ownership
```

Adopt resources that already exist in the cluster instead of failing on them.

```bash
helm upgrade --install api ./api --history-max 5
```

Keep five revisions of the release, so its history Secrets do not pile up; the default is 10.

```bash
helm upgrade api ./api --server-side=false
```

Apply with Helm's client-side three-way merge instead of server-side apply.

- Tip: Helm 4 installs with server-side apply; `auto`, an upgrade's default, keeps what the release used before.

## Values

What a chart lets you set, and the ways to set it from files and the command line.

```bash
helm show values bitnami/postgresql > values.yaml
```

Save a chart's default values, to copy what you change into a file of your own.

```bash
helm install db bitnami/postgresql -f values.yaml -f values-prod.yaml
```

Pass values files; when two set the same key, the later file wins.

```bash
helm install api ./api --set replicaCount=3,image.tag=1.5
```

Set values on the command line, dots for nesting and commas between pairs.

- Tip: `--set` wins over every `-f` file, whatever the order on the line.

```bash
helm install api ./api --set 'ingress.hosts[0].host=api.example.com'
```

Set an item of a list by its index.

```bash
helm install api ./api --set-string podAnnotations.sidecar\.istio\.io/inject=true
```

Force a value to a string, here an annotation that `--set` would make a boolean; a dot in a key is escaped.

```bash
helm install api ./api --set-literal 'config.dsn=user=app,host=db'
```

Set a string exactly as written, commas, dots and equals signs included.

```bash
helm install api ./api --set-json 'tolerations=[{"key":"gpu","operator":"Exists"}]'
```

Set a list or a map as JSON in one flag.

```bash
helm install api ./api --set-file config.script=./init.sh
```

Set a value to the contents of a file.

```bash
helm get values api -n web
```

Print the values you supplied to the release, not the chart's defaults.

```bash
helm get values api --all
```

Print every value the release used: the chart's defaults merged with yours.

```bash
helm get values api --revision 3
```

Print the values an earlier revision was given, to compare with the current one.

## Releases

What is installed, in which state, and what each revision was given.

```bash
helm list -n web
```

List the releases in a namespace, with their revision, status, chart and app version.

```bash
helm list -A
```

List the releases in every namespace.

```bash
helm list -A --failed --pending
```

List the releases that failed, or are stuck in the middle of an operation.

```bash
helm list -n web -q
```

Print release names only, one a line, for a script.

```bash
helm status api -n web
```

Show a release's state, its last deployment and its notes.

```bash
helm history api -n web
```

List a release's revisions, each with its status, chart version and description.

```bash
helm get manifest api -n web
```

Print the Kubernetes YAML the release applied, as Helm rendered it.

```bash
helm get notes api -n web
```

Print the chart's NOTES, the instructions shown after an install.

```bash
helm get hooks api -n web
```

Print the release's hooks: the Jobs and other resources it runs before or after a change.

```bash
helm get all api -n web
```

Print a release's values, manifest, hooks and notes at once.

```bash
helm get metadata api -n web
```

Print the release's chart, versions, namespace and status, `-o json` for a script.

## Roll back and uninstall

Go back to an earlier revision, or take a release off the cluster.

```bash
helm rollback api -n web
```

Roll the release back to the revision before the current one.

```bash
helm rollback api 4 -n web --wait
```

Roll back to revision 4 and wait for its resources to be ready.

- Tip: A rollback is itself a new revision: after it, `history` shows revision 4's chart under a higher number.

```bash
helm uninstall api -n web
```

Delete the release's resources and its history.

```bash
helm uninstall api -n web --keep-history
```

Delete the resources but keep the history, so the release can be rolled back into existence.

- Tip: `helm list --uninstalled` lists releases removed this way.

```bash
helm uninstall api -n web --dry-run
```

Show what would be uninstalled, removing nothing.

```bash
helm uninstall api -n web --ignore-not-found
```

Treat a release that is not there as uninstalled, for a cleanup script that may run twice.

> `helm uninstall` leaves the CRDs of a chart's `crds/` folder, and the PersistentVolumeClaims a StatefulSet made, in place: delete them yourself when the data should go too.

## Templates and debugging

Render a chart without installing it, and find out why it renders wrong.

```bash
helm template api ./api -f values-prod.yaml
```

Render the chart's manifests to standard output, without a cluster.

```bash
helm template api ./api -s templates/deployment.yaml
```

Render one template only.

- Tip: `--show-only` is the long form, and takes a path relative to the chart.

```bash
helm template api ./api --output-dir out/
```

Write each rendered template to its own file under `out/`, to diff or review.

```bash
helm template api ./api --kube-version 1.36 --api-versions monitoring.coreos.com/v1
```

Render as for a given cluster, for templates that read `.Capabilities`.

```bash
helm template api ./api | kubectl apply --dry-run=server -f -
```

Have the cluster validate what a chart renders before you install it.

```bash
helm lint ./api -f values-prod.yaml --strict
```

Check a chart's structure and templates with your values, failing on warnings too.

```bash
helm install api ./api --debug --dry-run=client
```

Print the computed values and the rendered manifests, with Helm's own log lines.

```bash
helm diff upgrade api ./api -n web -f values-prod.yaml
```

Show what an upgrade would change in the cluster, as a diff, from the `helm-diff` plugin.

- Tip: Install the plugin once with `helm plugin install https://github.com/databus23/helm-diff`.

## Building charts

Start a chart, manage its dependencies, and package it to share.

```bash
helm create api
```

Make a chart folder with a Deployment, a Service, an Ingress and a values file to start from.

```bash
helm dependency update ./api
```

Download the dependencies `Chart.yaml` lists into `charts/` and write `Chart.lock`.

```bash
helm dependency build ./api
```

Download the exact versions in `Chart.lock`, as CI should.

```bash
helm dependency list ./api
```

List a chart's dependencies and whether each one is in `charts/`.

```bash
helm package ./api
```

Pack a chart into `api-<version>.tgz`, ready to push or to add to a repository.

```bash
helm package ./api --version 1.4.0 --app-version 2.1.0
```

Package with a chart version and an app version that override `Chart.yaml`'s, for CI.

```bash
helm repo index ./dist --url https://charts.example.com
```

Write the `index.yaml` of a static chart repository from the archives in a folder.

```bash
helm plugin list
```

List installed plugins, the extra subcommands such as `helm diff`.

## Chart files

The files of a chart to start from.

### Chart.yaml

```yaml
apiVersion: v2
name: api
description: The Acme API
type: application
version: 1.4.0
appVersion: "2.1.0"
dependencies:
  - name: postgresql
    version: 16.x.x
    repository: https://charts.bitnami.com/bitnami
    condition: postgresql.enabled
```

A chart's metadata with a dependency that the values can switch off with `postgresql.enabled`.

### values.yaml

```yaml
replicaCount: 2
image:
  repository: ghcr.io/acme/api
  tag: ""
resources:
  requests:
    cpu: 250m
    memory: 256Mi
postgresql:
  enabled: true
  auth:
    database: api
```

Defaults a reader can override; a dependency's values go under its name.

### templates/deployment.yaml

```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "api.fullname" . }}
  labels:
    {{- include "api.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "api.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        {{- include "api.selectorLabels" . | nindent 8 }}
    spec:
      containers:
        - name: api
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
```

A template with the helpers `helm create` writes, the image tag falling back to `appVersion`.

## Pitfalls

What goes wrong with Helm, and how to get out of it.

**Problem:** After `helm upgrade` with one `--set`, the values given at install are gone and the chart's defaults are back.

**Fix:** An upgrade starts from the chart's defaults plus what this command gives. Keep the values in a file and pass `-f` on every upgrade, or add `--reset-then-reuse-values` to keep the last release's.

**Problem:** `--reuse-values` kept the old values, but a key the new chart version added is missing and a template fails on it.

**Fix:** `--reuse-values` takes the last release's values as they are and ignores the new chart's defaults. Use `--reset-then-reuse-values`, which starts from the new defaults and lays the old values over them.

**Problem:** `Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress`.

**Fix:** An earlier run was killed and left the release `pending-upgrade`. Check nothing else is running, then `helm rollback` to the last `deployed` revision from `helm history`.

**Problem:** `Error: release: not found`, though `helm list` showed it yesterday.

**Fix:** A release belongs to a namespace. Pass the `-n` it was installed with, or find it with `helm list -A`.

**Problem:** A new version of a chart changed its CRDs, but the cluster still has the old ones after `helm upgrade`.

**Fix:** Helm installs the files in `crds/` once and never upgrades or deletes them. Apply the new CRDs yourself with `kubectl apply --server-side -f`, before the upgrade.

**Problem:** The install fails with `cannot unmarshal bool into Go struct field ... of type string` on an annotation or an env value.

**Fix:** `--set` makes `true`, `false` and whole numbers into booleans and numbers. Pass the value with `--set-string`, or quote it in a values file.

**Problem:** `--set` split a value at its comma, or nested a key at its dot.

**Fix:** Escape the comma or the dot with a backslash, quote the whole flag, or use `--set-literal` for a string, `--set-json` for a structure.

**Problem:** `Error: INSTALLATION FAILED: ... exists and cannot be imported into the current release`.

**Fix:** A resource of that name was made outside Helm, or by another release. Delete it, rename it in the values, or pass `--take-ownership` to adopt it.

**Problem:** `helm upgrade --wait` timed out, and the release is `failed`.

**Fix:** The new pods never got ready: read `kubectl get pods` and `kubectl describe` for why. Fix it and upgrade again, or `helm rollback`; `--rollback-on-failure` does that for you next time.

**Problem:** A Secret or ConfigMap changed, but the pods kept the old one after the upgrade.

**Fix:** Changing them does not restart a Deployment. In the chart, put a checksum of the file in the pod template's annotations, as `checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}`.
