# Install kubectl-cnpg with Homebrew, apk, Nix, zypper

CloudNativePG plugin for kubectl. Version 1.30.0 via Homebrew; verified 2026-07-27. Also installable with nix: nix profile install nixpkgs#kubectl-cnpg.

## Install

```sh
sudo av install brew:kubectl-cnpg
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install kubectl-cnpg
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add kubectl-cnpg
```

  Evidence: Alpine Linux edge package indexes: kubectl-cnpg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#kubectl-cnpg
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ku/kubectl-cnpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install kubectl-cnpg
```

  Evidence: openSUSE Tumbleweed package metadata: kubectl-cnpg from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:kubectl-cnpg
- **Package manager:** Homebrew
- **Version:** 1.30.0
- **Source summary:** CloudNativePG plugin for kubectl
- **Homepage:** <https://cloudnative-pg.io/>
- **Repository:** <https://github.com/cloudnative-pg/cloudnative-pg>
- **Last updated:** 2026-07-27T21:58:44+02:00
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- kubectl-cnpg (alias)
- kubectl_complete-cnpg (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 1.30.0
## Project history and usage

kubectl-cnpg is the kubectl plugin shipped by the CloudNativePG project for managing PostgreSQL clusters on Kubernetes. The plugin is part of the main CloudNativePG repository rather than a separate utility repository.

### Project history

The CloudNativePG GitHub repository was created on 2022-03-10. The project describes CloudNativePG as a platform for managing PostgreSQL databases in Kubernetes across the operational lifecycle, and its repository topics include `kubectl-plugin`, `operator`, `postgresql`, and high-availability concepts.

The kubectl plugin became one of the operator's user-facing control surfaces: the official plugin documentation covers installation scripts, Debian and RPM packages, AUR, Krew, Homebrew, supported architectures, completion, and command usage.

### Adoption history

The plugin's adoption follows CloudNativePG adoption rather than an independent CLI culture. The package appears in Homebrew, APK, Nix, and zypper, and the official docs name Homebrew and Krew as supported install paths for workstation users.

The repository metadata observed on 2026-07-01 showed more than 8000 GitHub stars for CloudNativePG, which makes kubectl-cnpg a plugin attached to a prominent Kubernetes database operator rather than a tiny standalone addon.

### How it is used

After installation, users run commands as `kubectl cnpg COMMAND [ARGS...]`. The official documentation emphasizes management tasks such as generating installation manifests and interacting with CloudNativePG-managed database clusters.

The plugin uses the normal kubectl configuration path through `~/.kube/config`, so it fits existing Kubernetes authentication and context workflows rather than defining a separate credentials store.

### Why package nerds care

kubectl-cnpg is interesting as a packaged operator companion: the binary is distributed across OS package systems even though its value is tied to a cluster-side controller. It shows how serious Kubernetes operators often grow their own kubectl plugin for operational ergonomics.

### Timeline

- 2022-03-10: CloudNativePG repository created.
- 2025-05-08: CloudNativePG release v1.29.1 published.
- 2026-06-29: CloudNativePG release v1.30.0 published, with plugin package examples in the documentation using v1.30.0 assets.

### Related projects

- Related projects include Kubernetes, kubectl, Krew, PostgreSQL, and the CloudNativePG operator. The package is not a general PostgreSQL client; it is an operational frontend for CloudNativePG resources.

### Sources

- <https://api.github.com/repos/cloudnative-pg/cloudnative-pg>
- <https://cloudnative-pg.io/docs/devel/kubectl-plugin>
- <https://cloudnative-pg.io/documentation/current/kubectl-plugin>
- <https://formulae.brew.sh/formula/kubectl-cnpg>
- <https://github.com/cloudnative-pg/cloudnative-pg>
- <https://krew.sigs.k8s.io/docs/user-guide/setup/install/>


## Security Notes

infrastructure mutation or orchestration signal.

- **Geiger risk:** orange / medium
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.kube/config
## Other Package-Manager Records

- Nix - kubectl-cnpg: normalized package name match | nixpkgs package indexes: pkgs/by-name/ku/kubectl-cnpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - kubectl-cnpg - 1.30.0-r1: normalized package name match | Alpine Linux edge package indexes: kubectl-cnpg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | kubectl plugin for cloudnative-pg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg - 1.29.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Manage PostgreSQL clusters built using CloudNativePG | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-bash-completion - 1.29.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-bash-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Bash Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-fish-completion - 1.29.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-fish-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Fish Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-zsh-completion - 1.29.2-1.3: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-zsh-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Zsh Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg


## Combined YAML source

View the package source record on GitHub. [combined/kubectl-cnpg.yml](https://github.com/mxcl/pkgdb/blob/main/combined/kubectl-cnpg.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
