How to setup beszel (with Docker & Caddy)
Ready to use
Description
Beszel is a lightweight server monitoring tool that consists of a hub (web interface) and agents (for monitoring servers).
The setup provides a clean monitoring solution with Docker container stats, system metrics, and a web-based dashboard for managing multiple servers.
Create a DNS record (optional)
Warning
Remember!
Whenever you expose your services to the outside world, you open up the possiblity of an attack by hackers.
Only expose to the outside world the services you actually need to access when you're away from home.
You probably won't need to access Beszel from outside the network too often.
So you probably shouldn't make it available outside of your network.
But if you do, then go to cPanel and add a new record (e.g. beszel.akdscloud.eu).
Caddy
beszel.akdscloud.eu:443 {
header Strict-Transport-Security max-age=31536000;
reverse_proxy localhost:6767
}
Folders
Create the folder structure.
Docker
-
Add the
beszelsection to yourdocker-compose.ymlfile:beszel: image: henrygd/beszel:latest container_name: beszel-hub restart: unless-stopped ports: - "8090:8090" volumes: - ./beszel/beszel_data:/beszel_data - ./beszel/beszel_socket:/beszel_socket environment: - TZ=Europe/Bucharest # Optional: Disable user registration after first user # - DISABLE_REGISTRATION=true -
Start the
beszelservice: -
Access the web interface
See if you can access the beszel web interface at http://localhost:8090.
If you can't check out the logs:
See if there are any errors and fix them.
-
Admin account
Create an admin account from the web interface (first user becomes admin).
-
Add the local Beszel agent
- In the Beszel web interface, go to "Systems" and click "Add System"
- Give it a name (e.g. System)
- Click on
Copy docker-compose - Add system
Don't worry!
Beszel will probably not show anything at this point.
This is ok!
We haven't set up the monitoring agent yet. -
Add the agent to
docker-compose.ymlEdit your
docker-compose.ymland add another service afterbeszelby simply pasting (what you copied from theAdd systemdialog)It should look like this:
beszel-agent: image: "henrygd/beszel-agent" container_name: "beszel-agent" restart: unless-stopped network_mode: host volumes: - /var/run/docker.sock:/var/run/docker.sock:ro # monitor other disks / partitions by mounting a folder in /extra-filesystems # - /mnt/disk/.beszel:/extra-filesystems/sda1:ro environment: LISTEN: 45876 KEY: "ssh-ed25519alotofrandomletters" -
Start the agent:
-
Check if everything is working
Now go back to the web interface and refresh the page.
It should work now.
If not, restart both docker services.
Troubleshooting
If it still doesn't work, see the troubleshooting guide.
Configuration
Disable registration
If you want to prevent new user registrations, go to the docker-compose.yml file and uncomment the DISABLE_REGISTRATION line.
After that,
Security Notes
- Make sure to secure your hub with proper authentication
- Consider using a reverse proxy with SSL for production deployments
- The agent needs network access to communicate with the hub