Back to Tutorials

Container Logs and Terminal

Stream live logs from a container, filter output, and open an interactive terminal session.

Prerequisites

  • Docker is running
  • A running container exists

Scenario 1: View Live Logs

  1. Click Containers in the sidebar
  2. Click a running container to open its detail view
  3. The log view opens automatically, streaming logs in real-time
  4. Use the Search field to filter logs by keyword — matching lines are highlighted
  5. Toggle Timestamps to show/hide log timestamps
  6. Toggle Auto-scroll to pin the log view to the bottom as new lines arrive
  7. Click Clear to clear the log view (does not delete actual logs)

Scenario 2: Open a Terminal Session

  1. Find the running container in the Containers list
  2. Click the terminal icon on the container row (tooltip: "Open Terminal")
  3. A terminal session opens using docker exec -it <container-id> /bin/sh
  4. If the container has bash installed, the shell may be /bin/bash instead
  5. Run commands inside the container:
shellsession
/ # ls /
bin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var

/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine

/ # ps aux
PID   USER     TIME  COMMAND
    1 root      0:00 nginx: master process nginx -g daemon off;
   29 nginx     0:00 nginx: worker process
  1. Type exit or press Ctrl+D to close the terminal session

Scenario 3: Debug a Failing Container

  1. Notice a container with a red "Exited" badge
  2. Click the container to open Inspect
  3. Click the container to open the log view and see error output:
log
2026-02-20 10:32:45 Error: Cannot find module '/app/server.js'
2026-02-20 10:32:45     at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
  1. The error reveals the issue — the expected file is missing from the mount
  2. Fix the file on the host, then right-click the container and click Start

What You'll See

  • Logs appear in a monospace font with optional timestamps
  • The search field highlights matches within the log stream
  • The terminal provides a fully interactive shell session
  • Log filtering works on the client side — all logs are fetched and filtered locally

Tips

  • Log streaming uses the Docker API's logs endpoint with follow=true
  • Very long-running containers may produce large log volumes — use the search/filter to find relevant entries
  • If the terminal shows "OCI runtime exec failed: unable to start container process: exec: /bin/sh: not found", the container may use a distroless image with no shell
  • You can open multiple terminal sessions to the same container simultaneously

Related Tutorials