How to Install Beszel on a VPS with Docker for Lightweight Server Monitoring

The problem usually announces itself too late
Most VPS headaches do not start dramatically. They start quietly: logs pile up until disk space thins out, one container slowly eats more memory than it should, and then a site stops responding at the worst possible hour. You fix it and promise to check more often — until a different server pulls the same trick a week later.
Checking servers one terminal at a time works for a single box. With three or five, it slips down the list. What you need is one place answering three questions at any moment: which server is strained, which resource is low, and which container is responsible.
That is the gap Beszel fills. It uses a hub-and-agent design: one hub serves the dashboard, and a small agent runs on every machine you want to watch. Each agent reports CPU, memory, disk, network, and container statistics to the hub, which keeps them as history graphs, with no queries to write and no dashboards to assemble by hand.
This guide walks through installing Beszel with Docker, from the hub on your main server to an agent on a second machine, plus threshold alerts and the steps that keep dashboard access safe. By the end you will have one dashboard for a small fleet, and notifications that arrive before a disk actually fills up.
What Beszel is, and what it is not
Beszel is a resource monitor, and its narrow focus is the point. It answers one question well: how hard is this server working right now, and what has the trend looked like over the past week? Every system you add gets a card showing CPU, memory, disk, load, and network, and opening a card reveals graphs by the hour, day, and week. On a Docker host it also lists per-container CPU and memory, so the container hogging RAM is one click away.
It helps to place Beszel next to the tools you may already know, because they solve different problems. Prometheus paired with Grafana is powerful at large scale, but it asks you to do the assembly: exporters, scrape rules, and dashboards built by hand. Uptime Kuma answers a different question entirely, namely whether a site or service is reachable from the outside. Beszel replaces neither of them. It replaces the habit of opening five terminals to run a system monitor on each box.
| Aspect | Beszel | Prometheus + Grafana | Uptime Kuma |
|---|---|---|---|
| Core question | How loaded are this server's resources? | Any metric you define yourself | Is this service still reachable? |
| Parts to install | A hub plus one agent per server | Prometheus, exporters, Grafana, and dashboards | A single uptime checker |
| Setup effort | Low, add systems through the UI | High, queries and dashboards assembled manually | Low, add monitors through the UI |
| Per-container Docker stats | Yes, automatic from the Docker socket | Yes, but needs an exporter and a dashboard | Not its job |
| Best fit | A few VPS boxes run by one person or a small team | Large infrastructure with custom metric needs | Checking whether sites and services are up |
Beszel still earns its keep on a single VPS, but the payoff grows the moment a second and third server join. One hub, many agents, and no more guessing which machine is in trouble.
Prerequisites
Pick one VPS to host the hub, with Docker and Docker Compose already installed. This guide uses the docker compose syntax (with a space), not the older docker-compose command. Leave some spare disk for history data in the beszel_data volume.
Next, list the servers you plan to watch. Each target needs Docker if you go with the container agent, or root access for the binary installer script if it does not run Docker. Note down the hub address agents will connect to, such as a domain pointing at the hub server or its public IP, with a port if needed.
Two port numbers will keep coming up, so get them straight early. Port 8090 is the hub's web port, where you open the dashboard. Port 45876 is the agent's listen port.
Finally, keep the system clock in sync on every machine, since history graphs and duration-based alerts rely on accurate time. On a systemd-based system, this shows the sync status:
timedatectl status
Look for System clock synchronized: yes. If it is not synced, fix time synchronization before going further.
Step 1: Run the Beszel hub with Docker Compose
Create a dedicated directory for the hub so its Compose file and data volumes stay separate from your other stacks:
mkdir beszel cd beszel
Create a docker-compose.yml with the following content. It runs the hub together with a local agent for the hub server itself, so your first machine is monitored with no extra install step:
services:
beszel:
image: henrygd/beszel:latest
container_name: beszel
restart: unless-stopped
environment:
APP_URL: http://localhost:8090
ports:
- 8090:8090
volumes:
- ./beszel_data:/beszel_data
- ./beszel_socket:/beszel_socket
beszel-agent:
image: henrygd/beszel-agent:latest
container_name: beszel-agent
restart: unless-stopped
network_mode: host
volumes:
- ./beszel_agent_data:/var/lib/beszel-agent
- ./beszel_socket:/beszel_socket
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
LISTEN: /beszel_socket/beszel.sock
HUB_URL: http://localhost:8090
TOKEN: <token>
KEY: "<key>"Three details in this file deserve attention rather than a blind copy. First, APP_URL must be the address you actually use to reach the hub, such as a domain or a public IP with a port if needed. It shapes the links and callbacks the hub generates, so changing it later means editing the file and recreating the container.
Second, the local agent does not listen on a TCP port here. It uses a Unix socket at /beszel_socket/beszel.sock, shared between the two containers, because localhost inside one container does not point at the other.
Third, mounting /var/run/docker.sock read-only is what gives Beszel its per-container statistics. Without that line, host metrics like CPU and memory still show up, but the containers tab stays empty.
The TOKEN and KEY values are still placeholders at this point. Do not invent them; the real values come from the Add System dialog in the hub UI, which you will open in the next step. Start the hub first:
docker compose up -d
Confirm both containers are up:
docker compose ps
You want running for both beszel and beszel-agent. If either keeps restarting, check its logs before changing settings at random:
docker compose logs beszel --tail 50 docker compose logs beszel-agent --tail 50
Step 2: Create the admin account and add the first system
Open the hub in a browser at http://YOUR_SERVER_ADDRESS:8090, replacing the address with your hub server's IP or domain. On the first visit, Beszel asks you to create an admin account. Choose a strong password and store it in a password manager, since this account guards the full picture of your infrastructure.
Once signed in, click Add System in the top-right corner. This dialog is the center of the whole onboarding flow, so read it carefully. For the local agent running over the shared socket, put the socket path in the Host / IP field:
/beszel_socket/beszel.sock
The dialog shows a public key and a token for this system. Copy both, go back to the hub's docker-compose.yml, and replace the TOKEN and KEY placeholders with the real values. Note the quotes around KEY: the value starts with a key type such as ssh-ed25519, and quoting keeps the whole thing parsed as a single YAML string.
Apply the change by recreating the agent container:
docker compose up -d
Back in the dashboard, finish adding the system by pressing Add System inside the dialog. If everything is right, the new system card appears and turns green. Green means the hub is talking to the agent and metrics are flowing. If the card turns red, stop there and fix the connection on this first system before adding others, because the same mistake will almost certainly repeat on the next server. The troubleshooting section at the end covers the most common causes of a red card.
Click the card for graphs of CPU, memory, disk, network, and load, plus a containers tab listing every Docker container on that host with its own CPU and memory use.
Step 3: Add an agent to a second server with Docker
Adding a second server follows nearly the same pattern, minus the shared socket. On the target server, create an agent directory and Compose file:
mkdir beszel-agent cd beszel-agent
In the hub, click Add System again for the new machine. Give it a recognizable display name, such as web-01 or db-01, and enter the target server's IP or hostname. The dialog provides a pre-filled docker-compose.yml with that system's key and token. Its general shape looks like this:
services:
beszel-agent:
image: henrygd/beszel-agent
container_name: beszel-agent
restart: unless-stopped
network_mode: host
volumes:
- ./beszel_agent_data:/var/lib/beszel-agent
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
LISTEN: 45876
KEY: "<public key>"
HUB_URL: "<hub url>"
TOKEN: "<token>"Replace every placeholder with the values from the dialog, save the file, and start it:
docker compose up -d
Note the network_mode: host line: the agent needs it to read host network interface statistics, and a side effect is that the agent port becomes exposed. For typical use, leave it exactly as the dialog provides.
HUB_URL is the hub address as reachable from the target server, not from the hub itself. If the hub sits behind a domain, use that domain. If it is only reachable by public IP, use the IP with a port if needed. The most common mistake here is entering an address that is only correct from the hub server's point of view.
Finish the Add System dialog back in the hub and wait for the new card to turn green. Repeat this step for each additional server. Every new machine adds just one small agent, not a fresh monitoring stack, which is why the hub-and-agent shape stays light as a fleet grows.
Beszel also offers a universal token under /settings/tokens since version 0.12.0 for enrolling many servers without pre-configuring each system, but treat it like a credential: anyone holding it can register agents with your hub.
Step 4: Install the binary agent on a server without Docker
Not every server runs Docker, and Beszel still covers those through a binary agent. On the target server, run the official Linux installer script:
curl -sL https://get.beszel.dev -o /tmp/install-agent.sh && chmod +x /tmp/install-agent.sh && /tmp/install-agent.sh
The script needs root privileges because it creates a beszel system user and registers the agent as a systemd service so it survives reboots. The agent process itself does not run as root. During setup, the script asks for the key, port, and token, or you can skip the prompts with flags:
/tmp/install-agent.sh -p 45876 -k "<public key>" -t "<token>" -url "<hub url>"
Here -p changes the listen port from the default 45876, -k supplies the public key from the Add System dialog, -t supplies the token, and -url supplies the hub address. The script also offers daily automatic updates; enable that only if you are comfortable with the agent updating itself outside your own maintenance schedule.
After the script finishes, check the service:
sudo systemctl status beszel-agent --no-pager
You want active (running). If it fails to start, read its logs with journalctl -u beszel-agent -n 50 --no-pager before rerunning the installer.
Step 5: Set alerts so you get told, not just able to look
A dashboard you only open after something breaks is doing half its job. Beszel lets you set per-system alerts on CPU, memory, disk, bandwidth, temperature, load, and up/down status. A conservative starting point: CPU above 90 percent for several minutes, memory above 90 percent, disk above 85 percent, and any status change to down. A busy database server needs different limits than a quiet web box.
Then set a notification channel in the hub's user settings. Beszel sends notifications through Shoutrrr, covering destinations such as Telegram, Discord, and ntfy, plus email when SMTP is configured. Pick one channel you genuinely read; an alert sent where nobody looks is no alert at all.
Trigger a check with a deliberately low threshold on one system, then restore the normal value once the first notification arrives. That short exercise saves you from the expensive discovery that notifications were never working, made on the very day a disk fills up.
Step 6: Secure hub access and back up its data
The hub holds a complete picture of your infrastructure, so do not leave port 8090 open to the internet unprotected. The simplest solid approach is a reverse proxy with HTTPS in front of it, plus access control such as proxy authentication or firewall IP restrictions. If you switch to a domain, update APP_URL in the hub Compose file to match the address used to reach it, then recreate the containers:
docker compose up -d
For backups, the thing to preserve is the beszel_data volume, where the hub stores its data. Stop the hub container first so the database file is not changing mid-copy, copy the directory, and start again:
docker compose down cp -a beszel_data beszel_data-backup-2026-10-29 docker compose up -d
Store that copy off the hub server; a backup on the same disk helps little when that disk is the problem.

