Beszel
Installation
Beszel is composed of two parts: - one hub (you need only one) - Agents (you need one for each system that you want to monitor)
Installation - hub
I will show you how to install Beszel Hub on your server. There is no need to use a container for this, as Beszel is provided with an easy to deploy prebuilt binary.
You should create a specific user to run the hub, as it does not require any administrative. The home folder should be under /opt/beszel because this is not a normal daemon, and we want to be sure it will always work even if the other filesystems are not mounted:
useradd -d /opt/beszel -m beszel
Now, su to the beszel user and download the hub binary:
su - beszel wget https://github.com/henrygd/beszel/releases/download/v0.9.1/beszel_linux_amd64.tar.gz tar xvf beszel_linux_amd64.tar.gz
of course, download the correct binary for your platform. Make sure you _dont_ get the Agent binary, but the other binary. There is no hub on the filename.
Done, the hub is installed. To run it, see below, now you should install some agents.
Installation - agent
There are many different possibilities to install the agent. The easiest is to run directly the binary, as for the hub, but if you have Home Assistant, there is also an agent for Home Assistant, see this page for more details.
Now, the agent should run as root because it needs to access hardware information and details from your system, so download the agent binary:
cd /opt/beszel wget 'https://github.com/henrygd/beszel/releases/download/v0.9.1/beszel-agent_linux_amd64.tar.gz' tar xvf beszel-agent_linux_amd64.tar.gz
of course, download the correct binary for your platform. For safety reasons, it's a good idea to download as the beszel user you created for the hub itself, if you are on the hub.
Running Beszel network
Running the Hub
The hub needs to run as beszel user and will provide a nice web UI, that you will need to protect behind your reverse proxy.
To run the gub, create the following startup script under /etc/init.d/beszel-hub:
- beszel-hub
#!/sbin/openrc-run # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 export DISABLE_PASSWORD_AUTH=true description="Beszel Monitor Hub" pidfile="/run/beszel-hub.pid" command_background=true command="/opt/beszel/beszel" command_args="serve --dir /opt/beszel/beszel_data --http 127.0.0.1:8099" command_user="beszel:beszel" depend() { need net }
make it executable, run it and add to the default runlevel:
chmod +x /etc/init.d/beszel-hub rc-update add beszel-hub default rc-service beszel-hub start
Before you can access the web UI at this point you need to setup the NGINX reverse proxy
Proxying the Hub
Since you already have your reverse proxy linked with your SSO, just plug Beszel hub web GUI to it and you are all set to go:
- beszel.conf
not yet implemented, see below
It is currently not possible to serve Beszel under a subpath, but a fix sohul be coming shortly, see here.
proxy the hub
Running the Agent
For Agents on other servers or Home Assistant, refer to the specific configurations. This will refer to running the agent on the same server as the hub. This is needed to monitor the hub server itself.
To run the gub, create the following startup script under /etc/init.d/beszel-hub:
- beszel-hub
#!/sbin/openrc-run # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 export PORT=45877 export KEY=put_here_your_unique_key description="Beszel Monitor Agent" pidfile="/run/beszel-agent.pid" command_background=true command="/opt/beszel/beszel-agent" command_args="" command_user="beszel:beszel" depend() { need net }
Please note that the KEY= row is very important and it should be exactly the same string (including the ssh-ed2551 or similar string at the beginning) as reported in the web UI when adding a new node.
make it executable, run it and add to the default runlevel:
chmod +x /etc/init.d/beszel-agent rc-update add beszel-agent default rc-service beszel-agent start
Usage of Beszel
Now, you need to head to the proxied web page…