Install Dozzle, a Simple Log File Viewer for Docker

Docker is my go-to container deployment tool. I’ve always found it exponentially easier to use than, say, the likes of Kubernetes. Of course, Docker isn’t suited for every deployment. However, when Docker is apropos, it cannot be beaten for simplicity, reliability, and stability. And then you throw in Docker Swarm and you can scale to meet needs.
But one thing that can still be rather challenging, even with the likes of Docker, is troubleshooting. With container deployments (especially full-stack applications), there are a lot of moving parts to go wrong, and, when something does go wrong, figuring out the culprit can be a real pain in the keister.
One of the best tools you have at your disposal for troubleshooting Docker containers is log files. By using log files you’ll gain insight into your deployments that is absolutely invaluable to keeping those containers running reliably and efficiently.
But how do you view Docker container logs? If you’re familiar with the Docker command line, it’s not all that challenging. For example, say you have a container deployed named mymongo (a MongoDB container) and you’re having trouble with the container. You could view the logs with the command:
1 |
docker logs mymongo |
You could get more details with:
1 |
docker logs --details mymongo |
You could also follow the logs, which will keep outputting new information as events occur within the container. For that, the command is:
1 |
docker logs --follow mymongo |
You could even view log entries before a specific timestamp, such as:
1 |
docker logs --until=2h mymongo |
The above output will only list events that happened until 2 hours ago.
Depending on the complexity of the container, you might see a massive amount of output to comb through. And you might have a lot of containers for which you need to view logs. What happens if you have 20+ containers running on a server? Do you remember all the names of those containers? If not, you’ll have to first locate the name of the container with the command:
1 |
docker ps -a |
With the name of the container in hand, you can then view its logs.
That’s far from efficient and, given the fact that you’re working with containers, efficiency is the name of the game. That’s why there are tools like Dozzle, which offer a web-based UI for the viewing of Docker container logs. Trust me when I say a tool like Dozzle will go a long way to help ease your Docker container management.
Let’s see how to get Dozzle deployed and see how easy it makes viewing Docker container logs.
Installing Docker Community Edition
You probably already have Docker up and running (otherwise, why would you bother reading this)? On the off-chance you don’t, let me show you how you can install the Community Edition of Docker on Ubuntu Server 22.04.
The first thing to do is add the official Docker GPG key with:
1 |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
Next, we’ll add the official Docker repository with the command:
1 2 |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \n https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
Install the required dependencies:
1 |
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y |
Update apt with the command:
1 |
sudo apt-get update |
Install Docker Community Edition with:
1 |
sudo apt-get install docker-ce docker-ce-cli containerd.io -y |
Make sure your user is a member of the docker group with the command:
1 |
sudo usermod -aG docker $USER |
Finally, log out and log back in so the changes take effect.
How to Deploy Dozzle
Right-o. Now it’s time to deploy our web-based log viewer. For that, issue the command:
1 |
docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest |
It shouldn’t take much time at all for the container to deploy. You can verify the deployment with the command:
1 |
docker ps -a |
You should see something like this:
1 |
e2e6b75c7af7 amir20/dozzle:latest "/dozzle" 29 minutes ago Up 29 minutes 0.0.0.0:8888->8080/tcp, :::8888->8080/tcp dozzle |
With the container deployed, open a web browser and point it to http://IP:8888 (where IP is the IP address of the hosting server). You should see a simple interface that lists all of the containers you have running (Figure 1).

Figure 1: The Dozzle web-based interface is clean and simple to use.
Click on any one of those running containers to view the log file (Figure 2).

Figure 2: Dozzle showing the logs for the mymongo container.
One very nice feature of Dozzle is the ability to download your log files for a container. To do that, click the three-dot menu at the top right corner of an open log file and select Download. This will download the file (with the extension .gz) to your local storage. You can then view the file with any text editor.
And that’s all there is to deploying the Dozzle web-based Docker container log viewer. If you have a significant number of containers to troubleshoot, this might well be one of the most efficient and convenient ways of doing so.