Why Nerdctl Exists and When You'd Actually Want It

Containerd Logo

If you're running K8s in production, you're already using containerd as the container runtime anyway. Docker Desktop just adds an extra layer on top of what you already have. Nerdctl lets you talk directly to containerd with commands that work exactly like Docker.

The Problem Nerdctl Solves

Docker's architecture is annoying as hell. Every docker run command goes through the Docker daemon (dockerd), which then talks to containerd, which actually runs your shit. That's two layers when you only need one. I've spent way too many hours debugging Docker daemon issues that turn out to be containerd problems in disguise.

Docker vs Containerd Architecture

In K8s clusters, containerd runs your pods directly. But if you want to debug a container or build an image on a K8s node, you're stuck with the low-level ctr command that nobody wants to learn. Nerdctl gives you Docker commands that work directly with containerd.

What Actually Works

The good news is most Docker commands work identically:

  • nerdctl run -it ubuntu bash - works exactly like Docker
  • nerdctl build -t myapp . - builds images with BuildKit
  • nerdctl compose up - runs your docker-compose files
  • nerdctl ps - lists containers

Your muscle memory from Docker just works. No need to learn new commands or change your scripts.

Gotchas You'll Hit

Setup is More Involved

Unlike Docker Desktop which "just works", nerdctl requires you to install and configure several components:

  • containerd daemon
  • CNI networking plugins
  • BuildKit for image builds
  • Various snapshotters for different features

The nerdctl-full tarball bundles most dependencies, but you'll still need to configure networking and systemd services. I spent 3 hours figuring this out the first time because the docs assume you already know containerd inside and out. Spoiler: nobody does.

On RHEL/CentOS 8, the default firewall rules block CNI networking. Ubuntu 22.04 works fine but 20.04 has SELinux issues with rootless mode.

CNI Networking Can Be a Pain

Docker handles networking automatically. With nerdctl, you need to understand CNI plugins. The default bridge network might not work the way you expect. Port publishing works differently. If you've never configured CNI plugins before, expect to spend time reading documentation that assumes you're already a networking expert. I wasn't, and it showed - spent an entire afternoon trying to get port forwarding to work properly.

BuildKit Integration is Finicky

Image building requires BuildKit daemon running separately from containerd. Sometimes BuildKit fails to start for no obvious reason. Sometimes it runs out of disk space in /tmp and fails silently. The error messages are complete garbage when this happens - you'll get cryptic bullshit like "failed to solve: rpc error: code = Unknown desc = failed to receive status" that tells you fuck-all about what actually broke. I've wasted entire afternoons on this exact error.

BuildKit version 0.11+ changed the default socket path from /run/buildkit/buildkitd.sock to something completely different, so if you upgrade containerd but not BuildKit (or vice versa), everything breaks with zero indication of what's wrong. Found this out the hard way during a system update.

Some Docker Features Don't Exist

  • No equivalent to Docker Desktop's GUI
  • Volume mounting syntax is slightly different
  • Some docker-compose features have edge cases
  • Third-party tools that expect Docker specifically won't work

Advanced Features That Are Actually Useful

Direct Kubernetes Access

This is the killer feature. On a K8s node, you can debug pods directly:

nerdctl --namespace k8s.io ps
nerdctl --namespace k8s.io exec -it pod-name bash

No need to set up kubectl or deal with registries for debugging. This alone justifies using nerdctl if you're debugging K8s issues regularly.

Lazy Pulling with Stargz

Large images start faster because nerdctl can pull layers on-demand. Works great for machine learning images that are 10GB+ but you only need the first few layers to start.

Image Encryption

Built-in support for encrypted container images. Actually useful for regulated environments where you need encryption at rest.

Current Version Status

Version 2.1.4 came out like a week ago. Still actively developed, which is good because containerd keeps changing shit and breaking backwards compatibility.

Nerdctl vs Docker vs Podman - What Actually Matters

Feature

Nerdctl

Docker

Podman

Container Runtime

containerd

containerd (via dockerd)

runc/crun

Daemon Required

Yes (containerd)

Yes (dockerd)

No

Root Privileges

Configurable

Daemon requires root

Rootless by default

Docker Compatibility

Drop-in replacement

Native

Drop-in replacement

Compose Support

nerdctl compose

docker-compose

podman-compose

Kubernetes Integration

✅ Native k8s.io namespace

❌ Requires registry

✅ Pod support

Image Encryption

✅ Built-in ocicrypt

❌ Third-party only

✅ Manual setup

Lazy Pulling

✅ Multiple snapshotters

❌ Not available

❌ Not available

P2P Distribution

✅ Optional IPFS

