245 字
1 分钟

Deploying Beszel Lightweight Monitoring with Docker

Last week while browsing Reddit I stumbled across this project, which focuses on lightweight monitoring. You can think of it as a smaller-scale Prometheus-style stack, with features like automatic backups to S3, monitoring, Docker stats, and more. Deployment is straightforward: you can use either Docker or a systemctl-based setup.

Panel Deployment & Installation#

Create the directory#

Terminal window
mkdir -p /root/docker/beszel

docker-compose.yaml file#

Terminal window
services:
beszel:
image: 'henrygd/beszel'
container_name: 'beszel'
restart: unless-stopped
ports:
- '8090:8090'
volumes:
- ./beszel_data:/beszel_dat

Run#

Terminal window
docker compose up -d

Panel configuration#

Enter the target host IP and display name you want to monitor#

Agent Installation#

Download the Agent binary#

Terminal window
curl -sL "https://github.com/henrygd/beszel/releases/latest/download/beszel-agent_$(uname -s)_$(uname -m | sed 's/x86_64/amd64/' | sed 's/armv7l/arm/' | sed 's/aarch64/arm64/').tar.gz" | tar -xz -O beszel-agent | tee ./beszel-agent >/dev/null && chmod +x beszel-agent && ls beszel-agent

Create a systemd service#

Terminal window
sudo vim /etc/systemd/system/beszel-agent.service

Service unit file#

Terminal window
[Unit]
Description=Beszel Agent
After=network.target
[Service]
Environment="PORT=45876" ## your port
Environment="KEY=ssh-ed25519 A" ## your key
ExecStart=/root/docker/beszel/beszel-agent ## your agent binary path
Restart=always
User=root
WorkingDirectory=/root/docker/beszel ## your working directory
[Install]
WantedBy=multi-user.target

Reload systemd configuration#

Terminal window
sudo systemctl daemon-reload
sudo systemctl start beszel-agent
sudo systemctl enable beszel-agent

Check the service status#

Terminal window
sudo systemctl status beszel-agent

Check whether the panel is receiving data#

Deploying Beszel Lightweight Monitoring with Docker
https://catcat.blog/en/docker-install-beszel.html
作者
猫猫博客
发布于
2024-08-05
许可协议
CC BY-NC-SA 4.0