utilities, docker, debian,

Top command not found on Debian-based Docker container

Jul 20, 2022 · 1 min read · Post a comment

Some of your Docker Debian-based containers can be killed due to heavy processes running inside the container. If your preferred choice is the top command, most likely you will get the following error: top: command not found. Let’s see how to install top inside the container.

Prerequisites

  • Debian
  • sudo privileges

Solution

Step 1. Get into a Docker container shell.

sudo docker exec -it <container-id> /bin/bash

Step 2. Update Debian packages.

sudo apt update

Step 3. Install procps command.

sudo apt install procps

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.