glances Docker & Self-Hosted Deployment

GitHub

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, macOS and Windows operating systems.

33,277 stars Python Python 1 file ยท ~37,797 tokens #monitoring#multi-platform#python#restful#restful-api#system#terminal#web
RAW Compose
1. Pull Image (DOCKERHUB) docker pull nicolargo/glances
2. Docker Run (1-Click Launch) docker run -d --name glances --restart always nicolargo/glances:latest-full
3. Podman Run podman run -d --name glances --restart always nicolargo/glances:latest-full
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/nicolargo/glances:latest-full
5. ORAS Pull (OCI Artifact) oras pull nicolargo/glances:latest-full
6. Compose Deployment docker compose up -d
docker-compose/docker-compose.yml
Download .yml
services:
  glances:
    # See all images tags here: https://hub.docker.com/r/nicolargo/glances/tags
    image: nicolargo/glances:latest-full
    restart: always

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:61208/api/4/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

    pid: "host"
    network_mode: "host"

    read_only: true
    privileged: false
    # Uncomment next line for SATA or NVME smartctl monitoring
    # cap_add:
      # Uncomment next line for SATA smartctl monitoring
      # - SYS_RAWIO
      # Uncomment next line for NVME smartctl monitoring
      # - SYS_ADMIN
    # devices:
    #   - "/dev/nvme0"

    volumes:
      - "/:/rootfs:ro"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      # Uncomment for qemu/libvirt/kvm support with modular libvirt daemons
      # - "/var/run/libvirt/virtqemud-sock:/var/run/libvirt/libvirt-sock:ro"
      # OR monolithic libvirt daemon
      # - "/var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock:ro"
      - "/run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro"
      - "./glances.conf:/glances/conf/glances.conf"
      # Uncomment for proper distro information in upper panel.
#     # Works only for distros that do have this file (most of distros do).
#      - "/etc/os-release:/etc/os-release:ro"

    tmpfs:
      - /tmp

    environment:
      - GLANCES_OPT=-C /glances/conf/glances.conf -w --enable-mcp --enable-plugin smart
      # Please set to your local timezone (or use local ${TZ} environment variable if set on your host)
      - TZ=Europe/Paris
      - PYTHONPYCACHEPREFIX=/tmp/py_caches

#     # Uncomment for GPU compatibility (Nvidia) inside the container
#     deploy:
#       resources:
#         reservations:
#           devices:
#             - driver: nvidia
#               count: 1
#               capabilities: [gpu]

    # Uncomment to protect Glances WebUI by a login/password (add --password to GLANCES_OPT)
    # secrets:
    #   - source: glances_password
    #     target: /root/.config/glances/<login>.pwd

# secrets:
#   glances_password:
#     file: ./secrets/glances_password