This post shows you how to install containerd as the container runtime for Kubernetes and configure it to use the systemd cgroup driver. The commands below were tested on Ubuntu Server 24.04 with containerd 2.2.1 from the Ubuntu updates repository. The exact Ubuntu package revision can change as updates are published. See the Kubernetes container runtime documentation for more about runtime requirements.
Prepare the host
Kubernetes expects swap to be disabled by default. Turn it off now and comment out any swap entries in /etc/fstab so it stays off after a reboot.