{"id":1915,"date":"2025-03-26T07:28:37","date_gmt":"2025-03-26T05:28:37","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/basic-server-monitoring-beszel\/"},"modified":"2025-03-26T07:28:37","modified_gmt":"2025-03-26T05:28:37","slug":"basic-server-monitoring-beszel","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/basic-server-monitoring-beszel\/","title":{"rendered":"How to set up basic server monitoring with Beszel on UpCloud"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Monitoring your cloud server&#8217;s health is important for maintaining performance and preventing downtime. Yet many traditional monitoring tools such as Zabbix and Grafana require complex setup and configuration. Subscription-based tools like Datadog eliminate this complexity by offering monitoring-as-a-service, but they often come with pricing models that quickly add up as you scale.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In any case, both approaches are often overkill for basic server monitoring requirements, and this is where Beszel comes in.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-124-1024x418.png\" alt=\"-\" class=\"wp-image-48890\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/beszel.dev\" target=\"_blank\" rel=\"noopener\">Beszel<\/a> is a lightweight, open-source monitoring tool created for developers and system admins who need a simple way to monitor server resources. It removes unnecessary complexity and offers an intuitive architecture that is easy to deploy and maintain. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Beszel can monitor the following server metrics:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>CPU usage<\/strong>&nbsp;<\/li>\n\n\n\n<li><strong>Memory usage<\/strong>&nbsp;<\/li>\n\n\n\n<li><strong>Disk usage<\/strong>&nbsp;<\/li>\n\n\n\n<li><strong>Disk I\/O<\/strong>&nbsp;<\/li>\n\n\n\n<li><strong>Network usage<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Beszel operates on a simple two-component system:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Hub<\/strong> serves as the command centre for your monitoring infrastructure. It collects and visualises monitoring data from all your servers, stores historical metrics, manages alert thresholds, and provides a unified dashboard for your entire environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Agents<\/strong> are lightweight processes installed on each server you wish to monitor. They collect system metrics (CPU, memory, disk usage, network traffic) and relay this information back to the Hub. Agents require minimal resources and have no dependencies, making them ideal for deployment on production systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the Beszel Hub<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are&nbsp;<a href=\"https:\/\/beszel.dev\/guide\/hub-installation\" target=\"_blank\" rel=\"noreferrer noopener\">several ways<\/a>&nbsp;to install the Beszel Hub, but the easiest is to use the official quick installation script. This script installs the latest binary and creates a systemd service to keep it running after reboots. To install the Beszel Hub using the script, run the command below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl &#45;sL https&#58;&#47;&#47;raw&#46;githubusercontent&#46;com&#47;henrygd&#47;beszel&#47;main&#47;supplemental&#47;scripts&#47;install&#45;hub&#46;sh &#45;o install&#45;hub&#46;sh &#38;&#38; chmod &#43;x install&#45;hub&#46;sh &#38;&#38; &#46;&#47;install&#45;hub&#46;sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The installation process is relatively quick and should end with a success message showing you which port the service is running on. By default, Beszel Hub runs on port 8090.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">...\nLoading and starting the Beszel Hub service...\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/beszel-hub.service \u2192 \/etc\/systemd\/system\/beszel-hub.service.\nThe Beszel Hub has been installed and configured successfully! It is now accessible on port 8090.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To access the Hub, enter your server&#8217;s IP address in your browser&#8217;s address bar, followed by the Beszel port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">http:\/\/&lt;SERVER-IP-ADDRESS&gt;:8090<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On the first visit, you&#8217;ll be prompted to create a local admin account, which you&#8217;ll use to manage your Beszel installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-115-1024x518.png\" alt=\"-\" class=\"wp-image-48880\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After logging in, you&#8217;ll be presented with an empty Hub dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-117-1024x433.png\" alt=\"-\" class=\"wp-image-48882\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Adding an agent<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To monitor an existing cloud server, you&#8217;ll need to add an agent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click the &#8220;Add system&#8221; button in the top right corner, then switch to the &#8220;binary&#8221; tab in the popup window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter a name for the server you wish to monitor and its IP address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For increased security, it is recommended to use the server&#8217;s <a href=\"https:\/\/upcloud.com\/global\/docs\/products\/networking\/utility-network\/\">utility network<\/a> IP address rather than its public IPv4 address. The utility network is a private, account-wide secure connection that automatically links all your Cloud Servers across data centres. By using this network for your traffic, you keep your monitoring communications isolated from the public internet, reducing potential attack vectors. You can find your server&#8217;s utility IP address in the server&#8217;s Networking tab in the <a href=\"https:\/\/hub.upcloud.com\/server\">UpCloud Control Panel<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can leave the port as the default value (45876). This port establishes communication between your Hub and agent. Feel free to change it if needed, but make sure the port isn&#8217;t blocked by your firewall.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-119-1024x560.png\" alt=\"-\" class=\"wp-image-48884\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, click &#8220;Copy Linux command&#8221; to view the installation command for the agent component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Copy this command to your clipboard, close the window, and click &#8220;Add system&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, connect to the server you want to monitor via SSH. Once connected, paste the copied command into your terminal&nbsp;to start the installation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">install-agent.sh &amp;&amp; .\/install-agent.sh -p 45876 -k \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHq+HgsmMu8s1ugJwvygli0+n3RanqZ9BGpKKK7TSx\/2\"\nCreating a dedicated user for the Beszel Agent service...\nusermod: group 'docker' does not exist\nCreating the directory for the Beszel Agent...\nDownloading and installing the agent...\nDownloading and installing agent version 0.10.2 from https:\/\/github.com ...\n######################################################################################################## 100.0%\nCreating the systemd service for the agent...\nLoading and starting the agent service...\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/beszel-agent.service \u2192 \/etc\/systemd\/system\/beszel-agent.service.\n...\n...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When prompted during installation, type &#8216;<strong>y<\/strong>&#8216; and press Enter to enable automatic daily updates for the beszel-agent.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Would you like to enable automatic daily updates for beszel-agent? (y\/n): y\nSetting up daily automatic updates for beszel-agent...\nCreated symlink \/etc\/systemd\/system\/timers.target.wants\/beszel-agent-update.timer \u2192 \/etc\/systemd\/system\/beszel-agent-update.timer.\n\nAutomatic daily updates have been enabled.\n\nBeszel Agent has been installed successfully! It is now running on port 45876.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After installation, the agent&#8217;s status in the Beszel Hub will initially show &#8220;down&#8221; (red dot). Once the installation is complete and the agent successfully connects to the Hub, the status will change to &#8220;up&#8221; (green dot). Your server metrics should begin appearing in the dashboard within a few minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the status doesn&#8217;t change after a while, you might need to verify that both servers can communicate with each other. In particular, ensure that the selected port (default 45876) isn&#8217;t being blocked by your firewall.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-125-1024x279.png\" alt=\"-\" class=\"wp-image-48894\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-121-1024x909.png\" alt=\"-\" class=\"wp-image-48886\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Firewalls for Beszel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Beszel uses a hub-agent architecture, so specific ports must be opened to allow proper communication. For it to function properly, you need to allow:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Hub:<\/strong>&nbsp;Incoming connections on port 8090 for web dashboard access<\/li>\n\n\n\n<li><strong>Agents:<\/strong>&nbsp;Incoming connections on port 45876 for the Hub to collect metrics<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Monitoring multiple storage devices<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For servers with multiple storage devices, such as those separating system files from application data, Beszel lets you monitor each disk individually.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-123-1024x329.png\" alt=\"-\" class=\"wp-image-48888\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Before configuring Beszel to monitor additional storage devices, you first need to identify the disks and partitions on your system. Use the&nbsp;<strong>lsblk<\/strong>&nbsp;command to list all block devices:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">lsblk<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS\nvda    253:0    0  25G  0 disk\n\u251c\u2500vda1 253:1    0   1M  0 part\n\u2514\u2500vda2 253:2    0  25G  0 part \/\nvdb    253:16   0  50G  0 disk\n\u2514\u2500vdb1 253:17   0  50G  0 part \/mnt\/data<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The example <strong>lsblk<\/strong> output above shows a server with two disks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>vda&nbsp;&#8211; a 25GB disk with the root partition (vda2)<\/li>\n\n\n\n<li>vdb&nbsp;&#8211; a 50GB disk with one partition (vdb1) mounted at&nbsp;\/mnt\/data<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To monitor multiple disks, you need to modify the agent&#8217;s service configuration. Beszel uses two key environment variables for disk monitoring:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FILESYSTEM&nbsp;&#8211; Specifies which device or partition to use for the main &#8220;Disk Usage&#8221; panel<\/li>\n\n\n\n<li>EXTRA_FILESYSTEMS&nbsp;&#8211; Specifies additional disks or partitions to monitor.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s better to monitor specific partitions (like&nbsp;vda2,&nbsp;vdb1), but you can also use mount points (like&nbsp;\/&nbsp;or&nbsp;\/mnt\/data) instead of device names<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the server being monitored, edit the beszel-agent service file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo nano \/etc\/systemd\/system\/beszel-agent.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the&nbsp;<strong>[Service]<\/strong>&nbsp;section and add or modify the environment variables:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">[Service]\nEnvironment=\"FILESYSTEM=vda2\"         # our main partition\nEnvironment=\"EXTRA_FILESYSTEMS=vdb1\"  # our extra partition<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>vda2&nbsp;is set as the primary disk (the root partition)<\/li>\n\n\n\n<li>vdb1&nbsp;is set as an additional disk to monitor<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">After modifying the service file, reload the systemd configuration and restart the beszel-agent:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">sudo systemctl daemon-reload\nsudo systemctl restart beszel-agent<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the agent restarts, return to your Beszel Hub dashboard. You should now see separate panels for each disk:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The main &#8220;Disk Usage&#8221; panel showing your root partition (vda2)<\/li>\n\n\n\n<li>Additional panels for each extra disk (e.g., &#8220;vdb1 Usage&#8221;)<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/image-122-907x1024.png\" alt=\"server monitoring with beszel\" class=\"wp-image-48887\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each disk will also have its own I\/O monitoring panel showing read\/write activity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t see the additional disks right away, give it a few minutes for the metrics to collect and display.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you have successfully set up your Beszel Hub, you can access it using your server&#8217;s Public IPv4 address on the default port 8090. As a next step you can consider setting up a reverse proxy to allow you to access the app securely over https using a domain name instead of an IP address and port number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more advanced features and configuration options, check out the <a href=\"https:\/\/beszel.dev\/guide\/what-is-beszel\" target=\"_blank\" rel=\"noopener\">official Beszel documentation<\/a>, which includes detailed guides and best practices. You can also stay up to date with the latest features, by following the project on <a href=\"https:\/\/github.com\/henrygd\/beszel\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"author":23,"featured_media":48908,"comment_status":"open","ping_status":"closed","template":"","community-category":[223],"class_list":["post-1915","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1915\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=1915"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}