Containerd Service Keeps Crashing – Fix It Fast
Containerd crashes right after start. We'll try the easy stuff first – config check, then logs, then reinstall.
Containerd Service Crash – The 30-Second Fix
Before you dig into logs or reinstall, try this. It fixes maybe 1 in 4 crashes I've seen.
- Check if containerd is actually running – not just crashed once. Run
systemctl status containerd. Look forActive: failedorActive: inactive (dead). If it saysrunning, your problem is different – maybe the container runtime itself is fine and something else is wrong. - Restart the service – sounds dumb, but sometimes a one-time glitch goes away. Run
sudo systemctl restart containerd. Wait 5 seconds. Runsystemctl status containerdagain. - If it crashes again within 10 seconds, you've got a persistent problem. Don't keep restarting – you'll just fill the logs.
After the restart, if it stays green, you're done. If not, move to the moderate fix.
Moderate Fix – Check Config and Logs (5 minutes)
Most containerd crashes I've fixed come down to a broken config or a missing dependency. Here's the real cause 90% of the time.
Check the config file
Containerd reads /etc/containerd/config.toml by default. If this file has a typo, a wrong path, or uses a plugin that doesn't exist, the service crashes immediately with status=2/INVALIDARGUMENT.
- Open the config:
sudo nano /etc/containerd/config.toml - Look for
version = 2at the top. If it's missing or saysversion = 1, that can cause crashes on newer containerd versions (1.6+). Change it toversion = 2. - Check the
[plugins]section. Specifically[plugins."io.containerd.grpc.v1.cri"]. If you see something likesandbox_image = "k8s.gcr.io/pause:3.6", that's fine. But if the image path is wrong (like a typo), containerd will crash trying to pull it. Change it tosandbox_image = "registry.k8s.io/pause:3.9"– that's the current correct one. - Save the file (
Ctrl+O,Enter,Ctrl+X). - Restart containerd:
sudo systemctl restart containerd - Check status again:
systemctl status containerd
If it still fails, run sudo journalctl -u containerd --no-pager | tail -50. Look for lines that say error or failed. A common one is runc not found – that means runc isn't installed or the path is wrong. Install it with sudo apt install runc (Debian/Ubuntu) or sudo yum install runc (RHEL/CentOS). Then restart containerd.
Another common log line: failed to load cni plugin. That means your CNI config is bad or missing. Check /etc/cni/net.d/ – if there's a broken conf file, remove it and restart.
Advanced Fix – Reinstall Containerd and Reset Everything (15+ minutes)
If the config checks out and logs show something like failed to start daemon: error while initializing: no IO runc binary or failed to create shim task: OCI runtime create failed, you might have a corrupted installation or a version mismatch with Docker.
Remove and reinstall containerd completely
- Stop containerd:
sudo systemctl stop containerd - Remove the package:
- Debian/Ubuntu:
sudo apt remove --purge containerd - RHEL/CentOS:
sudo yum remove containerd
- Debian/Ubuntu:
- Delete leftover config and data:
sudo rm -rf /etc/containerd /var/lib/containerd /run/containerd - Reinstall:
- Debian/Ubuntu:
sudo apt update && sudo apt install containerd - RHEL/CentOS:
sudo yum install containerd
- Debian/Ubuntu:
- Generate a default config:
sudo mkdir -p /etc/containerd && sudo containerd config default > /etc/containerd/config.toml - Restart and enable:
sudo systemctl enable --now containerd - Check status:
systemctl status containerd
If it still crashes after a clean install, you might have a kernel issue. Check dmesg | tail -20 for OOM kills or cgroup errors. Also check if systemd is the init system – run ps -p 1 -o comm=. If it's systemd, good. If it's init or something else, you might need to run containerd with --runtime=io.containerd.runc.v2 in the config.
One last thing – Docker users
If you installed Docker via docker-ce, it bundles its own containerd. The system containerd and Docker's containerd conflict. Run which containerd. If it shows /usr/bin/containerd and you have Docker installed, uninstall the standalone containerd: sudo apt remove containerd – Docker's version will take over. Then restart Docker: sudo systemctl restart docker.
That's usually the final fix. If none of this works, post your journalctl output in a forum – but 9 times out of 10, it's one of these.
Was this solution helpful?