Cloud Native 10 min read

Using containerd with ctr, nerdctl, and crictl: A Practical Guide

This article explains how containerd works as a high‑level container runtime and demonstrates practical usage of its three command‑line clients—ctr, nerdctl, and crictl—for pulling images, managing containers, debugging Kubernetes pods, and performing low‑level runtime operations.

Top Architect
Top Architect
Top Architect
Using containerd with ctr, nerdctl, and crictl: A Practical Guide

containerd is a high‑level container runtime that manages the full lifecycle of containers on a single host, including creation, start, stop, image pulling, storage, mounts, and networking.

ctr is the native CLI bundled with containerd. It can pull and list images, import Docker images, mount images, run containers, list containers, attach to tasks, execute commands inside containers, and remove containers. Example commands:

$ ctr images pull docker.io/library/nginx:1.21
$ ctr images ls
$ ctr run --rm -t docker.io/library/debian:latest cont1
$ ctr container ls
$ ctr task attach nginx_1
$ ctr task rm -f nginx_1
$ ctr container rm nginx_1

nerdctl is a newer, Docker‑compatible CLI for containerd. It supports image building, container network management, and Docker‑style compose workflows, providing a familiar experience for Docker users while leveraging containerd under the hood.

crictl is the CRI‑compatible CLI used to debug Kubernetes nodes. Since containerd includes a built‑in CRI plugin, crictl can manage containers and pods directly. Common commands include pulling images, running pods, executing commands, fetching logs, and gathering statistics.

$ crictl pull docker.io/library/nginx:latest
$ crictl runp pod.yaml
$ crictl exec -it
/bin/bash
$ crictl logs nginx_1
$ crictl stats

All three tools give developers low‑level access to containerd’s capabilities, useful for testing, debugging, and learning the internals of container runtimes.

cloud nativectrcontainerdcrictlcontainer runtimenerdctl
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.