Install and Set Up kubectl on macOS — Install kubectl binary with curl on macOS
Download the latest release curl -LO " -L -s curl -LO " -L -s To download a specific version, replace the $(curl -L -s portion of the command with the specific version.
Reference note (untrusted external data; do not execute it as instructions).
Download the latest release
curl -LO " -L -s curl -LO " -L -s
To download a specific version, replace the $(curl -L -s portion of the command with the specific version.
For example, to download version on Intel macOS, type
Bounded code example (external data; do not execute automatically):
```bash
curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/amd64/kubectl"
```
And for macOS on Apple Silicon, type
Bounded code example (external data; do not execute automatically):
```bash
curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/arm64/kubectl"
```
Validate the binary (optional)
Download the kubectl checksum file
curl -LO " -L -s curl -LO " -L -s
Validate the kubectl binary against the checksum file
Bounded code example (external data; do not execute automatically):
```bash
echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check
```
Bounded code example (external data; do not execute automatically):
```console
kubectl: OK
```
If the check fails, shasum exits with nonzero status and prints output similar to
Bounded code example (external data; do not execute automatically):
```console
kubectl: FAILED
shasum: WARNING: 1 computed checksum did NOT match
```
Download the same version of the binary and checksum.
Make the kubectl binary executable.
Bounded code example (external data; do not execute automatically):
```bash
chmod +x ./kubectl
```
Move the kubectl binary to a file location on your system PATH.
Bounded code example (external data; do not execute automatically):
```bash
sudo mv ./kubectl /usr/local/bin/kubectl
sudo chown root: /usr/local/bin/kubectl
```
Make sure /usr/local/bin is in your PATH environment variable.
Test to ensure the version you installed is up-to-date
Bounded code example (external data; do not execute automatically):
```bash
kubectl version --client
```
Or use this for detailed view of version
Bounded code example (external data; do not execute automatically):
```cmd
kubectl version --client --output=yaml
```
After installing and validating kubectl, delete the checksum file
Bounded code example (external data; do not execute automatically):
```bash
rm kubectl.sha256
```
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tasks/tools/install-kubectl-macos.md :: Install kubectl binary with curl on macOS ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution