Photo by Alvaro Reyes / Unsplash

How to install Dozzle on synology / linux / vps

docker Aug 6, 2024

Dozzle is log viewer for Docker containers. It allows you to view logs of Docker containers through a web interface and is useful for monitoring and debugging purposes without needing to use the command line.

Dozzle is a small lightweight application with a web based interface to monitor Docker logs. It doesn’t store any log files. It is for live monitoring of your container logs only. [1]


  1. https://github.com/amir20/dozzle?tab=readme-ov-file ↩︎

Version used in this documentation

There can be slight differences on installation processes if you are on different versions or hardware

Application Version
Debian 11
Synology DSM 7.2.1-69057 Update 4
Linux Docker 20.10.21
Synology Docker 20.10.23-1437
Docker Compose 1.29.2
Portainer 2.19.5
Dozzle 8.1.3

Prerequisites

How to install Portainer on synology / linux / vps
Discover how to install Portainer with a step-by-step instructions for an easy and efficient Portainer setup.

The majority, if not all, of the Docker container guides on this website use Docker Compose with Portainer. You can, of course, take the provided Compose configuration and use it directly, instead of using Portainer, or use another manager, such as Dockge, for example.

Environments in the examples

Check these if you are not sure which environments you can safely change

Name Mapped Container
Container name dozzle
Container image amir20/dozzle:latest
Config directory mount /volume1/docker/portainer /data
Http port 20030 8080

I use different mapped port with the container port only to showcase how to change port. You can definitely use the default container port instead of changing them.

How to install Dozzle

  1. Open portainer i.e. https://192.168.1.1:10000, click on the environment i.e. local, then click on Stacks
  2. Click + Add stack then fill in the name of your Dozzle stack i.e. Dozzle
  3. Fill the editor with these:

    Change every ${} to your values

    version: '3.3'
    services:
      dozzle:
        container_name: dozzle
        image: 'amir20/dozzle:latest'
        volumes:
          - '/var/run/docker.sock:/var/run/docker.sock'
        ports:
          - ${HTTP_PORT}:8080
        restart: on-failure:5
    
  4. Click on Deploy the stack, wait a bit for Portainer to download and run your container

How to open Dozzle

  1. Open it using http://your_device_ip:your_dozzle_port i.e. http://192.168.1.1:20030

Optional configurations

Adding authentication

  1. First create a hashed password, open up a linux/ssh terminal and enter this:
    echo -n 'your_password_here' | sha256sum
    
  2. Create a configuration folder for dozzle, i.e.:
    sudo mkdir /volume1/docker/dozzle
    
  3. Create a user.yml file inside that folder
    sudo touch /volume1/docker/dozzle/user.yml
    
  4. Fill the file with these:
    users:
      # "admin" here is username
      admin:
        name: "Admin"
        # the hashed password you got from step 1
        password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
        email: [email protected]
    
  5. Modify your docker compose with additional volume mapping and environment:
    version: '3.3'
    services:
      dozzle:
        ...
        volumes:
          - '/var/run/docker.sock:/var/run/docker.sock'
          - ${YOUR_DOZZLE_PATH}:/data
        environment:
          - DOZZLE_AUTH_PROVIDER: simple
        ...
    

One dozzle for multiple docker instances

  1. Create a dozzle agent on the other device with this compose:
    services:
      dozzle-agent:
        image: amir20/dozzle:latest
        command: agent
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
        ports:
          - ${YOUR_AGENT_PORT}:7007
    
  2. Modify your main dozzle docker compose:
    version: '3.3'
    services:
      dozzle:
        ...
        environment:
          - DOZZLE_REMOTE_AGENT=${OTHER_DEVICE_IP}:${YOUR_AGENT_PORT}
        ...
    

Healthcheck

  1. Dozzle has internal support for healthcheck using dozzle healthcheck command. It is not enabled by default as it adds extra CPU usage.
  2. Modify your docker compose:
    version: '3.3'
    services:
      dozzle:
        ...
        healthcheck:
          test: ["CMD", "/dozzle", "healthcheck"]
          interval: 3s
          timeout: 30s
          retries: 5
          start_period: 30s
        ...
    

How to open Dozzle

  1. Open your web browser
  2. Go to http://your-device-ip:your-dozzle-port
    i.e. http://192.168.1.1:20030

How to update Dozzle

  1. In Portainer click on Stacks then click on your Dozzle stack
  2. Click Update the stack, toggle on Re-pull image and redeploy then click Update
Home | Dozzle
A lightweight, open-source, and secure log viewer for Docker.
GitHub - amir20/dozzle: Realtime log viewer for docker containers.
Realtime log viewer for docker containers. . Contribute to amir20/dozzle development by creating an account on GitHub.

Tags