# Dozzle Log Viewer

> Real-time Docker container log viewer.

- Category: Monitoring & Observability
- Difficulty: beginner
- Components: dozzle
- Tags: dozzle, docker, logs, real-time
- Source: https://docker.recipes/monitoring/dozzle

## Overview

Dozzle is a lightweight, web-based Docker container log viewer created by Amir Raminfar that eliminates the need for complex logging infrastructure while providing real-time log monitoring capabilities. Unlike heavyweight solutions like ELK stack or Grafana Loki, Dozzle requires no database, no complex configuration, and consumes minimal system resources while delivering instant access to container logs through an intuitive web interface. This single-container deployment connects directly to the Docker daemon via the Docker socket, automatically discovering all running containers and streaming their logs in real-time with powerful search and filtering capabilities.

Dozzle excels in scenarios where you need immediate log visibility without the overhead of enterprise logging solutions. It provides instant gratification for developers debugging applications, system administrators monitoring services, and homelab enthusiasts tracking container behavior. The application's strength lies in its simplicity - within seconds of deployment, you have a fully functional log viewer that requires zero configuration to start monitoring all your containers.

This stack is perfect for small to medium Docker environments, development setups, and situations where you need quick log access without persistent storage requirements. Developers working with microservices, homelab enthusiasts running multiple services, and teams needing temporary log monitoring will find Dozzle's minimal resource footprint and instant deployment particularly valuable compared to heavier alternatives like Portainer's logging features or standalone log aggregation systems.

## Features

- Real-time log streaming with automatic container discovery via Docker socket
- Advanced regex-based filtering and full-text search across container logs
- Multi-container view with tabbed interface for monitoring multiple services simultaneously
- Built-in authentication support using DOZZLE_USERNAME and DOZZLE_PASSWORD environment variables
- Dark mode interface optimized for extended monitoring sessions
- Multi-host Docker daemon support for monitoring remote Docker instances
- Zero-dependency architecture requiring no database or external storage
- Live log statistics showing container status and log volume metrics

## Use cases

- Development debugging when troubleshooting application issues across multiple containers
- Homelab monitoring for enthusiasts running self-hosted services like Plex, Home Assistant, or Pi-hole
- Small business Docker environments where enterprise logging solutions are overkill
- Temporary log monitoring during deployment processes or maintenance windows
- Educational environments teaching Docker concepts where students need log visibility
- Remote server monitoring where SSH access is limited but web access is available
- Microservices development where developers need quick access to service logs without complex tooling

## Prerequisites

- Minimum 64MB RAM available for the Dozzle container (32MB minimum, 128MB recommended for heavy log volumes)
- Docker daemon running with accessible Docker socket at /var/run/docker.sock
- Port 8080 available on the host system (or alternative port for custom configuration)
- Read access to Docker socket for container discovery and log streaming
- Web browser with JavaScript enabled for the real-time streaming interface
- Understanding that Dozzle shows only live logs, not historical logs from before container startup

## docker-compose.yml

```yaml
services:
  dozzle:
    image: amir20/dozzle:latest
    container_name: dozzle
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - "8080:8080"
```

## .env

```bash
# No environment variables required
```

## Usage notes

- Docs: https://dozzle.dev/
- Dashboard at http://localhost:8080 - shows all containers automatically
- Real-time log streaming with search and filters
- Add auth: DOZZLE_USERNAME and DOZZLE_PASSWORD env vars
- Multi-host support: connect to remote Docker daemons
- Lightweight single binary - no database required

## Troubleshooting

- "Permission denied" accessing Docker socket: Ensure the Dozzle container has read access to /var/run/docker.sock and check file permissions
- No containers visible in Dozzle interface: Verify Docker socket is properly mounted and containers are actually running with active logs
- High memory usage with many containers: Limit monitored containers using DOZZLE_FILTER environment variable to reduce resource consumption
- Authentication not working: Ensure both DOZZLE_USERNAME and DOZZLE_PASSWORD environment variables are set correctly in the compose file
- Logs not updating in real-time: Check browser JavaScript console for connection errors and verify WebSocket connectivity to port 8080
- Cannot access Dozzle web interface: Confirm port 8080 is not blocked by firewall and the container is running with docker logs dozzle command

