Install Dozzle Real-Time Log Viewer for Docker Containers on Ubuntu

|
Last Updated:
|
|

This tutorial will take you through how to install Dozzle real-time log viewer for docker containers on Ubuntu. Dozzle 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.

Install Dozzle Real-Time Log Viewer for Docker Containers on Ubuntu

Some of the features that Dozzle provides include;

  • Intelligent fuzzy search for container names
  • Search logs using regex
  • Small memory footprint
  • Split screen for viewing multiple logs
  • Download logs easy
  • Live stats with memory and CPU usage
  • Authentication with username and password 

Install Dozzle On Ubuntu

Dozzle is a docker based application. This means that, you need to already be having docker installed.

You can refer to these tutorials on how to install Docker and Docker compose on Ubuntu;

Install Docker CE on Ubuntu

Once you have Docker installed, then proceed to install Dozzle on Ubuntu using the command below;

docker run --name dozzle -d \
--volume=/var/run/docker.sock:/var/run/docker.sock \
-p 8888:8080 amir20/dozzle:latest

The command will download the latest version of Dozzle docker image and create a container called dozzle using the same image.

You can enable container restart in case of any issue;

docker run --name dozzle -d \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--restart always \
-p 8888:8080 amir20/dozzle:latest

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.

For example, in the command above, we will access Dozzle docker container via the port 8888 on the host system.

Check the status of Dozzle;

docker ps --format '{{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}' | grep -i dozzle
9c48c6d58f6e	amir20/dozzle:latest	Up 4 minutes	0.0.0.0:8888->8080/tcp, :::8888->8080/tcp	dozzle

Dozzle is now up and running.

Confirm the ports are listening;

ss -altnp
State           Recv-Q          Send-Q                   Local Address:Port                   Peer Address:Port         Process                                             
LISTEN          0               4096                           0.0.0.0:80                          0.0.0.0:*             users:(("docker-proxy",pid=18718,fd=4))            
LISTEN          0               4096                     127.0.0.53%lo:53                          0.0.0.0:*             users:(("systemd-resolve",pid=650,fd=14))          
LISTEN          0               128                            0.0.0.0:22                          0.0.0.0:*             users:(("sshd",pid=719,fd=3))                      
LISTEN          0               4096                           0.0.0.0:8888                        0.0.0.0:*             users:(("docker-proxy",pid=19085,fd=4))            
LISTEN          0               4096                              [::]:80                             [::]:*             users:(("docker-proxy",pid=18724,fd=4))            
LISTEN          0               128                               [::]:22                             [::]:*             users:(("sshd",pid=719,fd=4))                      
LISTEN          0               4096                              [::]:8888                           [::]:*             users:(("docker-proxy",pid=19091,fd=4))

Open the Dozzle port on Firewall if any is running;

If using UFW;

ufw allow 8888/tcp

if using iptables;

iptables -I INPUT -p tcp --dport 8888 -j ACCEPT

Access Dozzle Web User Interface

You can access Dozzle Web user interface using the address http://<server-Ip-or-domain>:8888

Default dashboard;

Install Dozzle Real-Time Log Viewer for Docker Containers on Ubuntu

To view live logs of each container, click the respective container name on the left panel or on the container list on the dashboard;

Sample container logs;

Install Dozzle Real-Time Log Viewer for Docker Containers on Ubuntu

You can search through the logs by pressing ctrl+f.

search logs dozzle

And there you go.

Read more on Dozzle page.

Other Tutorials;

Setup Portainer with SSL Certificates

Install Apache Guacamole as Docker Container on Ubuntu

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

Leave a Comment