Skip to content
Using containerd with ctr, nerdctl, and crictl: A Practical Guide
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

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 <container-id> /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.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cloud-nativeCTRContainerdcrictlcontainer-runtimenerdctl
Reader feedback

How this landed with the community

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.