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.
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.