Beszel: single host agent
Beszel combines a monitoring server and agent in one Docker container, ideal for local host oversight without external dependencies. This guide walks through Docker Compose setup, key retrieval, firewall considerations, and health checks for a standalone deployment.
Installation via Docker Compose
Create docker-compose.yml in your working directory:
Apply the configuration:
After startup the container listens on HTTP port 8080 and UDP 2000 for agent communication. Config volume and database footprint are minimal, typical for this class of self‑hosted tools.
First launch and key retrieval
Open http://<host-ip>:8080 in a browser. The welcome screen shows a key input field or QR code. The key can also be fetched from the container:
or via logs:
The first run creates a local database inside the volume and generates a unique identifier for the instance. Save the key—it’s required for the next agent connection step.
Basic configuration and access
To run the agent separately (or on the same host with another container), use the same image with the KEY environment variable:
UI access remains http://host:8080. The interface lists connected agents, uptime, CPU and memory load. Timezone or log paths can be changed via env vars on container recreation.
When using SELinux or AppArmor, container labels or socket access may need adjustment. Usually a restart with --privileged suffices only for auto‑resource detection; otherwise keep standard restrictions.
Typical error: port and firewall
Access issues or missing agent data often stem from host‑system firewall blocks. Below is the typical port scheme and commands for common firewalls:
| Direction | Port | Protocol | Purpose |
|---|---|---|---|
| Incoming | 8080 | TCP | Web UI |
| In/Out | 2000 | UDP | Agent heartbeat & metrics |
UFW:
FirewallD (CentOS/RHEL):
If data still doesn’t appear, check for restrictive Docker network policies (docker network inspect) or Carrier‑Grade NAT blocking UDP traffic on the provider side.
Missing UDP access to 2000 makes the agent unavailable to the server: metrics won’t be sent and the UI may show an empty host list. Always verify the rule with sudo netstat -tulnp | grep 2000 inside the container after restart.
Check functionality
Verify containers are running and port 8080 is reachable:
A successful response returns JSON with status ok. To check the agent running separately:
In the UI you should see the host name with current CPU/memory values. If the agent is absent, repeat launch with the correct KEY and confirm the UDP‑2000 rule is active on the host.
A quick availability check script: