### Install Go, Node.js, and pnpm on macOS Source: https://github.com/amir20/dozzle/blob/master/README.md Installs the necessary build tools for Dozzle development on macOS using Homebrew. ```bash brew install go node pnpm protobuf ``` -------------------------------- ### Example Default Profile Configuration Source: https://github.com/amir20/dozzle/blob/master/docs/guide/default-profile.md This JSON object shows an example of a default profile configuration. You can override specific settings by including them in this file. ```json { "settings": { "showTimestamp": true, "showStd": false, "showAllContainers": false, "softWrap": true, "collapseNav": false, "smallerScrollbars": false, "search": false, "compact": false, "menuWidth": 250, "size": "medium", "lightTheme": "auto", "hourStyle": "auto", "dateLocale": "auto", "locale": "en", "groupContainers": "stack", "automaticRedirect": "" }, "pinned": [], "visibleKeys": [], "collapsedGroups": [] } ``` -------------------------------- ### Install Dependencies Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Installs project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Install Go, Node.js, and pnpm on Linux Source: https://github.com/amir20/dozzle/blob/master/README.md Installs the necessary build tools for Dozzle development on Debian/Ubuntu based Linux systems. ```bash sudo apt install golang nodejs protobuf-compiler npm install -g pnpm ``` -------------------------------- ### Run Backend Development Server Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Starts the Go backend server in watch mode using air. ```bash pnpm run watch:backend ``` -------------------------------- ### Clone Dozzle and Install Dependencies Source: https://github.com/amir20/dozzle/blob/master/README.md Clones the Dozzle repository and installs frontend dependencies using pnpm. Also installs Go build tools and generates necessary code. ```bash git clone https://github.com/amir20/dozzle.git cd dozzle pnpm install # installs frontend dependencies go install tool # installs Go build tools listed in go.mod (air, protoc-gen-go, etc.) make generate # generates TLS certificates and protobuf code (only needed once) ``` -------------------------------- ### Enable and Start Podman Socket (Rootless) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Enables and starts the user-level Podman socket for rootless deployments. This is typically managed per user session. ```bash systemctl --user enable podman.socket systemctl --user start podman.socket ``` -------------------------------- ### Run Frontend Development Server Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Starts the Vite development server for the frontend with hot reload. ```bash pnpm run watch:frontend ``` -------------------------------- ### Install dtop with Homebrew Source: https://github.com/amir20/dozzle/blob/master/docs/guide/dtop.md Use this command to install dtop if you are a macOS user with Homebrew. ```bash brew install dtop ``` -------------------------------- ### Start Dozzle Development Server Source: https://github.com/amir20/dozzle/blob/master/README.md Starts the Dozzle development server, which includes both the backend and frontend. The server automatically reloads on file changes. ```bash make dev ``` -------------------------------- ### Container Expression Example Source: https://github.com/amir20/dozzle/blob/master/docs/guide/alerts-and-webhooks.md Example of a container expression used to select containers based on name and labels. ```string name contains "api" && labels["env"] == "production" ``` -------------------------------- ### Run Agent Mode for Development Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Starts the application in agent mode for development purposes. ```bash pnpm run agent:dev ``` -------------------------------- ### Enable and Start Podman Socket (Rootful) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Enables and starts the Podman system socket for rootful deployments. This is a prerequisite for Dozzle to connect to the Podman daemon. ```bash sudo systemctl enable podman.socket sudo systemctl start podman.socket ``` -------------------------------- ### Install Kubernetes Metrics Server Source: https://github.com/amir20/dozzle/blob/master/docs/guide/k8s.md This command applies the necessary configuration to install the Kubernetes Metrics Server, which Dozzle relies on for retrieving resource usage information. ```bash kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml ``` -------------------------------- ### Enable and Start Dozzle Agent Service Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Commands to reload systemd, enable, and start the Dozzle agent service for user-level management. ```bash systemctl --user daemon-reload systemctl --user enable dozzle-agent.service systemctl --user start dozzle-agent.service ``` -------------------------------- ### Enable and Start Dozzle Service (Quadlet) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Reloads the systemd user daemon and enables/starts the Dozzle service defined by the Quadlet container file. This ensures Dozzle starts automatically on user login. ```bash systemctl --user daemon-reload systemctl --user enable --now dozzle.service ``` -------------------------------- ### Dozzle Docker Compose Configuration Source: https://github.com/amir20/dozzle/blob/master/README.md Configure and run Dozzle using Docker Compose. This example sets up the Dozzle service, mounts necessary volumes, and maps ports. ```yaml services: dozzle: container_name: dozzle image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - dozzle_data:/data ports: - 8080:8080 volumes: dozzle_data: ``` -------------------------------- ### Run Dozzle with Docker Source: https://github.com/amir20/dozzle/blob/master/README.md Run Dozzle as a Docker container, mounting the Docker Unix socket and exposing port 8080. This is the simplest way to start using Dozzle. ```bash docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -v dozzle_data:/data -p 8080:8080 amir20/dozzle:latest ``` -------------------------------- ### Run Dozzle Agent (Rootful) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Starts Dozzle in agent mode, connecting to the rootful Podman socket and exposing the agent on port 7007. This agent can then communicate with a central Dozzle server. ```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 ``` -------------------------------- ### Run Dozzle Agent (Rootless) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Starts Dozzle in agent mode for a specific user's rootless Podman environment. It connects to the user's Podman socket and exposes the agent on port 7007. Ensure the correct user and socket path are used. ```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 Server with Remote Agents via Command Line Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Starts the Dozzle server in detached mode, publishing port 3000 and specifying remote agents using command-line arguments. ```bash podman run -d \ --name dozzle \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest \ --agent "host1.example.com:7007" \ --agent "host2.example.com:7007" ``` -------------------------------- ### Enable Simple Authentication in Swarm Mode Source: https://github.com/amir20/dozzle/blob/master/docs/guide/swarm-mode.md Configure simple authentication in Swarm Mode by storing the `users.yml` file in a Docker secret. This example sets `DOZZLE_AUTH_PROVIDER` to `simple` and mounts the secret to the data directory. ```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 ``` -------------------------------- ### Count All Logs with SQL Source: https://github.com/amir20/dozzle/blob/master/docs/guide/sql-engine.md Use this query to get a total count of all logs available in the 'logs' table. ```sql SELECT COUNT(*) FROM logs ``` -------------------------------- ### Start Docker Socket Proxy Source: https://github.com/amir20/dozzle/blob/master/docs/guide/remote-hosts.md Run a Docker Socket Proxy to expose the Docker API without TLS. This allows Dozzle to connect directly. Ensure necessary permissions (`CONTAINERS`, `INFO`) are enabled. ```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 ``` -------------------------------- ### Run dtop using Docker Source: https://github.com/amir20/dozzle/blob/master/docs/guide/dtop.md Execute dtop directly via Docker without local installation. Ensure the Docker socket is mounted for dtop to access containers. ```bash docker run -v /var/run/docker.sock:/var/run/docker.sock -it ghcr.io/amir20/dtop:latest ``` -------------------------------- ### Example Duplicate Host Warning Log Source: https://github.com/amir20/dozzle/blob/master/docs/guide/faq.md This log indicates that Dozzle has detected multiple hosts with the same unique identifier, which can occur when VMs are restored from backups. To resolve this, remove the engine-id file. ```log time="2024-07-10T13:35:53Z" level=warning msg="duplicate host ID: *********, Endpoint: 1.1.1.1:7007 found, skipping" ``` -------------------------------- ### Run Dozzle Server with Remote Agents via Environment Variable Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Starts the Dozzle server in detached mode, publishing port 8080 and configuring remote agents using the DOZZLE_REMOTE_AGENT environment variable. ```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 ``` -------------------------------- ### Configure Log Level Filtering for Dozzle Cloud Source: https://github.com/amir20/dozzle/blob/master/docs/guide/dozzle-cloud.md Use the `dev.dozzle.cloud.min_level` label to control which log messages are sent to Dozzle Cloud. This example shows how to forward only warning, error, or fatal logs for the `zigbee2mqtt` service. ```yaml services: zigbee2mqtt: image: koenkk/zigbee2mqtt labels: # Only forward warn/error/fatal to Dozzle Cloud - dev.dozzle.cloud.min_level=warn ``` -------------------------------- ### Build Entire Application Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Builds the entire application, including frontend assets. ```bash make build ``` -------------------------------- ### Build Frontend Assets (Makefile) Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Builds the frontend assets for production using the Makefile. ```bash make dist ``` -------------------------------- ### Generate Certificates and Protobuf Files Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Generates necessary certificates and protobuf files for the project. ```bash make generate ``` -------------------------------- ### Preview Production Build Locally (Makefile) Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Locally previews the production build of the frontend assets using the Makefile. ```bash make preview ``` -------------------------------- ### Preview Production Build Locally Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Locally previews the production build of the frontend assets. ```bash pnpm preview ``` -------------------------------- ### Build Frontend Assets Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Builds the frontend assets for production. ```bash pnpm build ``` -------------------------------- ### Run Go Tests Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Executes the Go test suite for the backend. ```bash make test ``` -------------------------------- ### Alert on Stderr from Specific Image Source: https://github.com/amir20/dozzle/blob/master/docs/guide/alerts-and-webhooks.md Trigger an alert for any stderr output from containers whose image name starts with 'myapp/'. ```plaintext Container: image startsWith "myapp/" Log: stream == "stderr" ``` -------------------------------- ### Filter Containers with Docker Compose Source: https://github.com/amir20/dozzle/blob/master/docs/guide/filters.md Configure filters using the `DOZZLE_FILTER` environment variable in your `docker-compose.yml` file. This example filters by the 'color' label. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 8080:8080 environment: DOZZLE_FILTER: label=color ``` -------------------------------- ### Run Frontend Tests Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Executes the frontend tests using Vitest. ```bash pnpm test ``` -------------------------------- ### Filter Containers with Docker Run Source: https://github.com/amir20/dozzle/blob/master/docs/guide/filters.md Use the `--filter` flag with `docker run` to limit the containers Dozzle can access. This example filters by the 'color' label. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --filter label=color ``` -------------------------------- ### Enable Memory Usage on ARM Devices Source: https://github.com/amir20/dozzle/blob/master/docs/guide/faq.md Add kernel parameters to /boot/cmdline.txt to enable memory cgroup support on ARM devices where memory usage is not displayed. ```text cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 ``` -------------------------------- ### Enable Deployments with Docker Run Source: https://github.com/amir20/dozzle/blob/master/docs/guide/deployments.md Run Dozzle with the necessary volume mounts for persistence and the enable actions flag. Ensure the data directory is persisted to avoid data loss. ```sh docker run \ --volume=/var/run/docker.sock:/var/run/docker.sock \ --volume=/path/to/data:/data \ -p 8080:8080 \ amir20/dozzle --enable-actions ``` -------------------------------- ### Disable Log Forwarding to Dozzle Cloud Source: https://github.com/amir20/dozzle/blob/master/docs/guide/dozzle-cloud.md Set the `dev.dozzle.cloud.min_level` label to `disabled` to prevent any logs from a specific container from being sent to Dozzle Cloud. This example disables logs for a `noisy-debug-tool` service. ```yaml services: noisy-debug-tool: image: example/debug labels: # Don't send anything from this container - dev.dozzle.cloud.min_level=disabled ``` -------------------------------- ### Traefik Labels for Dozzle Service Source: https://github.com/amir20/dozzle/blob/master/docs/guide/changing-base.md Example Traefik labels for routing to a Dozzle service, enabling TLS, and specifying the correct load balancer port. Assumes Dozzle is running on port 8080. ```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 ``` -------------------------------- ### Build Docker Image Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Builds the Docker image for the Dozzle application. ```bash make docker ``` -------------------------------- ### Configure Claude Desktop for Dozzle MCP Source: https://github.com/amir20/dozzle/blob/master/docs/guide/mcp.md Set up Claude Desktop to connect to Dozzle's MCP endpoint. Use 'streamable-http' as the type and the correct URL. ```json { "mcpServers": { "dozzle": { "type": "streamable-http", "url": "http://localhost:8080/api/mcp" } } } ``` -------------------------------- ### Docker Compose for Dozzle, Authelia, and Traefik Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md This docker-compose.yml file sets up Dozzle, Authelia, and Traefik. Authelia handles authentication, and Traefik acts as a reverse proxy with SSL. Ensure Authelia is configured separately. ```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 ``` -------------------------------- ### Dozzle Overlay Network Configuration in Swarm Mode Source: https://github.com/amir20/dozzle/blob/master/docs/guide/faq.md Configure a separate overlay network for Dozzle instances in Swarm Mode to resolve timeouts and ensure consistent node discovery when behind a load balancer. This setup separates Dozzle communication from other services like Traefik. ```yaml services: logs: ... networks: [ traefik, dozzle ] ... networks: dozzle: driver: overlay traefik: external: true ``` -------------------------------- ### Enable MCP via Docker CLI Source: https://github.com/amir20/dozzle/blob/master/docs/guide/mcp.md Run Dozzle with the --enable-mcp flag to activate the MCP endpoint. Ensure the Docker socket is mounted. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-mcp ``` -------------------------------- ### Create Custom Container Group with Docker CLI Source: https://github.com/amir20/dozzle/blob/master/docs/guide/container-groups.md Use this command to run a container and assign it to a custom group named 'myapp' using a label. ```sh docker run --label dev.dozzle.group=myapp hello-world ``` -------------------------------- ### Docker Run with Custom Certificate Paths via Command-Line Flags Source: https://github.com/amir20/dozzle/blob/master/docs/guide/agent.md Run Dozzle agent with custom certificates specified via command-line flags, mounting a local certs directory. ```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-key.pem ``` -------------------------------- ### Run Dozzle Standalone (Rootful) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Runs Dozzle in standalone mode, connecting to the rootful Podman socket. It maps the Podman socket to the expected Docker socket path and exposes Dozzle on port 3000. ```bash podman run -v /run/podman/podman.sock:/var/run/docker.sock:ro \ -p 3000:8080 \ ghcr.io/amir20/dozzle:latest ``` -------------------------------- ### Run Dozzle Standalone (Rootless) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Runs Dozzle in standalone mode, connecting to a specific user's rootless Podman socket. Ensure the correct user ID and socket path are used. Note that this instance will only monitor containers for the specified user. ```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 ``` -------------------------------- ### Configure Dozzle with Forward Proxy Authentication Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md Set the --auth-provider to 'forward-proxy' to enable Dozzle to read proxy headers for authentication. ```sh $ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --auth-provider forward-proxy ``` -------------------------------- ### Define New HTTP Route with Chi Router Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md When adding a new HTTP route, define it in `internal/web/routes.go` using the chi router. The handler method should then be implemented in the appropriate file. ```go r.Get("/api/custom-endpoint", h.customHandler) ``` -------------------------------- ### Generate Bcrypt Password Hash Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md Use this command to generate a bcrypt password hash for the file-based authentication. You need to provide a username, password, email, and name. ```bash docker run -it --rm amir20/dozzle generate admin --password password --email me@email.net --name "Admin" ``` -------------------------------- ### Initial Table Creation in SQL Engine Source: https://github.com/amir20/dozzle/blob/master/docs/guide/sql-engine.md This query is run initially by the SQL Engine to create a virtual table from JSON logs. It unnests the JSON data into rows for querying. ```sql CREATE TABLE logs AS SELECT unnest(m) FROM 'logs.json' ``` -------------------------------- ### Run Dozzle with Podman Source: https://github.com/amir20/dozzle/blob/master/README.md Execute Dozzle using Podman by mounting the remote socket and exposing the necessary port. Ensure the Podman remote socket is enabled. ```bash podman run --volume=/run/user/1000/podman/podman.sock:/var/run/docker.sock -d -p 8080:8080 docker.io/amir20/dozzle:latest ``` -------------------------------- ### Run Dozzle with Docker Compose Source: https://github.com/amir20/dozzle/blob/master/docs/guide/alerts-and-webhooks.md Configure and run Dozzle using Docker Compose, ensuring correct volume mounts and port mappings. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock - /path/to/data:/data ports: - 8080:8080 ``` -------------------------------- ### Verify Kubernetes Metrics Server Source: https://github.com/amir20/dozzle/blob/master/docs/guide/k8s.md This command checks if the Kubernetes Metrics API is running and accessible by attempting to list pod resource usage. ```bash kubectl top pod ``` -------------------------------- ### Configure Dozzle Server with Remote Agents using Quadlet Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Systemd container configuration for the Dozzle server, specifying remote agents via an environment variable and setting up health checks. ```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 ``` -------------------------------- ### Enable Container Actions with Docker Run Source: https://github.com/amir20/dozzle/blob/master/docs/guide/actions.md Use this command to run Dozzle with container actions enabled. Ensure the Docker socket is mounted. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-actions ``` -------------------------------- ### Generate Podman Engine-ID using uuidgen Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Creates a directory for the engine-id if it doesn't exist, generates a UUID, and saves it to the engine-id file. Verifies the 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 ``` -------------------------------- ### Enable Shell Access with Docker Run Source: https://github.com/amir20/dozzle/blob/master/docs/guide/shell.md Run Dozzle with Docker, enabling shell access by mounting the Docker socket and passing the --enable-shell flag. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --enable-shell ``` -------------------------------- ### Run Integration Tests Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Executes the integration tests for the application using Playwright. ```bash make int ``` -------------------------------- ### Docker Compose for File-Based Authentication Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md Set up Dozzle with file-based authentication using Docker Compose. Ensure the `users.yml` file is accessible and mounted correctly. ```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 ``` -------------------------------- ### Perform Type Checking Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Runs type checking for the project using pnpm. ```bash pnpm typecheck ``` -------------------------------- ### Enable Deployments with Docker Compose Source: https://github.com/amir20/dozzle/blob/master/docs/guide/deployments.md Configure Dozzle in a Docker Compose file to enable deployments. This involves mapping the Docker socket, persisting the data directory, and setting the enable actions environment variable. ```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 ``` -------------------------------- ### Generate Private Key, Certificate Signing Request, and Certificate Source: https://github.com/amir20/dozzle/blob/master/docs/guide/agent.md Commands to generate a private key, a certificate signing request (CSR), and a self-signed certificate for Dozzle agent. ```sh $ openssl genpkey -algorithm Ed25519 -out key.pem $ openssl req -new -key key.pem -out request.csr -subj "/C=US/ST=California/L=San Francisco/O=My Company" $ openssl x509 -req -in request.csr -signkey key.pem -out cert.pem -days 365 ``` -------------------------------- ### Docker Compose for Streaming Mounted Log Files Source: https://github.com/amir20/dozzle/blob/master/docs/guide/log-files-on-disk.md This docker-compose configuration sets up a service to stream a mounted log file using `tail -f`. This is useful for ensuring the log stream survives server reboots. ```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 ``` -------------------------------- ### Run Frontend Tests in Watch Mode Source: https://github.com/amir20/dozzle/blob/master/CLAUDE.md Executes the frontend tests using Vitest and stays active to re-run on changes. ```bash TZ=UTC pnpm test --watch ``` -------------------------------- ### Define User Filters in users.yml Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md Set specific filters for users in the users.yml file to restrict visible containers. The 'guest' user is filtered by 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" ``` -------------------------------- ### Tail Mounted Log File with Alpine Source: https://github.com/amir20/dozzle/blob/master/docs/guide/log-files-on-disk.md Use this command to tail a log file mounted from the host into an Alpine container. This allows Dozzle to read logs written to files by streaming them. ```sh docker run -v /var/log/system.log:/var/log/test.log alpine tail -f /var/log/test.log ``` -------------------------------- ### Enable Memory Controller Delegation for Rootless Podman Source: https://github.com/amir20/dozzle/blob/master/docs/guide/podman.md Configures systemd to delegate the memory cgroup controller to the user slice, which is necessary for rootless Podman to report memory statistics. ```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 ``` -------------------------------- ### Enable MCP via Docker Compose Source: https://github.com/amir20/dozzle/blob/master/docs/guide/mcp.md Configure Dozzle in docker-compose.yml to enable MCP using the DOZZLE_ENABLE_MCP environment variable. Mount the Docker socket and expose the port. ```yaml services: dozzle: image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 8080:8080 environment: DOZZLE_ENABLE_MCP: true ``` -------------------------------- ### Alert on High CPU Usage in Production Source: https://github.com/amir20/dozzle/blob/master/docs/guide/alerts-and-webhooks.md Trigger an alert when CPU usage exceeds 90% on production containers. Uses smoothed average stats. ```plaintext Container: labels["env"] == "production" Metric: cpu > 90 ``` -------------------------------- ### Access Dozzle Container by Name Source: https://github.com/amir20/dozzle/blob/master/docs/guide/faq.md Use the special '/show' route to link directly to a container by its name, which Dozzle then forwards to the container's ID. ```html /show?name=foo.bar ``` -------------------------------- ### Set Base Path with Docker CLI Source: https://github.com/amir20/dozzle/blob/master/docs/guide/changing-base.md Use the --base flag with the docker run command to specify a custom base path for Dozzle. This mounts the application at the specified sub-path. ```sh docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle --base /foobar ``` -------------------------------- ### Connect to a Dozzle Agent (Docker CLI) Source: https://github.com/amir20/dozzle/blob/master/docs/guide/agent.md Run Dozzle and specify the remote agent's address to connect. This command exposes the Dozzle UI on port 8080. ```sh docker run -p 8080:8080 amir20/dozzle:latest --remote-agent agent:7007 ``` -------------------------------- ### Create Custom Container Group with Docker Compose Source: https://github.com/amir20/dozzle/blob/master/docs/guide/container-groups.md Define a service in your Docker Compose file and assign it to a custom group named 'myapp' using labels. ```yaml services: dozzle: image: hello-world labels: - dev.dozzle.group=myapp ``` -------------------------------- ### Authelia Configuration for Dozzle Integration Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md This configuration.yml file details Authelia's settings for integrating with Dozzle. It includes JWT secrets, server details, authentication backend, access control rules, session management, and storage encryption. Ensure SSL is enabled and valid keys are provided. ```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 ``` -------------------------------- ### Generate Engine ID for Podman Source: https://github.com/amir20/dozzle/blob/master/docs/guide/faq.md 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 to resolve 'host not found' errors. ```bash mkdir -p /var/lib/docker ``` ```bash uuidgen > engine-id ``` -------------------------------- ### oauth2-proxy Configuration for Pocket ID Source: https://github.com/amir20/dozzle/blob/master/docs/guide/authentication.md Configuration file for oauth2-proxy to integrate with Pocket ID for OIDC authentication. Ensure all sensitive variables like client_id, client_secret, and cookie_secret are securely managed. ```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 ``` -------------------------------- ### Caddy Configuration for Dozzle Source: https://github.com/amir20/dozzle/blob/master/docs/guide/changing-base.md Configure Caddy as a reverse proxy for Dozzle, disabling response buffering by setting `flush_interval` to -1. This ensures streaming endpoints function correctly. ```caddyfile dozzle.example.com { reverse_proxy dozzle:8080 { flush_interval -1 } } ```