Tutorials

Hands-on guides and configuration examples.

Configuration library · scripts and downloads ↗

Install Beszel with Docker Compose on Debian 13

Beszel displays CPU, memory, disk and network usage in a dashboard.

The hub stores metrics and the agent collects them on the server. This guide installs both on one Debian 13 VM.

The hub listens on loopback and the agent uses a shared Unix socket.

  1. Prepare the directory

    Install Docker Engine and its Compose plugin. Use an up-to-date Docker Engine, at least version 28, for the loopback port mapping. Create the credentials file before first start.

    Terminal
    mkdir -p ~/beszel && cd ~/beszel &&
    (umask 077; touch agent.env; chmod 600 agent.env)
  2. Create the Compose file

    Save this block to compose.yaml. Both images use version 0.21.2. The agent shares the host network stack to collect its counters and uses a Unix socket for local connections.

    compose.yaml
    services:
      beszel:
        image: henrygd/beszel:0.21.2
        restart: unless-stopped
        environment:
          APP_URL: http://localhost:8090
        ports:
          - "127.0.0.1:8090:8090"
        volumes:
          - ./beszel_data:/beszel_data
          - ./beszel_socket:/beszel_socket
    
      beszel-agent:
        image: henrygd/beszel-agent:0.21.2-alpine
        restart: unless-stopped
        network_mode: host
        env_file:
          - ./agent.env
        environment:
          LISTEN: /beszel_socket/beszel.sock
          HUB_URL: http://127.0.0.1:8090
        volumes:
          - ./beszel_agent_data:/var/lib/beszel-agent
          - ./beszel_socket:/beszel_socket

    This example collects host metrics. Per-container Docker metrics require additional daemon access. Mounting docker.sock with :ro does not make the Docker API read-only.

  3. Start the hub and create an account

    On Debian, run the first two commands. From your client, open the SSH tunnel using your VM IP and SSH username. Then open http://localhost:8090 and create the administrator account.

    Terminal
    sudo docker compose config --quiet
    sudo docker compose up -d beszel
    
    ssh -N -L 127.0.0.1:8090:127.0.0.1:8090 utilisateur@IP_DE_LA_VM
  4. Connect the agent to the hub

    In Add System, name your VM and enter /beszel_socket/beszel.sock in Host / IP. Copy the public key and the token for this system. Fill in both lines in agent.env, then add the system in the hub.

    agent.env
    KEY='COLLER_LA_CLE_PUBLIQUE_DU_HUB'
    TOKEN='COLLER_LE_JETON_DU_SYSTEME'

    Keep agent.env private and out of Git. If you need to see the token again, open the system settings in the hub.

  5. Check that metrics are flowing

    Start the agent, then open the system details. Wait for the first sample and check that CPU and memory appear.

    Terminal
    sudo docker compose config --quiet && sudo docker compose up -d beszel-agent
    sudo docker compose ps
    sudo docker compose logs --tail=50 beszel-agent

    If the status stays offline, check the hub socket path, token, key and shared mount. After changing agent.env, run docker compose up -d --force-recreate beszel-agent.

  6. Back up and update

    Briefly stop the services before backing up beszel_data, beszel_agent_data, compose.yaml and agent.env to a private location. Restart the services afterward. For updates, read release notes, update both tags together, and recreate the containers.

    Terminal
    sudo docker compose pull && sudo docker compose up -d
    sudo docker compose ps
Official Beszel getting started guide ↗