Mastering Your Homelab: An Introduction to Beszel


Mastering Your Homelab: An Introduction to Beszel

henrygd/beszel

2025-09-08

From a software engineer's perspective, Beszel is great because it gives you a quick, at-a-glance view of your server's health and performance. It's not as complex as a full-blown enterprise monitoring solution, but that's its strength—it's fast, efficient, and easy to set up.

Here's how it helps

Real-time & Historical Data
You can see CPU, memory, disk, and network usage in real time. The historical data allows you to track trends and troubleshoot issues that might have occurred in the past. If a server suddenly became slow yesterday, you can check Beszel's history to see if there was a sudden spike in resource usage.

Docker Stats
This is a big one for modern development. Beszel can monitor your Docker containers, showing you their resource usage individually. This is incredibly helpful for identifying a runaway container that's consuming too much memory or CPU.

Alerts
You can set up alerts to get notified when something goes wrong, like a server running out of disk space or a container using too much CPU. This proactive monitoring helps you catch problems before they become critical.

Lightweight & Self-Hosted
Being lightweight means it won't hog resources on the very servers you're trying to monitor. And since it's self-hosted, you maintain full control over your data.

The easiest and recommended way to install Beszel is by using Docker. This method handles all the dependencies and makes the setup process very straightforward.

Prerequisites
Make sure you have Docker and Docker Compose installed on your server.

Create a Directory
First, create a new directory for Beszel on your server.

mkdir beszel
cd beszel

Create the Docker Compose file
Create a file named docker-compose.yml and paste the following content into it. This file tells Docker how to set up the Beszel service.

version: "3"
services:
  beszel:
    image: henrygd/beszel:latest
    container_name: beszel
    ports:
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data:/app/data
    restart: unless-stopped
    environment:
      - [email protected]
      - [email protected]
      - BESZEL_SMTP_HOST=smtp.example.com
      - [email protected]
      - BESZEL_SMTP_PASSWORD=your-email-password

Launch Beszel
Once you've saved the file, simply run the following command in the same directory.

docker-compose up -d

This command downloads the Beszel image and starts the container in the background.

Access the Dashboard
After a minute or two, Beszel should be running. You can access the dashboard by navigating to http://<your-server-ip>:8080 in your web browser.

Beszel has a simple REST API that you can use to interact with your monitoring data programmatically. This is great for automating tasks or integrating with other tools.

Here’s an example using Python to fetch server stats. You can use this to create custom scripts or dashboards.

import requests
import json

# Replace with your Beszel server's IP address and port
BESZEL_URL = "http://<your-server-ip>:8080/api/v1/stats"

def get_server_stats():
    """
    Fetches and prints the latest server statistics from Beszel.
    """
    try:
        response = requests.get(BESZEL_URL)
        response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

        stats = response.json()
        print("--- Beszel Server Stats ---")
        
        # CPU
        cpu_usage = stats.get('cpu_usage')
        print(f"CPU Usage: {cpu_usage:.2f}%")

        # Memory
        mem_info = stats.get('memory_info', {})
        total_mem = mem_info.get('total', 0)
        used_mem = mem_info.get('used', 0)
        print(f"Memory Usage: {used_mem / (1024**3):.2f} GB / {total_mem / (1024**3):.2f} GB")

        # Docker Containers
        print("\n--- Docker Containers ---")
        docker_stats = stats.get('docker_stats', [])
        for container in docker_stats:
            name = container.get('name')
            cpu_percent = container.get('cpu_percent')
            mem_usage = container.get('memory_usage')
            print(f"- {name}: CPU {cpu_percent:.2f}%, Memory {mem_usage / (1024**2):.2f} MB")

    except requests.exceptions.RequestException as e:
        print(f"Error fetching data from Beszel: {e}")

if __name__ == "__main__":
    get_server_stats()

This simple script shows how you can programmatically pull data from Beszel. You could extend this to log data to a database, send custom alerts via a messaging app, or build a personalized dashboard.


henrygd/beszel




A Developer's Guide to OpenTelemetry Collector

From an engineering perspective, the Collector solves a lot of common problemsVendor Lock-in By using the Collector, you can switch your backend (e.g., from one cloud provider's service to another) without changing the instrumentation in your application code


The Software Engineer's Secret Weapon: Taming Alert Storms with Alertmanager

Alertmanager is a standalone service that works alongside your Prometheus server. While Prometheus handles the monitoring (collecting metrics) and alert generation (deciding when an alert should fire based on PromQL rules), Alertmanager handles the alerts themselves


DIY Monitoring for Engineers: Deploying Uptime Kuma with Docker

Uptime Kuma is a versatile and user-friendly self-hosted monitoring tool that provides a slick, modern dashboard for keeping tabs on your applications and services


Termix: A Self-Hosted Web SSH Platform for Engineers

Termix, created by LukeGus, is a self-hosted, web-based server management platform. Think of it as a central hub for managing your servers


Go, Monitoring, Metrics: Leveraging the Datadog Agent in Your Engineering Workflow

The Datadog Agent is a piece of software that runs on your hosts (servers, VMs, containers, etc. ) and is essential for collecting and sending observability data—metrics


Beyond ChatGPT: Unlocking Offline AI with Jan

As software engineers, we're constantly looking for tools that boost our productivity, enhance our privacy, and give us more control over our development environment


Full Control Over Your Content: A Deep Dive into the MeTube Ecosystem

Think of it as your own personal, private DVR for the internet.At its core, MeTube is a sleek, web-based frontend for yt-dlp (the industry-standard command-line tool for downloading video). While yt-dlp is incredibly powerful


tags for code block presentation.

From a software engineering viewpoint, timelinize offers a compelling platform for several key activities, particularly because of its self-hosted nature and focus on data-import and a cohesive timeline


From Prompt to Production: Streamlining LLM Workflows with Langfuse

Langfuse is an open-source platform specifically designed for Large Language Model (LLM) engineering. Think of it as a comprehensive toolkit that helps you build