VPSFolio

2026-12-01 · monitoring · docker · self-hosting · devops

Self-Host Beszel with Docker: Lightweight Server Monitoring Hub

Run Beszel hub in Docker to monitor CPU, memory, disk, Docker stats, and alerts with historical charts. Includes reverse proxy and backup steps.

Bench run · 2026-12-01 Verified
henrygd/beszel
Total RAM
16.3 MB
Startup
45.4 s
Port
8090
HTTP
200
henrygd/beszel:latest · 1 container · henrygd/beszel

What Beszel does and what it needs

Beszel is a lightweight server monitoring platform built on PocketBase. It ships two components: a hub (the web UI and database) and an agent (a small Go binary that runs on each monitored host and pushes metrics to the hub). The hub stores historical CPU, memory, disk, network, temperature, GPU, S.M.A.R.T., and Docker container stats, and fires alerts through many notification providers.

The upstream project does not publish a minimum memory figure. In practice the hub is tiny at idle (a few tens of MB) and grows with the number of connected agents and the retention window of historical data. Plan for more RAM if you monitor many hosts or keep long histories.

The hub listens on port 8090 and persists everything under /beszel_data inside the container. That directory is the only state you must back up.

Prerequisites, ports, and volume constraints

  • A Linux VPS with Docker Engine and the Compose plugin installed.
  • Port 8090 available on the host. We bind it to 127.0.0.1 so a reverse proxy can terminate TLS; the app is never exposed unencrypted on the public IP.
  • A named volume for /beszel_data. Do not use a bind mount to an arbitrary host path — a named volume keeps permissions and backups predictable.
  • If you want to monitor the same host that runs the hub, you also need the henrygd/beszel-agent container. The official docs show a host-network agent with a shared unix socket at /beszel_socket/beszel.sock. That is optional and separate from the hub stack below.

Create the project directory:

mkdir -p ~/beszel && cd ~/beszel

Production Docker Compose setup

Write the Compose file. It uses the official henrygd/beszel image, a named volume, a healthcheck, and an APP_URL you can override from .env.

cat <<'EOF' > compose.yml
services:
  beszel:
    image: henrygd/beszel:latest
    container_name: beszel
    restart: unless-stopped
    environment:
      APP_URL: ${APP_URL:-http://localhost:8090}
      TZ: ${TZ:-UTC}
    ports:
      - "127.0.0.1:8090:8090"
    volumes:
      - beszel_data:/beszel_data
    healthcheck:
      test: ["CMD", "/beszel", "health", "--url", "http://localhost:8090"]
      interval: 120s
      start_period: 10s
      timeout: 5s

volumes:
  beszel_data:
EOF

Now create .env. APP_URL must match the public URL users will hit — including https:// and the domain when behind a proxy. Generate a random value for any secret you add later; for the hub itself there is no required secret, but keep the file private anyway.

cat <<'EOF' > .env
APP_URL=https://monitor.example.com
TZ=UTC
EOF
chmod 600 .env

Start the stack:

docker compose up -d
docker compose ps

Open the URL you set in APP_URL (or http://127.0.0.1:8090 via SSH tunnel while testing) and create the first admin account. That first signup becomes the administrator — do it immediately after boot, before exposing the port publicly.

To test without a domain, tunnel the loopback port over SSH:

ssh -L 8090:127.0.0.1:8090 user@your-vps
# then browse http://localhost:8090

Reverse proxy, HTTPS, and first-run hardening

Beszel is a normal HTTP app behind PocketBase. It does not require WebSocket upgrade headers for the dashboard, but it does use long-lived HTTP connections for live charts, so make sure your proxy does not buffer or time out aggressively. Keep proxy_read_timeout at 60s or more.

Caddy example (/etc/caddy/Caddyfile):

monitor.example.com {
    encode gzip
    reverse_proxy 127.0.0.1:8090 {
        header_up X-Forwarded-Proto {scheme}
        header_up X-Forwarded-For {remote_host}
    }
}

Nginx example:

server {
    listen 443 ssl http2;
    server_name monitor.example.com;

    location / {
        proxy_pass http://127.0.0.1:8090;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 120s;
        client_max_body_size 32m;
    }
}

After the proxy is live, update .env so APP_URL matches the public HTTPS URL, then docker compose up -d to apply it. PocketBase uses APP_URL for links in emails and OAuth redirects; a mismatch breaks password resets and OAuth logins.

First-run hardening checklist:

  1. Create the admin account immediately after the first boot.
  2. In Settings → Backups, enable automatic backups to disk or S3-compatible storage.
  3. If you plan to use OAuth/OIDC, configure it in Settings → Auth and disable password auth once it works.
  4. Add agents from Add System in the UI. Each agent needs the hub URL, a token, and the hub’s public key — copy them from the UI, not from memory.
  5. Keep port 8090 bound to 127.0.0.1. Never publish it directly to the internet.

Updating, backups, and common pitfalls

Update the hub:

cd ~/beszel
docker compose pull
docker compose up -d
docker image prune -f

Back up the data volume. The cleanest method is the built-in backup feature at /#/settings/backups, which can write to disk or S3. For a raw volume snapshot, stop the container first so PocketBase’s SQLite file is consistent:

docker compose stop beszel
docker run --rm \
  -v beszel_beszel_data:/data \
  -v "$PWD":/backup \
  alpine tar czf /backup/beszel-$(date +%F).tar.gz -C /data .
docker compose start beszel

Restore by stopping the container, extracting the archive back into the volume, and starting again.

Two pitfalls worth knowing:

  • APP_URL mismatch. If you change domains or move from HTTP to HTTPS, update APP_URL in .env and restart. Otherwise OAuth callbacks and password-reset links point at the wrong host.
  • Agent connectivity. The agent must reach the hub at the URL you configure. If the hub is behind a proxy, use the public HTTPS URL for HUB_URL on the agent, not http://localhost:8090. When the agent runs on the same host, the official docs recommend the shared unix socket path /beszel_socket/beszel.sock as the Host/IP in the UI to avoid loopback networking issues.

If you later add the local agent, remember it needs KEY and TOKEN from the hub UI, and the agent container must be restarted after you paste them in.


Measured in our sandbox run: total memory 16.3 MB (sum of per-container peaks over a 30s idle window after startup) across 1 container; largest container 16.3 MB; published port(s) 8090; HTTP probe returned 200. The run took 45.4s including the image download.


Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.