English
Helm Binary Installation Guide on Linux | Compatible with Ubuntu and CentOS

Preface: Why choose binary installation?
There are multiple ways to install Helm in a Linux environment, but Binary installation is the most direct and controllable method, especially suitable for the following scenarios:
Offline environment: Intranet server that cannot access the package manager
Version locking: Need precise control over the Helm version to avoid automatic upgrades by the package manager
CI/CD pipeline: Requires quick, non-interactive installation in automated scripts
Go developer: Accustomed to manually managing the toolchain, with a strong need for version control
This article will take you through Ubuntu and CentOS Complete the full installation and configuration of Helm via binary on two mainstream Linux distributions.
Part 1: Environment Preparation
System Requirements
| Project | Requirement |
|---|---|
| operating system | Ubuntu 18.04+ or CentOS 7+ |
| Architecture | x86_64 (amd64) or ARM64 |
| Kubernetes | 1.16+ (required by Helm v3) |
| Permissions | sudo permissions or root user |
| Network | able to access https://get.helm.sh(Download in advance for offline environments) |
Confirm system information
bash
# Check the operating system version.
cat /etc/os-release
# Ubuntu Example output: NAME="Ubuntu", VERSION="22.04.3 LTS"
# CentOS example output: NAME="CentOS Linux", VERSION="7 (Core)"
# 查看系统架构
uname -m
# Output: x86_64 or aarch64Part 2: Download the Helm Binary
Method 1: Download using curl (recommended)
bash
# 定义 Helm 版本(建议使用最新稳定版)
HELM_VERSION="v3.14.0"
# Select the download link according to the architecture (using amd64 as an example)
curl -sLO "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
# If the ARM64 architecture is required, replace it with:
# curl -sLO "https://get.helm.sh/helm-${HELM_VERSION}-linux-arm64.tar.gz"Method 2: Download using wget
bash
# Ubuntu or CentOS can both be used.
wget "https://get.helm.sh/helm-v3.14.0-linux-amd64.tar.gz"Method 3: Offline Installation (Intranet Environment)
- Download the compressed package on a machine with network access:
bash
curl -sLO "https://get.helm.sh/helm-v3.14.0-linux-amd64.tar.gz"- Copy the compressed package to the target server:
bash
scp helm-v3.14.0-linux-amd64.tar.gz user@target-server:/tmp/Part 3: Decompression and Installation
1. Extract the archive
bash
# Extract to the current directory
tar -zxvf helm-v3.14.0-linux-amd64.tar.gz
# Directory structure after extraction:
# linux-amd64/
# └── helm2. Install the binary files
Recommended location:/usr/local/bin/helm(Standard path for user-level programs)
bash
# Move the binary to the system path
sudo mv linux-amd64/helm /usr/local/bin/helm
# Verify installation
helm version
# Expected output: version.BuildInfo{Version:"v3.14.0", ...}Alternative location:/usr/bin/helm(system-level path)
bash
# Ubuntu/CentOS Universal
sudo mv linux-amd64/helm /usr/bin/helm3. Clean up temporary files
bash
# Delete the extracted directory and the archive.
rm -rf linux-amd64/ helm-v3.14.0-linux-amd64.tar.gzPart 4: Configure Environment Variables (Optional)
If helm The command is not recognized. You need to add the installation path to PATH Middle.
Check whether PATH contains the installation path
bash
echo $PATH
# Confirm whether it contains /usr/local/binPermanent configuration (recommended)
Ubuntu(.bashrc):
bash
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
source ~/.bashrcCentOS(.bash_profile):
bash
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bash_profile
source ~/.bash_profileVerify PATH configuration
bash
which helm
# Output: /usr/local/bin/helmPart 5: Installation Verification and Initialization
1. Check Helm version
bash
helm version
# Complete output example:
# version.BuildInfo{Version:"v3.14.0", GitCommit:"...", GitTreeState:"clean", GoVersion:"go1.21.5"}
# View client version only
helm version --client2. Check the Kubernetes cluster connection
bash
# Confirm that kubectl is configured correctly
kubectl cluster-info
# Test the connectivity between Helm and the cluster
helm list -n default
# If the cluster is normal, an empty list or existing Releases will be displayed.3. Add the official Chart repository (recommended)
bash
# Add the Bitnami repository (the most commonly used public repository)
helm repo add bitnami https://charts.bitnami.com/bitnami
# Add the Stable repository (archived, but still has many Charts)
helm repo add stable https://charts.helm.sh/stable
# Update repository index
helm repo update
# Verify repository list
helm repo list
# Output example:
# NAME URL
# bitnami https://charts.bitnami.com/bitnami
# stable https://charts.helm.sh/stable4. Enable Shell autocompletion (improve experience)
Bash:
bash
# Ubuntu/CentOS Universal
echo "source <(helm completion bash)" >> ~/.bashrc
source ~/.bashrcZsh(If installed):
bash
echo "source <(helm completion zsh)" >> ~/.zshrc
source ~/.zshrcPart 6: Quick Reference to Differences Between Ubuntu and CentOS
| Operation item | Ubuntu | CentOS | Description |
|---|---|---|---|
| Package manager | apt | yum / dnf | This article uses binary installation and does not rely on a package manager. |
| Default Shell | Bash | Bash | The environment variables are configured in the same way. |
| PATH configuration | ~/.bashrc | ~/.bash_profile | The configuration file names are different, but the logic is consistent. |
| curl/wget | Pre-installed curl | Preinstall wget | Both tools can be used. |
| sudo permissions | Need | Need | Installing to the system path requires elevated privileges. |
Part 7: Best Practices for Offline Environments — Using Helm to Download Chart Packages
In an enterprise production environment,Intranet isolation It is the norm. You may not be able to directly pass helm repo add and helm install Install Chart online, but The Helm binary itself supports downloading and exporting Charts., making it very suitable for offline distribution scenarios.
Scenario 1: Download the Chart package in a networked environment
On a machine with public internet access, use Helm to download the Chart as .tgz Archive:
bash
# 1. Add repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
# 2. Search for and download Chart (do not install)
helm pull bitnami/nginx --version 15.0.0
# 3. Verify download
ls -lh nginx-15.0.0.tgz
# Output:-rw-r--r-- 1 root root 28K Aug 21 10:00 nginx-15.0.0.tgz
# 4. Optional: Extract to view the Chart contents
tar -zxvf nginx-15.0.0.tgzScenario 2: Installing Chart in an intranet environment
The downloaded .tgz Copy the package to the intranet server and install it directly from the local package:
bash
# 1. Copy to the intranet server
scp nginx-15.0.0.tgz user@internal-server:/tmp/
# 2. Install on an intranet server (no internet connection required)
helm install my-nginx /tmp/nginx-15.0.0.tgz -n web
# 3. Or extract first and then install (convenient for modifying values)
tar -zxvf /tmp/nginx-15.0.0.tgz
helm install my-nginx ./nginx --set image.tag=1.25.3 -n webScenario 3: Download the Chart and all its dependencies (complete offline package)
If the Chart has sub-dependencies (e.g., Nginx depends on Redis), all dependencies need to be downloaded together:
bash
# 1. Download Chart and dependencies in a networked environment
helm pull bitnami/nginx --version 15.0.0 --untar
cd nginx/
# 2. Download all dependencies to the charts/ directory
helm dependency update .
# 3. Repackage as a complete .tgz (including all dependencies)
cd ..
helm package nginx/
# 4. Now nginx-15.0.0.tgz contains all sub-charts.Scenario 4: Using a Chart archive repository (internal private repository)
Enterprises usually have an internal Harbor or ChartMuseum as a private Chart repository, and can pull from the intranet repository:
bash
# 1. Add intranet repository
helm repo add internal http://harbor.internal.com/chartrepo/my-project
helm repo update
# 2. Search internal Chart
helm search repo internal/nginx
# 3. Direct installation (provided the internal repository is available)
helm install my-nginx internal/nginx --version 15.0.0 -n webScenario 5: Export all installed Releases as Chart packages
If you need to back up or migrate a Release that has already been deployed in the cluster:
bash
# 1. View installed Release
helm list -n web
# 2. Get the name and version of the Chart used by the Release
helm get metadata my-nginx -n web
# 3. Re-pull the corresponding version of the Chart from the repository
helm pull bitnami/nginx --version 15.0.0Flowchart for using Helm in an offline environment
Offline Installation vs Online Installation Comparison
| Comparison item | Online installation | Offline installation (intranet recommended) |
|---|---|---|
| Network requirements | Need to access the public Chart repository | Zero network dependency |
| version control | May change due to repository updates. | Fixed version, auditable |
| Redundant deployment | An internet connection is required each time. | Download once, use multiple times |
| CI/CD Integration | Depends on external network stability | Fast and stable intranet |
| Safety | External repository must be trusted | Auditable Chart content |
| 适用场景 | Development/Test Environment | Production environment |
Best practices: It is recommended to download commonly used Charts (such as Nginx, Redis, PostgreSQL, etc.) in advance and build a Enterprise-internal Chart archive repository, all production deployments are based on intranet archive packages, which are both secure and efficient.
Related Commands Quick Reference:
bash
# Download Chart (without relying on a Kubernetes cluster)
helm pull REPO/CHART --version VERSION
# Download and extract
helm pull REPO/CHART --version VERSION --untar
# Download the complete Chart including all dependencies
helm dependency update ./CHART_DIR
helm package ./CHART_DIR
# Install from a local .tgz file
helm install RELEASE_NAME CHART.tgz -n NAMESPACEPart 8: Common Issues and Troubleshooting
Q1:helm: command not found
Reason: The binary was not correctly installed to PATH.
Solution:
bash
# Check if the binary exists
ls -l /usr/local/bin/helm
# If it does not exist, move again
sudo mv linux-amd64/helm /usr/local/bin/helm
# Ensure PATH contains /usr/local/bin
export PATH=$PATH:/usr/local/binQ2:helm version Error Error: Kubernetes cluster unreachable
Reason: Kubeconfig is incorrectly configured or the cluster is not started.
Solution:
bash
# Check Kubeconfig
kubectl cluster-info
# If kubectl is not configured, set Kubeconfig
export KUBECONFIG=~/.kube/configQ3: Slow download speed or unable to download
Solution:
- Use a domestic mirror source (such as Alibaba Cloud):
bash
# Alibaba Cloud Helm mirror
curl -sLO "https://mirrors.aliyun.com/kubernetes/helm/helm-v3.14.0-linux-amd64.tar.gz"- Or use a proxy:
bash
export https_proxy=http://your-proxy:port
curl -sLO "https://get.helm.sh/helm-v3.14.0-linux-amd64.tar.gz"Q4: Version Selection Recommendations
| Scene | Recommended version | Description |
|---|---|---|
| Production environment | Latest stable version - 1 minor version | Stability first |
| Development testing | Latest stable version | Experience new features |
| K8s 1.16-1.20 | Helm v3.8.x | Compatible with legacy clusters |
Part Nine: One-Click Installation Script (Fully Automatic)
Save the following script as install-helm.sh, complete the entire installation with one click:
bash
#!/bin/bash
# install-helm.sh - One-click installation script for the Helm binary on Linux
# Compatible with Ubuntu and CentOS
set -e
# Color output
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo -e "${GREEN}>> Starting to install Helm...${NC}"
# 1. 定义版本
HELM_VERSION="v3.14.0"
HELM_DIST="helm-${HELM_VERSION}-linux-amd64.tar.gz"
HELM_URL="https://get.helm.sh/${HELM_DIST}"
# 2. Download
echo -e "${GREEN}>> Download Helm ${HELM_VERSION}...${NC}"
if command -v curl &> /dev/null; then
curl -sLO "${HELM_URL}"
elif command -v wget &> /dev/null; then
wget "${HELM_URL}"
else
echo -e "${RED}Error: curl or wget required${NC}"
exit 1
fi
# 3. Decompress
echo -e "${GREEN}>> Extracting files...${NC}"
tar -xzf "${HELM_DIST}"
# 4. Installation
echo -e "${GREEN}>> Installing to /usr/local/bin/helm...${NC}"
sudo mv linux-amd64/helm /usr/local/bin/helm
# 5. Cleanup
rm -rf "${HELM_DIST}" linux-amd64/
# 6. Verify
echo -e "${GREEN}>> Verifying installation...${NC}"
helm version
# 7. Add repository
echo -e "${GREEN}>> Add Bitnami repository...${NC}"
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
echo -e "${GREEN} Helm installation complete!${NC}"
echo -e "Run 'helm version' to verify the installation"Execute script:
bash
chmod +x install-helm.sh
./install-helm.shConclusion
Through this article, you have mastered the complete process of installing Helm via binary method on Ubuntu and CentOS. Although this method is manual, its advantage lies in Controllable, transparent, and consistent across distributions, especially suitable for Go technology stack developers and operations engineers with precise version requirements.
Next, you can continue reading.Helm from Beginner to Practical Use: Starting from an upgrade Command Learn Helm usage in depth.
Related resource recommendations:
Helm official release page—— Download all versions
This installation example uses Helm v3.14.0. It is recommended to visit the official Releases page to obtain the latest version number.