{"id":13718,"date":"2022-08-23T23:53:11","date_gmt":"2022-08-23T20:53:11","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13718"},"modified":"2024-03-09T20:58:57","modified_gmt":"2024-03-09T17:58:57","slug":"install-dozzle-real-time-log-viewer-for-docker-containers-on-ubuntu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-dozzle-real-time-log-viewer-for-docker-containers-on-ubuntu\/","title":{"rendered":"Install Dozzle\u00a0Real-Time Log Viewer for\u00a0Docker Containers on Ubuntu"},"content":{"rendered":"\n
This tutorial will take you through how to install Dozzle real-time log viewer for docker containers on Ubuntu. Dozzle<\/a> is a simple docker based application that has been created to enable you to viewer docker containers logs in real-time. Note that, Dozzle doesn’t store any logs.<\/p>\n\n\n\n Some of the features that Dozzle provides include;<\/p>\n\n\n\n Dozzle is a docker based application. This means that, you need to already be having docker installed.<\/p>\n\n\n\n You can refer to these tutorials on how to install Docker and Docker compose on Ubuntu;<\/p>\n\n\n\n Install Docker CE on Ubuntu<\/a><\/p>\n\n\n\n Once you have Docker installed, then proceed to install Dozzle on Ubuntu using the command below;<\/p>\n\n\n\n The command will download the latest version of Dozzle docker image and create a container called dozzle using the same image.<\/p>\n\n\n\n You can enable container restart in case of any issue;<\/p>\n\n\n\n Dozzle docker container listens on port 8080 by default. To be able to access the Dozzle web interface, you can expose this port, 8080 to any free port on your host system.<\/p>\n\n\n\n For example, in the command above, we will access Dozzle docker container via the port 8888 on the host system.<\/p>\n\n\n\n Check the status of Dozzle;<\/p>\n\n\n\n Dozzle is now up and running.<\/p>\n\n\n\n Confirm the ports are listening;<\/p>\n\n\n\n Open the Dozzle port on Firewall if any is running;<\/p>\n\n\n\n If using UFW;<\/p>\n\n\n\n if using iptables;<\/p>\n\n\n\n You can access Dozzle Web user interface using the address http:\/\/<server-Ip-or-domain>:8888<\/p>\n\n\n\n Default dashboard;<\/p>\n\n\n\n To view live logs of each container, click the respective container name on the left panel or on the container list on the dashboard;<\/p>\n\n\n\n Sample container logs;<\/p>\n\n\n\nInstall Dozzle Real-Time Log Viewer for Docker Containers on Ubuntu<\/h2>\n\n\n\n
\n
Install Dozzle On Ubuntu<\/h3>\n\n\n\n
docker run --name dozzle -d \\\n--volume=\/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n-p 8888:8080 amir20\/dozzle:latest<\/code><\/pre>\n\n\n\n
docker run --name dozzle -d \\\n--volume=\/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n--restart always \\\n-p 8888:8080 amir20\/dozzle:latest<\/code><\/pre>\n\n\n\n
docker ps --format '{{.ID}}\\t{{.Image}}\\t{{.Status}}\\t{{.Ports}}\\t{{.Names}}' | grep -i dozzle<\/code><\/pre>\n\n\n\n
9c48c6d58f6e\tamir20\/dozzle:latest\tUp 4 minutes\t0.0.0.0:8888->8080\/tcp, :::8888->8080\/tcp\tdozzle<\/code><\/pre>\n\n\n\n
ss -altnp<\/code><\/pre>\n\n\n\n
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process \nLISTEN 0 4096 0.0.0.0:80 0.0.0.0:* users:((\"docker-proxy\",pid=18718,fd=4)) \nLISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:((\"systemd-resolve\",pid=650,fd=14)) \nLISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:((\"sshd\",pid=719,fd=3)) \nLISTEN 0 4096 0.0.0.0:8888 0.0.0.0:* users:((\"docker-proxy\",pid=19085,fd=4)) \nLISTEN 0 4096 [::]:80 [::]:* users:((\"docker-proxy\",pid=18724,fd=4)) \nLISTEN 0 128 [::]:22 [::]:* users:((\"sshd\",pid=719,fd=4)) \nLISTEN 0 4096 [::]:8888 [::]:* users:((\"docker-proxy\",pid=19091,fd=4))\n<\/code><\/pre>\n\n\n\n
ufw allow 8888\/tcp<\/code><\/pre>\n\n\n\n
iptables -I INPUT -p tcp --dport 8888 -j ACCEPT<\/code><\/pre>\n\n\n\n
Access Dozzle Web User Interface<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n