ctop – Real time Docker container monitoring tool

Ctop is a free open source for monitoring container metrics in real-time. A command-line tool like top to get an overview of metrics concerning CPU, memory, network, I/O for multiple containers and also supports for the specific container.

ctop comes with built-in support for Docker and runC. Use this link https://github.com/bcicen/ctop/releases to see latest updates.

Install ctop in Linux Server

It is an easy way to download binary /usr/local/bin/ctop and make it executable to run it.

[[email protected] ~]# sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.1/ctop-0.7.1-linux-amd64 -O /usr/local/bin/ctop
[[email protected] ~]# sudo chmod +x /usr/local/bin/ctop

Install ctop via Docker using following command.

[[email protected] ~]# docker run --rm -ti --name=ctop -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest

Run ctop to monitor docker containers real-time metrics.

[[email protected] ~]# ctop
Docker Container Monitor

Docker Container Monitor

To check specific container, use the Up and Down arrow keys to highlight a container and click Enter to select it or select your container and press “o”. This will show “single view” and click on it to inspect the selected container.

ctop

ctop

For more information check with Ctop Github repository.

[[email protected] ~]# ctop --help
Usage of ctop:
-a show active containers only
-connector string
container connector to use (default "docker")
-f string
filter containers
-h display this help dialog
-i invert default colors
-r reverse container sort order
-s string
select container sort field
-scale-cpu
show cpu as % of system total
-v output version information and exit
[[email protected] ~]#

 

Keybindings

Key Action
<enter> Open container menu
a Toggle display of all (running and non-running) containers
f Filter displayed containers (esc to clear when open)
H Toggle ctop header
h Open help dialog
s Select container sort field
r Reverse container sort order
o Open single view
l View container logs (t to toggle timestamp when open)
S Save current configuration to file
q Quit ctop

 

 

Docker Graphical Management Tool Portainer

Open Source lightweight management UI tool Portainer for Docker hosts and Swarm clusters. Docker Graphical Management Tool Portainer can supercharger your development and be a relief for cli allergies. Portainer provides a detailed overview of Docker and allows you to manage containers, images, networks and volumes.

Docker Graphical Managing Tool

Docker Graphical Managing Tool Portainer

 

How to deploy Docker UI Tool on Linux

Create docker volume for portainer.io data

# docker volume create portainer_data
# docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Once deployed the container enable port 9000 on your firewall.

# firewall-cmd --add-port 9000/tcp --permanent
# firewall-cmd --add-port 9000/tcp

Access the port 9000 where portainer is running using your browser.

http://<host>:9000

Deploy Docker Graphical Tool using Docker-Compose

 

# vi docker-compose.yml

 

version: '2'

services:
portainer:
image: portainer/portainer
ports:
- "9000:9000"
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data

volumes:
portainer_data:

Save and exit.

# docker-compose up

Using Swarm Cluster

You can directly deploy Portainer as a service in your Docker cluster.

# docker volume create portainer_data
# docker service create \
--name portainer \
--publish 9000:9000 \
--replicas=1 \
--constraint 'node.role == manager' \
--mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock \
--mount type=volume,src=portainer_data,dst=/data \
portainer/portainer \
-H unix:///var/run/docker.sock