### Ansible Example for Podman Setup Source: https://dozzle.dev/guide/faq This is a reference to an example setup for Ansible, which may be useful for automating Dozzle deployment with Podman. ```text Ansible ``` -------------------------------- ### Enable and Start User Podman Socket Source: https://dozzle.dev/guide/podman Enables and starts the user-level Podman socket for rootless containers. ```bash systemctl --user enable podman.socket systemctl --user start podman.socket ``` -------------------------------- ### Enable and Start Podman Socket Source: https://dozzle.dev/guide/podman Enables and starts the system-wide Podman socket for Dozzle to connect to the Docker socket. ```bash sudo systemctl enable podman.socket sudo systemctl start podman.socket ``` -------------------------------- ### Install Kubernetes Metrics Server Source: https://dozzle.dev/guide/k8s This command applies the necessary components to install the Kubernetes Metrics Server, which Dozzle relies on for resource usage information. Ensure this is running before using Dozzle in Kubernetes. ```bash kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml ``` -------------------------------- ### Install dtop with Homebrew Source: https://dozzle.dev/guide/dtop Install dtop using the Homebrew package manager. This is a straightforward installation method for macOS and Linux users. ```bash brew install dtop ``` -------------------------------- ### Enable and Start Dozzle Service with Quadlet Source: https://dozzle.dev/guide/podman Reloads systemd configuration and enables/starts the Dozzle service managed by Quadlet. ```bash systemctl --user daemon-reload systemctl --user enable --now dozzle.service ``` -------------------------------- ### Enable and Start Dozzle Agent Service with Quadlet Source: https://dozzle.dev/guide/podman Reloads systemd configuration and enables/starts the Dozzle agent service managed by Quadlet. ```bash systemctl --user daemon-reload systemctl --user enable dozzle-agent.service systemctl --user start dozzle-agent.service ``` -------------------------------- ### Run Dozzle with Docker Compose Source: https://dozzle.dev/guide/alerts-and-webhooks This example shows how to run Dozzle using Docker Compose, mounting necessary volumes for Docker socket and data persistence, and exposing the default port. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/data:/data ports: - 8080:8080 ``` -------------------------------- ### Run Rootless Dozzle Agent Source: https://dozzle.dev/guide/podman Starts a Dozzle agent for a specific user, connecting to their rootless Podman socket for remote monitoring. ```bash sudo -u appuser podman run -d \ --name dozzle-agent \ -v /run/user/$(id -u appuser)/podman/podman.sock:/var/run/docker.sock:ro \ -p 7007:7007 \ ghcr.io/amir20/dozzle:latest agent ``` -------------------------------- ### Run Dozzle with Docker CLI Source: https://dozzle.dev/guide/getting-started The simplest way to start Dozzle is using the Docker CLI. Ensure Docker Engine is 19.03 or newer. Mount the docker.sock and expose port 8080. ```sh docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v dozzle_data:/data -p 8080:8080 amir20/dozzle:latest ``` -------------------------------- ### Run Dozzle Server with Agents via Command Line Source: https://dozzle.dev/guide/podman Start the Dozzle server in detached mode, exposing port 3000 and specifying agent endpoints directly. ```bash podman run -d \ --name dozzle \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest \ --agent "host1.example.com:7007" \ --agent "host2.example.com:7007" ``` -------------------------------- ### Dozzle User Configuration File Source: https://dozzle.dev/guide/authentication Example structure for the `users.yml` file used by Dozzle's simple authentication provider. It defines users with their credentials and optional roles/filters. ```yaml users: admin: email: me@email.net name: Admin password: $2a$11$9ho4vY2LdJ/WBopFcsAS0uORC0x2vuFHQgT/yBqZyzclhHsoaIkzK filter: roles: ``` -------------------------------- ### Run dtop with Docker Source: https://dozzle.dev/guide/dtop Run dtop directly using Docker without a local installation. This method requires Docker to be installed and mounts the Docker socket for access. ```bash docker run -v /var/run/docker.sock:/var/run/docker.sock -it ghcr.io/amir20/dtop:latest ``` -------------------------------- ### Combine Container Expression Conditions Source: https://dozzle.dev/guide/alerts-and-webhooks This example shows how to combine multiple conditions in a container expression using logical AND (&&) to filter containers based on name and labels. ```string name contains "api" && labels["env"] == "production" ``` -------------------------------- ### Run Rootful Dozzle Agent Source: https://dozzle.dev/guide/podman Starts a Dozzle agent in detached mode, connecting to the system Podman socket for remote monitoring. ```bash podman run -d \ --name dozzle-agent \ -v /run/podman/podman.sock:/var/run/docker.sock:ro \ -p 7007:7007 \ ghcr.io/amir20/dozzle:latest agent ``` -------------------------------- ### Deploy Dozzle with Simple Authentication in Swarm Mode Source: https://dozzle.dev/guide/swarm-mode Configure Dozzle in Swarm Mode with simple authentication using a Docker secret for the users.yml file. This example sets the authentication provider and debug logging level. ```yaml services: dozzle: image: amir20/dozzle:latest environment: - DOZZLE_LEVEL=debug - DOZZLE_MODE=swarm - DOZZLE_AUTH_PROVIDER=simple volumes: - /var/run/docker.sock:/var/run/docker.sock - /opt/dozzle/data:/data secrets: - source: users target: /data/users.yml ports: - "8080:8080" networks: - dozzle deploy: mode: global networks: dozzle: driver: overlay secrets: users: file: users.yml ``` -------------------------------- ### Run Dozzle with Simple Authentication (docker-compose.yml) Source: https://dozzle.dev/guide/authentication Configures Dozzle to use simple authentication within a docker-compose setup, mounting the necessary data volume. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/dozzle/data:/data ports: - 8080:8080 environment: DOZZLE_AUTH_PROVIDER: simple ``` -------------------------------- ### Count All Logs Source: https://dozzle.dev/guide/sql-engine Use this query to get the total number of log entries available for analysis. ```sql SELECT COUNT(*) FROM logs ``` -------------------------------- ### Run Dozzle with Docker Compose Source: https://dozzle.dev/guide/getting-started Configure Dozzle using a docker-compose.yml file for easier management. This setup includes volume mounting for data persistence and port mapping. ```yaml # Run with docker compose up -d services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - dozzle_data:/data ports: - 8080:8080 environment: # Uncomment to enable container actions (stop, start, restart). See https://dozzle.dev/guide/actions # - DOZZLE_ENABLE_ACTIONS=true # # Uncomment to allow access to container shells. See https://dozzle.dev/guide/shell # - DOZZLE_ENABLE_SHELL=true # # Uncomment to enable authentication. See https://dozzle.dev/guide/authentication # - DOZZLE_AUTH_PROVIDER=simple # # Label this Dozzle instance (shown in the header and multi-host menu). See https://dozzle.dev/guide/hostname # - DOZZLE_HOSTNAME=my-server # # Connect to one or more remote agents to monitor other Docker hosts. See https://dozzle.dev/guide/agent # - DOZZLE_REMOTE_AGENT=192.168.1.10:7007,192.168.1.11:7007 # # Only show containers matching a filter. See https://dozzle.dev/guide/filters # - DOZZLE_FILTER=label=com.example.app v olumes: dozzle_data: ``` -------------------------------- ### Run Docker Socket Proxy Source: https://dozzle.dev/guide/remote-hosts Start a Docker Socket Proxy to expose the docker.sock file without TLS. This allows Dozzle to connect directly. Ensure necessary environment variables like CONTAINERS=1 and INFO=1 are set for required API access. ```sh docker container run --privileged -e CONTAINERS=1 -e INFO=1 -v /var/run/docker.sock:/var/run/docker.sock -p 2375:2375 tecnativa/docker-socket-proxy ``` -------------------------------- ### Set Agent Container Filters Source: https://dozzle.dev/guide/agent Limit the containers the agent can access by setting environment variables for Docker filters. This example filters by label. ```yaml services: dozzle-agent: image: amir20/dozzle:latest command: agent environment: - DOZZLE_FILTER=label=color volumes: - /var/run/docker.sock:/var/run/docker.sock:ro ``` -------------------------------- ### Run Dozzle Agent with Docker CLI Source: https://dozzle.dev/guide/agent This command starts a Dozzle agent, exposing Docker containers on the host. It mounts the Docker socket and maps port 7007 for communication. ```sh docker run -v /var/run/docker.sock:/var/run/docker.sock -p 7007:7007 amir20/dozzle:latest agent ``` -------------------------------- ### Configure Custom Certificates with Command-Line Flags Source: https://dozzle.dev/guide/agent Use --cert and --key flags with `docker run` to specify custom certificate paths. ```sh docker run -v /var/run/docker.sock:/var/run/docker.sock -v ./certs:/certs -p 7007:7007 amir20/dozzle:latest agent --cert /certs/my-cert.pem --key /certs/my-cert.pem ``` -------------------------------- ### Run Dozzle with Simple Authentication (Docker CLI) Source: https://dozzle.dev/guide/authentication Launches Dozzle using the Docker CLI, enabling simple authentication and mounting the data directory for user configuration. ```bash $ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/dozzle/data:/data -p 8080:8080 amir20/dozzle --auth-provider simple ``` -------------------------------- ### Enable Deployments with Docker Run Source: https://dozzle.dev/guide/deployments Run Dozzle with persistent data volume and enabled actions to manage deployments. ```sh docker run \ --volume=/var/run/docker.sock:/var/run/docker.sock \ --volume=/path/to/data:/data \ -p 8080:8080 \ amir20/dozzle --enable-actions ``` -------------------------------- ### Initial Table Creation for SQL Engine Source: https://dozzle.dev/guide/sql-engine This query is run initially by Dozzle to create a virtual table from JSON logs, making them queryable. ```sql CREATE TABLE logs AS SELECT unnest(m) FROM 'logs.json' ``` -------------------------------- ### Traefik Service Labels for Dozzle Source: https://dozzle.dev/guide/changing-base Example Traefik labels for routing to a Dozzle service. Ensure the correct port is exposed and TLS is configured. ```yaml services: dozzle: image: amir20/dozzle:latest labels: - traefik.enable=true - traefik.http.routers.dozzle.rule=Host(`dozzle.example.com`) - traefik.http.routers.dozzle.entrypoints=websecure - traefik.http.routers.dozzle.tls.certresolver=letsencrypt - traefik.http.services.dozzle.loadbalancer.server.port=8080 ``` -------------------------------- ### Enable Memory Delegation for User Slice Source: https://dozzle.dev/guide/podman Configure systemd to delegate memory and other controllers to the user slice by creating a drop-in configuration file. ```bash sudo mkdir -p /etc/systemd/system/user@.service.d sudo tee /etc/systemd/system/user@.service.d/delegate.conf <<'EOF' [Service] Delegate=cpu cpuset io memory pids EOF sudo systemctl daemon-reload ``` -------------------------------- ### Configure Custom Certificates with Environment Variables Source: https://dozzle.dev/guide/agent Specify custom paths for certificates using DOZZLE_CERT and DOZZLE_KEY environment variables, mounting a local certs directory. ```yaml services: agent: image: amir20/dozzle:latest command: agent environment: - DOZZLE_CERT=/certs/my-cert.pem - DOZZLE_KEY=/certs/my-key.pem volumes: - /var/run/docker.sock:/var/run/docker.sock - ./certs:/certs ports: - 7007:7007 ``` -------------------------------- ### Enable MCP with Docker Run Source: https://dozzle.dev/guide/mcp Run Dozzle with the `--enable-mcp` flag to enable the MCP endpoint. ```bash docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-mcp ``` -------------------------------- ### Dozzle with Simple Authentication using Docker Secrets Source: https://dozzle.dev/guide/authentication Sets up Dozzle with simple authentication using Docker secrets for the user configuration file, ensuring secure handling of sensitive data. ```yaml services: dozzle: image: amir20/dozzle:latest environment: - DOZZLE_AUTH_PROVIDER=simple secrets: - source: users target: /data/users.yml volumes: - /var/run/docker.sock:/var/run/docker.sock - dozzle:/data secrets: users: file: users.yml volumes: dozzle: ``` -------------------------------- ### Run Dozzle with System Podman Source: https://dozzle.dev/guide/podman Runs Dozzle in standalone mode, connecting to the system-wide Podman daemon via its socket. ```bash podman run -v /run/podman/podman.sock:/var/run/docker.sock:ro \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest ``` -------------------------------- ### Filter JSON Logs with Trigger Expression Source: https://dozzle.dev/guide/alerts-and-webhooks This example demonstrates filtering JSON logs based on nested fields and values using a log trigger expression. It checks if the status code is 500 or greater and the path contains '/api'. ```string message.status >= 500 && message.path contains "/api" ``` -------------------------------- ### Enable Actions with Docker Run Source: https://dozzle.dev/guide/actions Run Dozzle with the Docker socket mounted and the DOZZLE_ENABLE_ACTIONS environment variable set to true to enable container actions. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-actions ``` -------------------------------- ### Run Dozzle with Rootless Podman Source: https://dozzle.dev/guide/podman Runs Dozzle in standalone mode, connecting to a specific user's rootless Podman daemon. ```bash podman run -v /run/user/$(id -u appuser)/podman/podman.sock:/var/run/docker.sock:ro \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest ``` -------------------------------- ### Create a Custom Container Group with Docker CLI Source: https://dozzle.dev/guide/container-groups Use the 'dev.dozzle.group' label with the 'docker run' command to assign a container to a custom group. ```bash docker run --label dev.dozzle.group=myapp hello-world ``` -------------------------------- ### Run Dozzle Server with Agents via Environment Variable Source: https://dozzle.dev/guide/podman Deploy Dozzle using an environment variable to list remote agent endpoints, suitable for simpler configurations. ```bash podman run -d \ --name dozzle \ -e DOZZLE_REMOTE_AGENT="host1.example.com:7007,host2.example.com:7007" \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest ``` -------------------------------- ### Enable Memory Cgroup Support on ARM Devices Source: https://dozzle.dev/guide/faq On ARM devices, add kernel parameters to `/boot/cmdline.txt` to enable memory cgroup support. This is required for Dozzle to correctly report container memory usage. ```text cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 ``` -------------------------------- ### Enable Deployments with Docker Compose Source: https://dozzle.dev/guide/deployments Configure Dozzle in a Docker Compose file to enable deployments by setting the DOZZLE_ENABLE_ACTIONS environment variable and persisting the /data volume. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/data:/data ports: - 8080:8080 environment: DOZZLE_ENABLE_ACTIONS: true ``` -------------------------------- ### Configure Dozzle Server with Agents using Quadlet Source: https://dozzle.dev/guide/podman Define Dozzle as a systemd container service using a Quadlet file, specifying agents via environment variables and port mappings. ```ini # dozzle-server.container [Unit] Description=Dozzle Server with Remote Agents After=network-online.target Wants=network-online.target [Container] Image=ghcr.io/amir20/dozzle:latest PublishPort=3000:8080 Environment=DOZZLE_REMOTE_AGENT=host1.example.com:7007,host2.example.com:7007 HealthCmd=/dozzle healthcheck HealthInterval=5s HealthTimeout=10s HealthRetries=5 HealthStartPeriod=15s [Service] Restart=on-failure RestartSec=10 [Install] WantedBy=default.target ``` -------------------------------- ### Generate Podman Engine ID using uuidgen Source: https://dozzle.dev/guide/podman Create a directory for the engine ID and generate a unique UUID using `uuidgen`, then verify its content. ```bash # Create directory if needed sudo mkdir -p /var/lib/docker # Generate UUID sudo sh -c 'uuidgen > /var/lib/docker/engine-id' # Verify cat /var/lib/docker/engine-id ``` -------------------------------- ### Tail Mounted Log File with Alpine Source: https://dozzle.dev/guide/log-files-on-disk Use this command to tail a mounted log file from a host machine using Alpine Linux. Ensure the log file is mounted into the container. ```sh docker run -v /var/log/system.log:/var/log/test.log alpine tail -f /var/log/test.log ``` -------------------------------- ### Quadlet Configuration for Dozzle Source: https://dozzle.dev/guide/podman Defines a Quadlet container file for running Dozzle as a systemd service, connecting to a user's rootless Podman socket. ```ini [Unit] Description=Dozzle Log Viewer After=network-online.target Wants=network-online.target [Container] Image=ghcr.io/amir20/dozzle:latest PublishPort=3000:8080 Volume=/run/user/%U/podman/podman.sock:/var/run/docker.sock:ro HealthCmd=/dozzle healthcheck HealthInterval=5s HealthTimeout=10s HealthRetries=5 HealthStartPeriod=15s [Service] Restart=on-failure RestartSec=10 [Install] WantedBy=default.target ``` -------------------------------- ### Setting User Filters in users.yml Source: https://dozzle.dev/guide/authentication Configure user-specific filters to restrict visible containers. The 'guest' user is limited to containers with the label 'com.example.app'. ```yaml users: admin: email: name: Admin password: $2a$11$9ho4vY2LdJ/WBopFcsAS0uORC0x2vuFHQgT/yBqZyzclhHsoaIkzK filter: guest: email: name: Guest password: $2a$11$9ho4vY2LdJ/WBopFcsAS0uORC0x2vuFHQgT/yBqZyzclhHsoaIkzK filter: "label=com.example.app" ``` -------------------------------- ### Quadlet Configuration for Dozzle Agent Source: https://dozzle.dev/guide/podman Defines a Quadlet container file for running the Dozzle agent, connecting to a user's rootless Podman socket. ```ini # dozzle-agent.container [Unit] Description=Dozzle Agent After=network-online.target Wants=network-online.target [Container] Image=ghcr.io/amir20/dozzle:latest PublishPort=7007:7007 Volume=/run/user/%U/podman/podman.sock:/var/run/docker.sock:ro Exec=agent HealthCmd=/dozzle healthcheck HealthInterval=5s HealthTimeout=10s HealthRetries=5 HealthStartPeriod=15s [Service] Restart=on-failure RestartSec=10 [Install] WantedBy=default.target ``` -------------------------------- ### Configuring Dozzle with Forward Proxy (Docker Run) Source: https://dozzle.dev/guide/authentication Run Dozzle with the `--auth-provider forward-proxy` flag to enable forward proxy authentication. This requires mapping the Docker socket and exposing port 8080. ```sh docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --auth-provider forward-proxy ``` -------------------------------- ### Dozzle with Authelia using Docker Compose Source: https://dozzle.dev/guide/authentication This Docker Compose configuration sets up Dozzle, Authelia, and Traefik for authentication. Authelia acts as the authentication provider, and Traefik routes traffic and enforces authentication policies. ```yaml networks: net: driver: bridge services: authelia: image: authelia/authelia container_name: authelia volumes: - ./authelia:/config networks: - net labels: - "traefik.enable=true" - "traefik.http.routers.authelia.rule=Host(`authelia.example.com`)" - "traefik.http.routers.authelia.entrypoints=https" - "traefik.http.routers.authelia.tls=true" - "traefik.http.routers.authelia.tls.options=default" - "traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://authelia.example.com" - "traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true" - "traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email" expose: - 9091 restart: unless-stopped traefik: image: traefik:2.10.5 container_name: traefik volumes: - ./traefik:/etc/traefik - /var/run/docker.sock:/var/run/docker.sock networks: - net labels: - "traefik.enable=true" - "traefik.http.routers.api.rule=Host(`traefik.example.com`)" - "traefik.http.routers.api.entrypoints=https" - "traefik.http.routers.api.service=api@internal" - "traefik.http.routers.api.tls=true" - "traefik.http.routers.api.tls.options=default" - "traefik.http.routers.api.middlewares=authelia@docker" ports: - "80:80" - "443:443" command: - "--api" - "--providers.docker=true" - "--providers.docker.exposedByDefault=false" - "--providers.file.filename=/etc/traefik/certificates.yml" - "--entrypoints.http=true" - "--entrypoints.http.address=:80" - "--entrypoints.http.http.redirections.entrypoint.to=https" - "--entrypoints.http.http.redirections.entrypoint.scheme=https" - "--entrypoints.https=true" - "--entrypoints.https.address=:443" - "--log=true" - "--log.level=DEBUG" dozzle: image: amir20/dozzle:latest networks: - net environment: DOZZLE_AUTH_PROVIDER: forward-proxy volumes: - /var/run/docker.sock:/var/run/docker.sock labels: - "traefik.enable=true" - "traefik.http.routers.dozzle.rule=Host(`dozzle.example.com`)" - "traefik.http.routers.dozzle.entrypoints=https" - "traefik.http.routers.dozzle.tls=true" - "traefik.http.routers.dozzle.tls.options=default" - "traefik.http.routers.dozzle.middlewares=authelia@docker" expose: - 8080 restart: unless-stopped ``` ```yaml ############################################################### # Authelia configuration # ############################################################### jwt_secret: a_very_important_secret default_redirection_url: https://public.example.com server: host: 0.0.0.0 port: 9091 log: level: info totp: issuer: authelia.com authentication_backend: file: path: /config/users_database.yml access_control: default_policy: deny rules: - domain: traefik.example.com policy: one_factor - domain: dozzle.example.com policy: one_factor session: secret: unsecure_session_secret domain: example.com # Should match whatever your root protected domain is regulation: max_retries: 3 find_time: 120 ban_time: 300 storage: encryption_key: you_must_generate_a_random_string_of_more_than_twenty_chars_and_configure_this local: path: /config/db.sqlite3 notifier: filesystem: filename: /config/notification.txt ``` -------------------------------- ### Claude Desktop MCP Client Configuration Source: https://dozzle.dev/guide/mcp Configure Claude Desktop's MCP client to connect to your Dozzle instance using the provided JSON configuration. ```json { "mcpServers": { "dozzle": { "type": "streamable-http", "url": "http://localhost:8080/api/mcp" } } } ``` -------------------------------- ### oauth2-proxy Configuration File Source: https://dozzle.dev/guide/authentication Configure oauth2-proxy to use Pocket ID for OIDC authentication, specifying client credentials, upstream, and cookie settings. ```toml client_id = "xxx" # from Pocket ID client_secret = "xxx" # from Pocket ID cookie_secret = "xxx" # generate with openssl rand -base64 32 | tr -- '+/' '-_' upstreams = "http://dozzle:8080" # upstream to Dozzle containers internal port code_challenge_method = "S256" # PKCE challenges plain or S256 cookie_expire = "0" # seconds, 0 for session cookie_name = "__Host-oauth2-proxy" # or __Secure-oauth2-proxy (less secure) cookie_secure = true # uses the secure HTTPS cookie email_domains = ["*"] # allows any email domain to authenticate http_address = "0.0.0.0:4180" # port oauth2-proxy listens on oidc_issuer_url = "https://id.example.com" # your Pocket base URL provider_display_name = "Pocket ID" # display name for OIDC login provider = "oidc" # use OpenID connect reverse_proxy = true # reverse proxy the traffic scope = "openid email profile groups" # passthru these OIDC scopes ``` -------------------------------- ### Enable Shell Access with Docker Run Source: https://dozzle.dev/guide/shell Run Dozzle with the `--enable-shell` flag to allow shell access to containers. Ensure the Docker socket is mounted. ```shell docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-shell ``` -------------------------------- ### Configure Custom Certificates with Command-Line Flags in Docker Compose Source: https://dozzle.dev/guide/agent Specify custom certificate paths directly in the `command` for the agent service in docker-compose.yml. ```yaml services: agent: image: amir20/dozzle:latest command: agent --cert /certs/my-cert.pem --key /certs/my-cert.pem volumes: - /var/run/docker.sock:/var/run/docker.sock - ./certs:/certs ports: - 7007:7007 ``` -------------------------------- ### Generate Host ID for Podman with Dozzle Source: https://dozzle.dev/guide/faq When using Podman, an engine-id file is not automatically created. This snippet shows how to create the necessary directory and generate a UUID for the engine-id file, which Dozzle uses to identify the host. ```bash mkdir -p /var/lib/docker uuidgen > engine-id ``` -------------------------------- ### Run Dozzle with a Custom Base Path Source: https://dozzle.dev/guide/changing-base Use the --base flag with the docker run command to specify a custom base path for Dozzle. This makes Dozzle accessible at a sub-path instead of the root. ```docker docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --base /foobar ``` -------------------------------- ### Configuring Dozzle with Forward Proxy (Docker Compose) Source: https://dozzle.dev/guide/authentication Configure Dozzle in `docker-compose.yml` to use forward proxy authentication by setting the `DOZZLE_AUTH_PROVIDER` environment variable. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 8080:8080 environment: DOZZLE_AUTH_PROVIDER: forward-proxy ``` -------------------------------- ### Connect to Multiple Remote Hosts with TLS (Docker Compose) Source: https://dozzle.dev/guide/remote-hosts Configure multiple remote Docker hosts using a comma-separated list for the DOZZLE_REMOTE_HOST environment variable in docker-compose.yml. Mount necessary certificates to /certs. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/certs:/certs ports: - 8080:8080 environment: DOZZLE_REMOTE_HOST: tcp://167.99.1.1:2376,tcp://167.99.1.2:2376 ``` -------------------------------- ### Deploy Dozzle in Swarm Mode (Global) Source: https://dozzle.dev/guide/swarm-mode Deploy Dozzle as a global service on every node in the swarm. This ensures Dozzle is available on all hosts for log aggregation. The DOZZLE_MODE=swarm environment variable enables swarm discovery. ```yaml services: dozzle: image: amir20/dozzle:latest environment: - DOZZLE_MODE=swarm volumes: - /var/run/docker.sock:/var/run/docker.sock - /opt/dozzle/data:/data ports: - 8080:8080 networks: - dozzle deploy: mode: global networks: dozzle: driver: overlay ``` -------------------------------- ### Configure Log Forwarding with Labels Source: https://dozzle.dev/guide/dozzle-cloud Use the `dev.dozzle.cloud.min_level` label to control which log lines are forwarded to Dozzle Cloud. Set to `disabled` to skip a container entirely, or specify a minimum log level (`warn`, `error`, `fatal`) to filter logs. ```yaml services: zigbee2mqtt: image: koenkk/zigbee2mqtt labels: # Only forward warn/error/fatal to Dozzle Cloud - dev.dozzle.cloud.min_level=warn noisy-debug-tool: image: example/debug labels: # Don't send anything from this container - dev.dozzle.cloud.min_level=disabled ``` -------------------------------- ### Manually Run Podman Healthcheck Source: https://dozzle.dev/guide/podman Execute a manual healthcheck for a specific container using its ID, useful for debugging when automatic checks fail. ```bash # Manual healthcheck run podman healthcheck run ``` -------------------------------- ### Connect to Multiple Remote Hosts with TLS (CLI) Source: https://dozzle.dev/guide/remote-hosts Use the --remote-host flag multiple times to specify multiple remote Docker hosts when connecting with TLS certificates. Ensure certificates are mounted to the /certs directory. ```sh docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/certs:/certs -p 8080:8080 amir20/dozzle --remote-host tcp://167.99.1.1:2376 --remote-host tcp://167.99.1.2:2376 ``` -------------------------------- ### Configure Agent Healthcheck Source: https://dozzle.dev/guide/agent Set up a healthcheck for the agent to monitor its connection to Docker. If Docker is unreachable, the agent is marked unhealthy. ```yaml services: dozzle-agent: image: amir20/dozzle:latest command: agent healthcheck: test: ["CMD", "/dozzle", "healthcheck"] interval: 5s retries: 5 start_period: 5s start_interval: 5s volumes: - /var/run/docker.sock:/var/run/docker.sock:ro ports: - 7007:7007 ``` -------------------------------- ### Alert on Memory Pressure for API Service Source: https://dozzle.dev/guide/alerts-and-webhooks Set up an alert for memory usage exceeding 85% on containers belonging to the 'api' service. ```text Container: name contains "api" Metric: memory > 85 ``` -------------------------------- ### Create Podman Engine ID using Ansible Source: https://dozzle.dev/guide/podman Use Ansible to create the `/var/lib/docker` directory and generate an engine-id file using the system's hostname. ```yaml - name: Create /var/lib/docker ansible.builtin.file: path: /var/lib/docker state: directory mode: "755" - name: Create engine-id and derive UUID from hostname ansible.builtin.lineinfile: path: /var/lib/docker/engine-id line: "{{ hostname | to_uuid }}" create: true mode: "0644" insertafter: "EOF" ``` -------------------------------- ### Check Cgroup Controllers for Memory Delegation Source: https://dozzle.dev/guide/podman Inspect the `cgroup.controllers` file to determine if the `memory` controller is delegated to the user slice. ```bash cat /sys/fs/cgroup/user.slice/user-$(id -u).slice/cgroup.controllers ``` -------------------------------- ### Configure Custom Certificates with Docker Compose Secrets Source: https://dozzle.dev/guide/agent Provide custom certificates for agent communication using Docker Compose secrets, mounting them to default paths. ```yaml services: agent: image: amir20/dozzle:latest command: agent volumes: - /var/run/docker.sock:/var/run/docker.sock secrets: - source: cert target: /dozzle_cert.pem - source: key target: /dozzle_key.pem ports: - 7007:7007 secrets: cert: file: ./cert.pem key: file: ./key.pem ``` -------------------------------- ### Quadlet Healthcheck Command Format Source: https://dozzle.dev/guide/podman Specify the healthcheck command for Quadlet using a plain command line, not a JSON array. ```ini HealthCmd=/dozzle healthcheck ``` -------------------------------- ### Running Dozzle in Agent Mode Source: https://dozzle.dev/guide/supported-env-vars This command demonstrates how to run Dozzle in agent mode, which is useful for monitoring a remote Docker host. It requires mounting the Docker socket and specifying the remote agent's IP and port. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --remote-agent remote-ip:7007 ``` -------------------------------- ### Verify Metrics Server Status Source: https://dozzle.dev/guide/k8s This command checks if the Kubernetes Metrics API is running and accessible. It's a prerequisite for Dozzle to display resource usage information. ```bash kubectl top pod ``` -------------------------------- ### Caddy Configuration for Dozzle with Disabled Buffering Source: https://dozzle.dev/guide/changing-base Configure Caddy to reverse proxy to Dozzle, disabling response buffering using 'flush_interval -1'. This is crucial for streaming endpoints like SSE. ```caddy dozzle.example.com { reverse_proxy dozzle:8080 { flush_interval -1 } } ``` -------------------------------- ### Configure Dozzle Overlay Network in Swarm Mode Source: https://dozzle.dev/guide/faq Use this configuration to create a dedicated overlay network for Dozzle instances in Swarm Mode. This ensures that Dozzle nodes can communicate effectively, resolving issues with timeouts and load balancer discovery. ```yaml services: logs: ... networks: [ traefik, dozzle ] ... networks: dozzle: driver: overlay traefik: external: true ``` -------------------------------- ### VS Code MCP Client Configuration Source: https://dozzle.dev/guide/mcp Configure VS Code's MCP client to connect to your Dozzle instance by adding the provided JSON to your `.vscode/mcp.json` or user MCP settings. ```json { "servers": { "dozzle": { "type": "http", "url": "http://localhost:8080/api/mcp" } } } ``` -------------------------------- ### Alert on OOM Kills Source: https://dozzle.dev/guide/alerts-and-webhooks Set up an alert to trigger specifically when a container is killed due to an Out Of Memory (OOM) error. ```text Container: true Event: name == "oom" ``` -------------------------------- ### Dozzle Environment Variables for Forward Proxy Auth Source: https://dozzle.dev/guide/authentication Configure Dozzle to use a forward proxy for authentication and specify the headers to use for user information. ```yaml environment: DOZZLE_AUTH_PROVIDER: forward-proxy DOZZLE_AUTH_HEADER_USER: X-Forwarded-User DOZZLE_AUTH_HEADER_EMAIL: X-Forwarded-Email DOZZLE_AUTH_HEADER_NAME: X-Forwarded-Preferred-Username ``` -------------------------------- ### Add Labels to Remote Hosts (Docker Compose) Source: https://dozzle.dev/guide/remote-hosts Configure remote hosts with labels in docker-compose.yml by appending the label to the connection string with a pipe (|) in the DOZZLE_REMOTE_HOST environment variable. This allows for custom identification in the UI. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/certs:/certs ports: - 8080:8080 environment: DOZZLE_REMOTE_HOST: tcp://167.99.1.1:2376|foo.com,tcp://167.99.1.2:2376|bar.com ``` -------------------------------- ### Alert on High CPU for Production Containers Source: https://dozzle.dev/guide/alerts-and-webhooks Monitor and alert on high CPU usage (over 90%) for containers running in the production environment. ```text Container: labels["env"] == "production" Metric: cpu > 90 ``` -------------------------------- ### Enable Actions with Docker Compose Source: https://dozzle.dev/guide/actions Configure Dozzle in your docker-compose.yml file to enable container actions by setting the DOZZLE_ENABLE_ACTIONS environment variable. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 8080:8080 environment: DOZZLE_ENABLE_ACTIONS: true ``` -------------------------------- ### Docker Compose for Following Mounted Log Files Source: https://dozzle.dev/guide/log-files-on-disk This docker-compose configuration allows you to follow a mounted log file. It ensures the log stream persists across server reboots. The Alpine image is used for its small memory footprint. ```yaml services: dozzle-from-file: container_name: dozzle-from-file image: alpine volumes: - /var/log/system.log:/var/log/stream.log command: - tail - -f - /var/log/stream.log network_mode: none restart: unless-stopped ``` -------------------------------- ### Upgrade Dozzle Docker Image Source: https://dozzle.dev/guide/faq To upgrade Dozzle, pull the latest image and recreate the container. Ensure the data volume is mounted to preserve settings. ```sh docker pull amir20/dozzle:latest docker compose up -d dozzle ``` -------------------------------- ### Alert on API 5xx Errors Source: https://dozzle.dev/guide/alerts-and-webhooks Set up an alert for HTTP 5xx errors originating from containers whose names contain 'api'. ```text Container: name contains "api" Log: message.status >= 500 ``` -------------------------------- ### Generate User Password Hash Source: https://dozzle.dev/guide/authentication Generates a bcrypt password hash for a user. This is used in the `users.yml` file for the simple authentication provider. ```bash docker run -it --rm amir20/dozzle generate admin --password password --email me@email.net --name "Admin" ``` -------------------------------- ### Connect to Multiple Dozzle Agents with Grouping (Docker Compose) Source: https://dozzle.dev/guide/agent Configures a Dozzle UI to connect to multiple remote agents, organizing them into groups using the DOZZLE_REMOTE_AGENT environment variable. Multiple agents and groups can be specified. ```yaml services: dozzle: image: amir20/dozzle:latest environment: - DOZZLE_REMOTE_AGENT=agent1:7007|web-1|Production,agent2:7007|web-2|Production,agent3:7007|dev-1|Development ports: - 8080:8080 ``` -------------------------------- ### Connect to a Dozzle Agent with Docker CLI Source: https://dozzle.dev/guide/agent This command runs a Dozzle UI instance that connects to a remote agent. It maps port 8080 for the UI and specifies the agent's address as 'agent:7007'. ```sh docker run -p 8080:8080 amir20/dozzle:latest --remote-agent agent:7007 ``` -------------------------------- ### Deploy Dozzle Stack in Swarm Source: https://dozzle.dev/guide/getting-started Command to deploy the Dozzle stack defined in a docker-compose.yml file to a Swarm cluster. ```bash docker stack deploy -c dozzle-stack.yml ``` -------------------------------- ### Connect to Multiple Dozzle Agents with Grouping (Docker CLI) Source: https://dozzle.dev/guide/agent Connects to multiple Dozzle agents, assigning them to named groups for better organization in the UI. Each agent is specified with its endpoint, an optional name override, and a group name. ```sh docker run -p 8080:8080 amir20/dozzle:latest \ --remote-agent agent1:7007|web-1|Production \ --remote-agent agent2:7007|web-2|Production \ --remote-agent agent3:7007|dev-1|Development ``` -------------------------------- ### Alert on Authentication Failures (Regex) Source: https://dozzle.dev/guide/alerts-and-webhooks Use a regular expression to alert on authentication failures (unauthorized, forbidden, invalid token) from auth or gateway containers. ```text Container: name contains "auth" || name contains "gateway" Log: message matches "(?i)(unauthorized|forbidden|invalid token)" ```