Common problems and how to fix them
| Symptom | Most likely cause | Fix |
|---|---|---|
| System card red while the agent runs | Wrong key or token, or the hub cannot reach the agent | Copy the key and token fresh from the Add System dialog, check HUB_URL and port 45876 |
| Local agent never connects | Host filled with localhost instead of the socket path | Use /beszel_socket/beszel.sock as Host / IP and confirm the socket volume is mounted in both containers |
| Containers tab is empty | Docker socket not mounted into the agent | Add /var/run/docker.sock:/var/run/docker.sock:ro, then restart the agent |
| Host graphs present, network stats missing | Agent not using host network mode | Restore network_mode: host in the agent Compose file |
| Agent cannot reach the hub | HUB_URL only correct from the hub's side | Enter the hub address as reachable from the target server |
| Hub unreachable after a domain change | APP_URL still holds the old address | Update APP_URL, then run docker compose up -d |
| Alerts never arrive | Notification channel unset or threshold too high | Verify the channel in user settings and confirm with a low test threshold |
Summary
| Part | What you install | Expected result |
|---|---|---|
| Hub | henrygd/beszel:latest on port 8090 | Dashboard opens and the admin account is created |
| Local agent | henrygd/beszel-agent:latest over the socket | Hub server monitored, card green |
| Remote agent | Docker or binary agent per server | Each server appears as its own card |
| Alerts | CPU, memory, disk, and status thresholds | Notifications land in a channel you actually read |
| Protection | HTTPS reverse proxy plus a beszel_data backup | Hub not exposed raw, data recoverable |
Final checklist
- Hub containers show as running under
docker compose psand the dashboard opens on port 8090. - Admin account created and its password stored in a password manager.
- First system over
/beszel_socket/beszel.sockshows green. - Each additional server has its own agent and a green card.
- Containers tab shows per-container stats on Docker hosts.
- CPU, memory, disk, and status alerts are set and confirmed with a low test threshold.
- Notifications go to a channel you actually read.
- Hub access sits behind an HTTPS reverse proxy, not a raw port on the internet.
- A
beszel_databackup exists somewhere other than the hub server.
Which server in your fleet surprises you most often, and what alert threshold did you end up choosing for it? Share it in the comments so other readers can compare numbers for different kinds of load.
Read also: Next article in this series and How to Monitor Your VPS with Prometheus and Grafana for a picture of the larger metric stack when your needs grow beyond lightweight resource monitoring.
Diskusi
Ada pertanyaan atau pengalaman yang ingin dibagikan?
Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.
Tulis komentar