The Install Script
A single curl command downloads k3s, installs it, and starts it as a system service.
curl -sfL https://get.k3s.io | sh -The fastest way to get k3s is the official install script hosted at get.k3s.io. It detects your OS and CPU architecture, installs the binary, and registers a systemd (or OpenRC) service so k3s starts on boot.
What the script does
- Downloads the correct k3s binary.
- Installs it to
/usr/local/bin/k3s. - Creates
kubectl,crictl, andctrsymlinks. - Writes and enables the
k3sservice. - Starts a single-node cluster immediately.
You can pass options to the script in two ways: environment variables prefixed with INSTALL_K3S_, or flags placed after sh -s - which go straight to k3s server.
Example
# Simplest install (single-node server)
curl -sfL https://get.k3s.io | sh -
# Pin a specific version and pass a server flag
curl -sfL https://get.k3s.io | \
INSTALL_K3S_VERSION=v1.30.5+k3s1 \
sh -s - --write-kubeconfig-mode 644
# Verify
sudo systemctl status k3s
kubectl get nodesWhen to use it
- A developer bootstraps a disposable test cluster on a fresh Ubuntu VM using a single curl command with no additional configuration.
- An ops team uses environment variables in the install command to pin a specific k3s version across all production servers.
- A systemd-based server automatically starts k3s after every reboot because the install script registers a systemd service by default.
More examples
Basic install with curl
Runs the official installer which downloads the binary, registers a systemd service, and starts k3s immediately.
curl -sfL https://get.k3s.io | sh -
systemctl status k3sPin a specific k3s version
Sets INSTALL_K3S_VERSION to lock the cluster to an exact release, ensuring reproducible environments.
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.3+k3s1 sh -
k3s --versionInstall without starting the service
Downloads and installs the k3s binary and scripts without activating the systemd service, useful for pre-provisioning.
curl -sfL https://get.k3s.io | \
INSTALL_K3S_SKIP_START=true \
INSTALL_K3S_SKIP_ENABLE=true \
sh -
ls /usr/local/bin/k3s
Discussion