Fix Docker Stats Not Showing on Raspberry Pi (Memory & CPU Missing)

If you're running Docker on a Raspberry Pi and docker stats shows zero CPU or memory usage for your containers, you're not alone. This is a common issue on Raspberry Pi OS (especially Bookworm and later) and other ARM-based systems, where cgroup memory (and sometimes CPU) accounting is disabled by default. Monitoring tools like Beszel that depend on Docker's stats API will also fail to display container metrics as a result. So, let's see how to fix this

1. Check cgroup support

Run this command to inspect Docker's cgroup configuration:

sudo docker info | grep -i cgroup

Look for warnings like these, which indicate memory accounting is disabled:

WARNING: No memory limit support
WARNING: No swap limit support

2. Enable cgroup Memory Accounting

Edit the kernel command line parameters in the boot configuration file. For Raspberry Pi OS Bookworm (Debian 12) and later, use:

sudo nano /boot/firmware/cmdline.txt

Note for older versions (e.g., Bullseye): Use /boot/cmdline.txt instead.

Append the following parameters to the end of the existing single line (add a space before them if needed):

cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1

Save the file and exit.

⚠️
cmdline.txt must remain one continuous line, no line breaks! Extra spaces or newlines can cause boot issues.

3. Reboot the system

Apply the changes by rebooting:

sudo reboot

4. Verify Docker stats

Once rebooted, test the fix:

sudo docker stats

Now, you should see proper CPU and memory usage for all containers. If you are using Beszel for monitoring, Docker stats should now be visible and accurate there as well—no additional changes required for Beszel.

💡
Enabling cgroups has minimal overhead and is required for container monitoring.

You've successfully subscribed to Developer Insider
Great! Next, complete checkout for full access to Developer Insider
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.