HeadlinesBriefing favicon HeadlinesBriefing.com

Install k3s on Debian: A Quick Guide

DEV Community •
×

Getting k3s running on Debian 11 or 12 is a streamlined process for developers needing a lightweight Kubernetes distribution. First, prepare your Debian system—whether it’s a VPS, VM, or bare metal server—by updating packages and installing essentials like `curl` and `gnupg`. A critical step is disabling swap, which Kubernetes requires for stability.

Maintained by Rancher, k3s is famous for its one-line installer. The recommended setup disables the default Traefik ingress controller and sets appropriate permissions for the kubeconfig file. Once the script finishes, you have a functional single-node cluster.

Verification is straightforward: check the service status and query nodes using `kubectl`. For a smoother workflow, configure `kubectl` locally to avoid prefixing every command with `sudo`. If you’re running a remote VPS, you’ll need to edit the configuration file to allow external access.

Scaling the cluster is just as simple, requiring a token from the server to join agent nodes. Clean uninstall scripts are provided for both server and agent roles, making this a flexible, low-overhead solution for container orchestration.