Dozzle Log Viewer on Rocky Linux 9 (Docker + Nginx + SSL)

Dozzle is a lightweight, web-based log viewer for Docker containers. Instead of running docker logs -f on each container, Dozzle gives you a real-time, searchable dashboard where you can see logs from all containers in one place. It runs as a single container with no database, making it fast to deploy and easy to maintain — perfect for developers and sysadmins who want instant visibility into their workloads without the complexity of a full logging stack.

Rocky Linux 9 is a community-driven, RHEL-compatible enterprise distribution that focuses on stability, performance, and long-term support. With strong security updates and binary compatibility with Red Hat Enterprise Linux, Rocky Linux provides a reliable foundation for running production services like Dozzle.


Architecture Overview

LayerComponentRole
OSRocky Linux 9Enterprise-grade, RHEL-compatible base with long-term support
RuntimeDocker EngineRuns Dozzle in an isolated container
ApplicationDozzleReal-time web UI for container logs
Reverse ProxyNginx (optional)TLS termination, routing, HTTP/2, compression, authentication
TLSLet’s Encrypt / PKIProvides HTTPS for secure log access

Why Use Dozzle?

  • One-command setup – runs as a single Docker container.
  • Instant log visibility – stream logs across all containers in real time.
  • Low resource usage – extremely lightweight compared to ELK or Loki stacks.
  • Simple web UI – easy access to logs without SSH.
  • Flexible integration – use it standalone or alongside centralized logging systems.

Dozzle vs Other Logging Tools

Feature/CapabilityDozzleLoki + GrafanaELK/EFK StackDocker CLI
Setup complexityVery low (1 container)Medium (multi-service)High (Elasticsearch, Beats, Kibana)None
Log storageNo (stream only)Yes (time-series DB)Yes (Elasticsearch DB)No
UIBuilt-in web UIGrafana dashboardsKibana dashboardsNone (terminal)
Use caseQuick log viewingCentralized loggingEnterprise log analysisDebugging only

Dozzle shines when you need real-time logs without setup overhead, while ELK or Loki stacks are better suited for environments that require long-term log retention and advanced analytics.


Security & Best Practices

  • Place Dozzle behind Nginx with SSL for secure external access.
  • Add basic authentication or SSO/OAuth for user access control.
  • Limit exposure with firewall rules and SELinux/AppArmor.
  • Regularly update Dozzle (amir20/dozzle:latest) to patch vulnerabilities.
  • Use alongside monitoring tools (Prometheus, Grafana) for full observability.

Typical Use Cases

  • Development environments for quick container debugging.
  • Staging or test servers where a lightweight solution is enough.
  • Small to medium production setups that don’t need centralized log retention.
  • Complementing heavy stacks (ELK/Loki) with fast, live log streaming.

1. Create a Shape.Host VPS Instance

Go to https://shape.host and log in.

Click “Create” → “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Select the server location closest to your users.

Shape.host instance form with the data center location selector highlighted.

Choose Rocky Linux 9 (64-bit) as the OS.

Pick a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Shape.host instance form with the operating system image selector highlighted.

Click “Create Instance”.

Shape.host instance form with the Create Instance button highlighted.

Copy the IP address from the Resources section.

Shape.host Resources dashboard with the server IP address highlighted.

2. Connect to Your VPS

On Linux/macOS

ssh root@your-server-ip

On Windows

  • If using PowerShell on Windows 10/11: ssh root@your-server-ip
  • On older Windows, download PuTTY, enter your server IP, and log in as root.

3. Update the System and Install Required Tools

dnf update

Updates all system packages.

Terminal showing DNF/YUM package management commands and output.
dnf install yum-utils device-mapper-persistent-data lvm2 curl wget

Installs repository management utilities and basic tools.

Terminal showing DNF/YUM package management commands and output.

4. Install Docker and Docker Compose

Add the official Docker repository:

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker CE and plugins:

dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Terminal showing DNF/YUM package management commands and output.

Enable and start Docker:

systemctl enable --now docker

Check versions:

docker --version
docker compose version
Terminal showing systemd service management commands or output.

5. Deploy Dozzle with Docker Compose

Create directory:

mkdir -p /opt/dozzle
cd /opt/dozzle

Create the docker-compose.yml file:

cat > /opt/dozzle/docker-compose.yml <<'YML'
services:
  dozzle:
    image: amir20/dozzle:latest
    container_name: dozzle
    ports:
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
      interval: 15s
      timeout: 3s
      retries: 5
    restart: unless-stopped
YML
Terminal showing file and directory setup commands.

Remove any old Dozzle container if it exists:

docker rm -f dozzle 2>/dev/null || true

Start Dozzle:

docker compose up -d

Check running containers:

docker compose ps
Terminal showing container image download progress.

View logs:

docker logs dozzle --tail=50

Test health endpoint:

curl -s http://127.0.0.1:8080/health
Terminal showing hostname configuration or system identification details.

6. Configure Nginx as Reverse Proxy

Install Nginx:

dnf install nginx
Terminal showing DNF/YUM package management commands and output.

Enable and start Nginx:

systemctl enable --now nginx

Create configuration file:

cat > /etc/nginx/conf.d/dozzle.conf <<'NGINX'
server {
    listen 80;
    server_name your-domain.com;

    # Optional Basic Auth (see 4.4)
    # auth_basic "Restricted";
    # auth_basic_user_file /etc/nginx/.htpasswd;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
NGINX

Test and reload Nginx:

nginx -t && systemctl reload nginx
Terminal showing systemd service management commands or output.

7. Enable SSL with Let’s Encrypt

Install Certbot:

dnf install certbot python3-certbot-nginx
Terminal showing DNF/YUM package management commands and output.

Run Certbot to issue a free SSL certificate:

certbot --nginx -d your-domain.com
Terminal showing Certbot certificate commands and messages.

8. Access Dozzle

Now open your browser and visit:

https://your-domain.com

You should see the Dozzle log viewer UI, showing real-time Docker logs. 🎉

Dozzle container monitoring screen.

This tutorial was created and tested on a Shape.Host Cloud VPS.

With Shape.Host you can:

  • Deploy fast, reliable Cloud VPS servers worldwide.
  • Run Linux distributions like Rocky Linux, AlmaLinux, Debian, Ubuntu.
  • Scale resources instantly (CPU, RAM, Storage) as your project grows.
  • Take advantage of snapshots, backups, and monitoring.

Start your own VPS at https://shape.host and deploy Dozzle in just a few minutes.