Skip to Content

Setup K3s on Ubuntu

Learn how to set up K3s on Ubuntu for lightweight Kubernetes deployment.

karchunt

Kar Chun Tan

Creator

Metadata

Fri Mar 28 2025

1 min read

68 words

Steps to set up K3s on Ubuntu

  1. Install k3s as a service

    curl -sfL https://get.k3s.io | sh -
  2. Fix k3s permission denied issues

    mkdir ~/.kube 2> /dev/null export KUBECONFIG=~/.kube/config sudo k3s kubectl config view --raw > "$KUBECONFIG" chmod 600 "$KUBECONFIG"
    • More details  in fixing k3s permission denied issues.
  3. export KUBECONFIG=~/.kube/config to either ~/.profile or ~/.bashrc to make it persist on reboot(Optional).

    nano ~/.bashrc source ~/.bashrc

    Navigate to the last line

    ~/.bashrc
    # last line export KUBECONFIG=~/.kube/config
  4. Test connection

    kubectl get all
Last updated on