> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation with CLI

> Guide to installing and configuring Cilium using the cilium CLI, including download, installation, dry-run previews, Helm value configuration, status checks, and best practices.

In this lesson we will go over how to install Cilium using the Cilium CLI.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3_oH8WobznU4DXye/images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Installing-Configuring-Cilium/Installation-with-CLI/installing-cilium-with-cli-slide.jpg?fit=max&auto=format&n=3_oH8WobznU4DXye&q=85&s=836f28bdbe14c25e5c7eb06105ef501a" alt="A presentation title slide with the text &#x22;Installing Cilium With CLI&#x22; on a blue-green gradient background. A small &#x22;© Copyright KodeKloud&#x22; appears in the lower-left corner." width="1920" height="1080" data-path="images/Prep-Course-Cilium-Certified-Associate-CCA-Certification/Installing-Configuring-Cilium/Installation-with-CLI/installing-cilium-with-cli-slide.jpg" />
</Frame>

## Download and install the Cilium CLI

First, download the Cilium CLI binary appropriate for your platform and install it into your PATH. The example below targets Linux; macOS and Windows users can find platform-specific binaries on the Cilium releases page.

Recommended links:

* Cilium CLI releases: [https://github.com/cilium/cilium-cli/releases](https://github.com/cilium/cilium-cli/releases)
* Cilium docs: [https://cilium.io/docs/](https://cilium.io/docs/)

Example (Linux):

```bash theme={null}
# Determine the stable CLI version
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)

# Default architecture; override for aarch64
CLI_ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then
  CLI_ARCH=arm64
fi

# Download the tarball and checksum
curl -L --fail --remote-name-all "https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz"{,.sha256sum}

# Extract and install
tar xzf "cilium-linux-${CLI_ARCH}.tar.gz"
sudo mv cilium /usr/local/bin/
```

Verify the installation:

```bash theme={null}
cilium version
```

Notes:

* For macOS use the `darwin` tarball; for Windows use the appropriate zip.
* If you prefer package managers, check the Cilium docs for Homebrew, Chocolatey, or distribution packages.

## Install Cilium into the cluster

The Cilium CLI uses your current kubeconfig context to determine which cluster to install into. Ensure your kubeconfig points to the intended cluster before running the installer.

Warning: make sure you are targeting the correct cluster/context to avoid accidental changes to production clusters.

<Callout icon="warning" color="#FF6B6B">
  Ensure your kubeconfig context is set to the intended cluster before running `cilium install`. Installing Cilium will create ClusterRoles, DaemonSets, Deployments, and other cluster-scoped resources.
</Callout>

Run the installer:

```bash theme={null}
cilium install
```

Wait for components to become healthy. Use --wait to block until readiness conditions are met:

```bash theme={null}
cilium status --wait
```

Example output (truncated):

```bash theme={null}
/'`\
/'--\__\
\__/--/
 \__/

Cilium:        OK
Operator:      OK
Hubble:        disabled
ClusterMesh:   disabled

DaemonSet            cilium               Desired: 2, Ready: 2/2, Available: 2/2
Deployment           cilium-operator      Desired: 2, Ready: 2/2, Available: 2/2
Containers:          cilium-operator      Running: 2
                     cilium               Running: 2
Image versions       cilium               quay.io/cilium/cilium:v1.9.5: 2
                     cilium-operator      quay.io/cilium/operator-generic:v1.9.5: 2
```

A successful deployment shows components (DaemonSet, Deployment, containers) with matching Desired/Ready/Available counts.

## Preview resources with a dry run

If you want to review the exact Kubernetes manifests that will be applied without changing the cluster, use a dry run. This is useful for auditing and validating Helm values before applying them.

```bash theme={null}
cilium install --dry-run
```

This prints the rendered YAML to stdout so you can inspect it, pipe to a file, or run `kubectl apply -f -` later when ready.

## Common CLI commands

| Command                    | Purpose                                         | Notes                             |
| -------------------------- | ----------------------------------------------- | --------------------------------- |
| `cilium install`           | Install Cilium using current kubeconfig context | Uses Helm under the hood          |
| `cilium install --dry-run` | Render manifests without applying               | Good for validation/auditing      |
| `cilium status --wait`     | Wait until Cilium components are ready          | Blocks until readiness conditions |
| `cilium uninstall`         | Remove Cilium resources from cluster            | Use with caution in production    |

## Configuring Cilium at install time

The Cilium CLI uses the Cilium Helm chart to render manifests. You can customize installation by supplying Helm values either inline via `--helm-set` or from a values file via `--values`.

Examples:

```bash theme={null}
# Pass individual Helm values from the CLI
cilium install \
  --helm-set ipv6.enabled=true \
  --helm-set routingMode=native \
  --helm-set autoDirectNodeRoutes=true

# Or use a YAML values file
cilium install --values values.yaml
```

For a complete list of configuration keys, review the Helm chart's `values.yaml` in the Cilium GitHub repository or the chart documentation.

<Callout icon="lightbulb" color="#1CB2FE">
  The available configuration keys come from the Cilium Helm chart. Use --dry-run to preview the final rendered manifest or check the chart's values.yaml to see all options.
</Callout>

## Sample values.yaml

Below is an example `values.yaml` that enables IPv6 and configures dual-stack IPAM using a cluster pool. Adjust CIDRs and other options to match your network design and cluster requirements.

```yaml theme={null}
# Enable IPv6 support
ipv6:
  enabled: true

# Enable dual-stack mode (optional, if using both IPv4 and IPv6)
ipam:
  mode: "cluster-pool"
  operator:
    clusterPoolIPv6PodCIDRList:
      - "fd00::/104" # Adjust based on your network setup

# Use native routing mode (recommended for better performance)
routingMode: "native"

# eBPF/networking-related settings
bpf:
  masquerade: true
  tproxy: true
```

## Best practices and references

* Always validate rendered manifests using `cilium install --dry-run` before applying to production.
* Use the table above to quickly reference common cilium CLI commands.
* Consult the official documentation and Helm chart values:
  * Cilium Documentation: [https://cilium.io/docs/](https://cilium.io/docs/)
  * Cilium Helm chart / values: [https://github.com/cilium/cilium/tree/main/install/kubernetes/cilium](https://github.com/cilium/cilium/tree/main/install/kubernetes/cilium)
  * Cilium CLI releases: [https://github.com/cilium/cilium-cli/releases](https://github.com/cilium/cilium-cli/releases)

With these steps you can install and configure Cilium using the CLI, preview resources before applying changes, and supply Helm values either inline or via a values file.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/cilium-certified-associate-cca/module/2fded455-95ea-4183-8cce-f17de214691f/lesson/474fe5d0-25a0-4214-b89c-325d50c0e22e" />
</CardGroup>
