Beszel is an open-source, lightweight server monitoring platform that tracks system metrics, Docker container usage, and historical performance data, and sends alerts when a resource crosses a threshold. It consists of a central hub that stores data and serves a web dashboard, and lightweight agents that collect metrics from each monitored system. This guide deploys Beszel on a Linux server using Docker Compose with the Beszel hub, a Beszel agent, and Traefik as the reverse proxy for TLS termination, then creates the administrator account, adds the local server as the first monitored system, and reviews metrics and alerts. By the end, you'll have a self-hosted monitoring platform served over HTTPS that tracks your server and its containers.
Prerequisites
- A Linux server (at least 1 CPU core and 2 GB of RAM) accessed as a non-root user with sudo privileges
- Docker and Docker Compose installed
- A DNS A record pointing to your server's IP address (for example,
beszel.example.com)
Set Up the Directory Structure, Configuration, and Environment Variables
Beszel runs as two containers: the hub, which stores metrics and serves the dashboard, and the agent, which collects metrics from the host and its Docker containers. Both run on the same host and share a socket directory, and the agent authenticates to the hub using a key and token generated by the hub. Environment variables control the public URL, the TLS settings, and the agent's authentication credentials.
1. Create the project directory with the required subdirectories:
$ mkdir -p ~/beszel/{beszel_data,beszel_agent_data,beszel_socket,letsencrypt}
The command creates four subdirectories:
-
beszel_data/: Persists the hub database, metrics history, and configuration. -
beszel_agent_data/: Persists the agent's local data. -
beszel_socket/: Holds the Unix socket that hub and agent use to communicate. -
letsencrypt/: Stores the Traefik ACME certificate files for automatic HTTPS renewal.
2. Navigate to the project directory:
$ cd ~/beszel
3. Create the environment file:
$ nano .env
4. Add the following configuration:
# Beszel version
BESZEL_VERSION=0.18.8
# Domain and TLS
DOMAIN=beszel.example.com
LETSENCRYPT_EMAIL=admin@example.com
# Public URL of the hub (must match your domain over HTTPS)
APP_URL=https://beszel.example.com
# Agent authentication (from the hub's "Add System" dialog)
BESZEL_KEY=
BESZEL_TOKEN=
Replace beszel.example.com with your configured domain and admin@example.com with your email address. Leave BESZEL_KEY and BESZEL_TOKEN empty for now. Save and close the file.
The APP_URL variable tells the hub its public address so it can generate correct links and accept browser connections. The BESZEL_KEY and BESZEL_TOKEN variables authenticate the agent to the hub. The hub generates both values when you add the system in a later step.
Deploy with Docker Compose
The deployment stack runs the Beszel hub, a Beszel agent, and Traefik as the reverse proxy that terminates TLS and routes the configured domain to the hub. The hub is published only on the loopback interface so the agent can reach it locally, while Traefik provides public HTTPS access.
1. Create the Docker Compose manifest file:
$ nano docker-compose.yaml
2. Add the following configuration:
services:
traefik:
image: traefik:v3.7.11
container_name: beszel-traefik
restart: unless-stopped
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- beszel
beszel:
image: "henrygd/beszel:${BESZEL_VERSION:-0.18.8}"
container_name: beszel
restart: unless-stopped
environment:
APP_URL: ${APP_URL}
ports:
- "127.0.0.1:8090:8090"
volumes:
- ./beszel_data:/beszel_data
- ./beszel_socket:/beszel_socket
networks:
- beszel
labels:
- "traefik.enable=true"
- "traefik.http.routers.beszel.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.beszel.entrypoints=websecure"
- "traefik.http.routers.beszel.tls.certresolver=letsencrypt"
- "traefik.http.services.beszel.loadbalancer.server.port=8090"
beszel-agent:
image: "henrygd/beszel-agent:${BESZEL_VERSION:-0.18.8}"
container_name: beszel-agent
restart: unless-stopped
network_mode: host
volumes:
- ./beszel_agent_data:/var/lib/beszel-agent
- ./beszel_socket:/beszel_socket
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
LISTEN: /beszel_socket/beszel.sock
HUB_URL: http://localhost:8090
KEY: ${BESZEL_KEY}
TOKEN: ${BESZEL_TOKEN}
networks:
beszel:
Save and close the file. In the above manifest:
-
traefik: Serves as the reverse proxy and TLS termination point with automatic Let's Encrypt certificate provisioning. -
beszel: Runs the Beszel hub, which stores metrics inbeszel_dataand serves the dashboard on internal port 8090. Traefik routes the domain to this port over HTTPS, and the loopback publish on127.0.0.1:8090lets the host-networked agent reach the hub locally. -
beszel-agent: Runs the Beszel agent with host networking so it can read the host's system metrics, and mounts the Docker socket read-only to collect container metrics. It listens on the shared Unix socket at/beszel_socket/beszel.sockand authenticates to the hub with theKEYandTOKENvalues.
3. Start all services in detached mode:
$ docker compose up -d
4. Verify that all containers are running:
$ docker compose ps
The beszel-traefik and beszel containers show a running status. The beszel-agent container restarts repeatedly at this stage because no BESZEL_KEY is set yet, which is expected. You provide the BESZEL_KEY and BESZEL_TOKEN in the next section, after which the agent starts and connects.
For more information on managing a Docker Compose stack, see the How to Use Docker Compose article.
Access and Configure Beszel
After deployment, access the hub through your domain, create the administrator account, and connect the agent by adding the local server as the first monitored system.
1. Open the hub in a web browser. Replace beszel.example.com with your configured domain:
https://beszel.example.com
2. Create the admin account. On the first visit, the hub displays the account creation screen. Enter an Email and a Password, enter the password again in Confirm password, then click Create account.
3. Open the Add System dialog. After signing in, click Add System.
4. Name the system. Enter a Name for the server (for example, local-server), and set the Host / IP to the agent's socket path /beszel_socket/beszel.sock.
5. Copy the credentials. Copy the Public Key and Token shown in the dialog box. These are the values the agent needs to authenticate with the hub. The Public Key stays the same for the hub, but the dialog generates a new Token each time it opens, so copy the token from the same dialog you use to save the system.
6. Save the system. Click Add System. The system appears in the dashboard, and the hub accepts the agent connection only for the saved token.
7. Open the .env file:
$ nano .env
8. Paste the copied values into BESZEL_KEY and BESZEL_TOKEN, respectively:
BESZEL_KEY="ssh-ed25519 AAAA..."
BESZEL_TOKEN=00000000-0000-0000-0000-000000000000
Save and close the file.
9. Recreate the agent container to apply the new credentials:
$ docker compose up -d beszel-agent
10. Confirm the connection. Return to the dashboard and confirm that the system changes to green within a minute, indicating that the agent has connected to the hub and is reporting metrics.
Monitor System Performance and Configure Alerts
Beszel provides visibility into the health and performance of monitored systems, helping you understand current resource usage and identify potential issues over time.
Review System and Container Metrics
1. Open the system detail page. On the dashboard, click the monitored system.
2. Review the live charts. Check CPU Usage, Memory Usage, Disk Usage, and Bandwidth. The All Containers table lists per-container CPU and memory usage.
View Historical Metrics
1. Change the time range. Use the time-range selector at the top of the detail page to switch between ranges such as 1 hour, 12 hours, 1 week, and 30 days.
2. Confirm the charts redraw. The charts show the metric history for the selected range, so you can spot trends and past resource spikes.
Configure and Verify an Alert
1. Open the Alerts panel. On the dashboard, click the bell icon on the system's row.
2. Enable an alert. Enable an alert, such as CPU Usage, then set a threshold percentage and the duration. The value must stay above the threshold before the alert triggers. The panel also provides alerts for Status, Memory, Disk, Bandwidth, GPU, Temperature, and other metrics.
3. Close the panel. Click Close. Beszel saves alert settings automatically when you change them.
4. Verify the alert behavior. When the monitored value stays above the threshold for the configured duration, the alert appears under Active Alerts at the top of the dashboard.
To deliver alert notifications by email or to a service such as a webhook, configure a notification channel in the hub settings. Without a configured channel, alerts are still recorded and shown in the dashboard.
Next Steps
Beszel is running and served securely over HTTPS. From here you can:
- Install the Beszel agent on additional servers and add them as monitored systems in the hub
- Configure an email or webhook notification channel so alerts reach you outside the dashboard
- Tune alert thresholds and durations for CPU, memory, disk, and bandwidth on each system
- Review the official Beszel documentation for advanced configuration
For the full guide with additional tips, visit the original article on Vultr Docs.
Top comments (0)