❌ Not available

❌ Not available

Image Signing

✅ Integrated cosign

❌ Manual setup

✅ Built-in support

Actually Installing and Using Nerdctl

Here's what actually happens when you try to install nerdctl and the problems you'll run into.

Nerdctl CLI

Installation Reality Check

Option 1: The \"Easy\" Binary Install

Download the nerdctl-full tarball because the minimal version is missing half the shit you need:

wget https://github.com/containerd/nerdctl/releases/download/v2.1.4/nerdctl-full-2.1.4-linux-amd64.tar.gz
sudo tar -xzf nerdctl-full-2.1.4-linux-amd64.tar.gz -C /usr/local

This gives you nerdctl binary plus CNI plugins, BuildKit, and other dependencies. But you still need to:

  1. Start containerd daemon (it doesn't auto-start like Docker)
  2. Configure systemd services properly
  3. Set up CNI networking (bridge networks won't work by default)
  4. Make sure BuildKit daemon starts for image builds

I learned this the hard way - the first time I tried running nerdctl run hello-world, it just hung for 5 minutes before timing out with "FATA[0300] failed to create container: context deadline exceeded" which told me fuck-all about what was actually broken.

Option 2: Package Managers

brew install nerdctl

This installs just the binary. You still need containerd running and configured. On macOS, you're better off using Lima which gives you a Linux VM with everything pre-configured.

Option 3: Use Someone Else's Setup

If you're on a K8s node, containerd is already running. Just install the nerdctl binary and you're mostly done. This is actually the easiest path.

First Commands That Work

These Docker commands work identically with nerdctl:

## Basic container operations
nerdctl run -d --name test nginx:alpine
nerdctl ps
nerdctl logs test  
nerdctl exec -it test sh
nerdctl stop test && nerdctl rm test

## Image management
nerdctl pull redis:alpine
nerdctl images
nerdctl rmi redis:alpine

Nerdctl Command Comparison

First Commands That Break

Networking Will Bite You

## This might not work the same as Docker
nerdctl run -p 8080:80 nginx

## Error: CNI plugin bridge not found
## Fix: Install CNI plugins and configure /etc/cni/net.d/

Docker handles bridge networking automatically. Nerdctl expects you to configure CNI plugins. The error messages are complete shit - you'll get "CNI plugin bridge not found" which doesn't tell you where to put the damn plugins or even what a CNI plugin is supposed to look like.

CNI Bridge Networking

Building Images Fails Silently

## This will hang or fail mysteriously  
nerdctl build -t myapp .

## Error: BuildKit daemon not running
## Fix: Start buildkitd daemon separately

Image builds need BuildKit daemon running. Sometimes it starts automatically, sometimes it doesn't. Check with systemctl status buildkit or look for a buildkitd process. I've wasted hours troubleshooting this when the fix was literally just sudo systemctl start buildkit. The daemon was dead and nerdctl just said "buildkit not found" instead of "hey dumbass, start the daemon."

Volume Mounts Are Different

## Docker way works differently
nerdctl run -v /host/path:/container/path nginx

## Might need different options or paths

Volume mounting syntax varies slightly. Check the containerd mount documentation if mounts aren't working.

Docker Compose Support

This actually works well:

nerdctl compose up -f docker-compose.yml

Your existing docker-compose files work without changes. This is one of nerdctl's best features.

Kubernetes Integration (The Useful Part)

Kubernetes Architecture

If you're on a K8s node, this is why you'd want nerdctl:

## Debug Kubernetes pods directly
nerdctl --namespace k8s.io ps
nerdctl --namespace k8s.io exec -it pod-12345-abcde /bin/bash

## Build images that K8s can use without a registry
nerdctl --namespace k8s.io build -t debug-app .
kubectl run debug --image=debug-app:latest

This bypasses kubectl and registries for debugging. Actually useful.

Advanced Features You Might Actually Use

Lazy Pulling for Large Images

## Use Stargz for on-demand layer pulling
nerdctl --snapshotter=stargz run tensorflow/tensorflow:latest

Starts containers before the full image downloads. Good for 5GB+ machine learning images.

Rootless Mode (Security)

## Install rootless setup
containerd-rootless-setuptool.sh install

## Run without root privileges
nerdctl run --rm hello-world

More secure than Docker's rootless mode, but setup is more involved. On Ubuntu 20.04, the rootless setup script breaks if you don't have the right kernel modules loaded.

Migration from Docker

  1. Keep Docker running while you test nerdctl
  2. Start with simple commands to verify basic functionality
  3. Test your docker-compose files with nerdctl compose
  4. Fix networking issues by configuring CNI properly
  5. Update scripts gradually once you're confident it works

Don't try to migrate everything at once. Test thoroughly with your actual workloads. I made the mistake of switching our CI pipeline to nerdctl without testing the BuildKit setup first - took down builds for half a day until I figured out the daemon wasn't starting properly because of a fucking systemd configuration issue.

Questions You'll Actually Ask About Nerdctl

Q

Why does my `nerdctl run` command hang?

A

Usually CNI networking isn't configured. Nerdctl needs bridge CNI plugins in /etc/cni/net.d/ and /opt/cni/bin/. Docker handles this automatically, nerdctl doesn't. You'll get "failed to find plugin bridge in path" or just a timeout with no explanation.Quick fix: Install CNI plugins and create a basic bridge config:bashsudo mkdir -p /etc/cni/net.d echo '{"cniVersion": "0.4.0", "name": "bridge", "type": "bridge", "bridge": "nerdctl0", "isGateway": true, "ipMasq": true, "ipam": {"type": "host-local", "ranges": [["10.22.0.0/16"]], "routes": [{"dst": "0.0.0.0/0"}]}}' | sudo tee /etc/cni/net.d/10-bridge.conflist

Q

Why does `nerdctl build` fail with "buildkit not found"?

A

BuildKit daemon isn't running. Unlike Docker which starts everything automatically, nerdctl needs you to start buildkitd separately:```bashsudo systemctl enable --now buildkit

or manually:

sudo buildkitd --addr unix:///run/buildkit/buildkitd.sock &
```

Q

Do I need to learn new commands?

A

No, muscle memory from Docker transfers directly:

  • docker runnerdctl run
  • docker psnerdctl ps
  • docker buildnerdctl build
  • docker-compose upnerdctl compose up
Q

Can I just replace "docker" with "nerdctl" in my scripts?

A

Mostly yes, but watch out for:

  • Port publishing syntax differences
  • Volume mount path handling
  • Network creation commands
  • Some docker-compose edge cases

Test your scripts thoroughly before switching production workloads. I learned this when our CI started failing at 2am because nerdctl handles volume mounts slightly differently than Docker.

Q

What problems will I actually hit with nerdctl?

A

The documentation assumes you already know containerd, which is complete bullshit if you're coming from Docker. Nobody learns containerd first. Common issues you'll definitely hit:

  • CNI networking configuration is a pain in the ass
  • BuildKit setup can fail silently and waste your entire morning
  • Rootless mode networking is finicky as fuck on some distros
  • Some third-party tools expect Docker socket specifically and just won't work
  • Error messages are less helpful than Docker's (which weren't great to begin with)
Q

Is it actually faster than Docker?

A

Depends on your workload. For simple containers, the difference is negligible. For Kubernetes environments where containerd is already running, nerdctl avoids the Docker daemon overhead.

Don't migrate just for performance - migrate if you need the Kubernetes integration or security features.

Q

Does nerdctl work on my Mac?

A

Not natively. Use Lima to run Linux VMs with nerdctl pre-configured. Docker Desktop is honestly easier for local development on mac

OS. I've tried the Lima setup

  • it works but adds another layer of complexity you probably don't need for local dev. Unless you really hate Docker Desktop licensing costs, just stick with Docker on Mac.
Q

Can I debug Kubernetes pods with nerdctl?

A

This is actually the killer feature. On K8s nodes:```bashnerdctl --namespace k8s.io ps
nerdctl --namespace k8s.io exec -it pod-name bash


Bypasses kubectl and gives you direct container access. Useful for debugging.
Q

Should I migrate from Docker?

A

Only if:

  • You're running Kubernetes in production (containerd is already there)
  • You need specific security features (image encryption, better rootless)
  • You want to avoid Docker licensing costs
  • You need the advanced snapshotter features

If Docker works fine for you, don't fix what isn't broken. Seriously. I've seen too many teams migrate "because it's newer" and then spend weeks dealing with subtle differences.

Q

What if something breaks?

A
  1. Check containerd logs: journalctl -u containerd
  2. Verify CNI config: ls /etc/cni/net.d/
  3. Check BuildKit: systemctl status buildkit
  4. Use nerdctl info for system diagnostics
  5. Ask on GitHub discussions

The community is helpful but smaller than Docker's.

Related Tools & Recommendations

tool
Similar content

Rancher Desktop: The Free Docker Desktop Alternative That Works

Discover why Rancher Desktop is a powerful, free alternative to Docker Desktop. Learn its features, installation process, and solutions for common issues on mac

Rancher Desktop
/tool/rancher-desktop/overview
100%
tool
Similar content

Jsonnet Overview: Stop Copy-Pasting YAML Like an Animal

Because managing 50 microservice configs by hand will make you lose your mind

Jsonnet
/tool/jsonnet/overview
69%
tool
Similar content

OpenCost: Kubernetes Cost Monitoring, Optimization & Setup Guide

When your AWS bill doubles overnight and nobody knows why

OpenCost
/tool/opencost/overview
67%
troubleshoot
Recommended

Docker Desktop Won't Install? Welcome to Hell

When the "simple" installer turns your weekend into a debugging nightmare

Docker Desktop
/troubleshoot/docker-cve-2025-9074/installation-startup-failures
66%
howto
Recommended

Complete Guide to Setting Up Microservices with Docker and Kubernetes (2025)

Split Your Monolith Into Services That Will Break in New and Exciting Ways

Docker
/howto/setup-microservices-docker-kubernetes/complete-setup-guide
66%
troubleshoot
Recommended

Fix Docker Daemon Connection Failures

When Docker decides to fuck you over at 2 AM

Docker Engine
/troubleshoot/docker-error-during-connect-daemon-not-running/daemon-connection-failures
66%
tool
Similar content

Kubernetes Operators: Custom Controllers for App Automation

Explore Kubernetes Operators, custom controllers that understand your application's needs. Learn what they are, why they're essential, and how to build your fir

Kubernetes Operator
/tool/kubernetes-operator/overview
62%
tool
Similar content

Prometheus Monitoring: Overview, Deployment & Troubleshooting Guide

Free monitoring that actually works (most of the time) and won't die when your network hiccups

Prometheus
/tool/prometheus/overview
58%
alternatives
Similar content

Escape Kubernetes Complexity: Simpler Container Orchestration

For teams tired of spending their weekends debugging YAML bullshit instead of shipping actual features

Kubernetes
/alternatives/kubernetes/escape-kubernetes-complexity
55%
tool
Similar content

Debug Kubernetes Issues: The 3AM Production Survival Guide

When your pods are crashing, services aren't accessible, and your pager won't stop buzzing - here's how to actually fix it

Kubernetes
/tool/kubernetes/debugging-kubernetes-issues
53%
troubleshoot
Similar content

Kubernetes Network Troubleshooting Guide: Fix Common Issues

When nothing can talk to anything else and you're getting paged at 2am on a Sunday because someone deployed a \

Kubernetes
/troubleshoot/kubernetes-networking/network-troubleshooting-guide
50%
tool
Similar content

TypeScript Compiler Performance: Fix Slow Builds & Optimize Speed

Practical performance fixes that actually work in production, not marketing bullshit

TypeScript Compiler
/tool/typescript/performance-optimization-guide
46%
howto
Similar content

Weaviate Production Deployment & Scaling: Avoid Common Pitfalls

So you've got Weaviate running in dev and now management wants it in production

Weaviate
/howto/weaviate-production-deployment-scaling/production-deployment-scaling
45%
tool
Similar content

Change Data Capture (CDC) Integration Patterns for Production

Set up CDC at three companies. Got paged at 2am during Black Friday when our setup died. Here's what keeps working.

Change Data Capture (CDC)
/tool/change-data-capture/integration-deployment-patterns
45%
tool
Recommended

containerd - The Container Runtime That Actually Just Works

The boring container runtime that Kubernetes uses instead of Docker (and you probably don't need to care about it)

containerd
/tool/containerd/overview
44%
tool
Similar content

OpenAI Platform API Guide: Setup, Authentication & Costs

Call GPT from your code, watch your bills explode

OpenAI Platform API
/tool/openai-platform-api/overview
43%
tool
Similar content

Poetry - Python Dependency Manager: Overview & Advanced Usage

Explore Poetry, the Python dependency manager. Understand its benefits over pip, learn advanced usage, and get answers to common FAQs about dependency managemen

Poetry
/tool/poetry/overview
43%
tool
Similar content

Binance Pro Mode: Unlock Advanced Trading & Features for Pros

Stop getting treated like a child - Pro Mode is where Binance actually shows you all their features, including the leverage that can make you rich or bankrupt y

Binance Pro
/tool/binance-pro/overview
41%
tool
Similar content

Google Cloud Developer Tools: SDKs, CLIs & Automation Guide

Google's collection of SDKs, CLIs, and automation tools that actually work together (most of the time).

Google Cloud Developer Tools
/tool/google-cloud-developer-tools/overview
40%
tool
Similar content

Open Policy Agent (OPA): Centralize Authorization & Policy Management

Stop hardcoding "if user.role == admin" across 47 microservices - ask OPA instead

/tool/open-policy-agent/overview
40%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization