Agent Installation
Beszel Agent supports installation via Docker / Podman, single binary file, Homebrew package, Scoop package, or Home Assistant add-on.
TIP
Check the Getting Started guide if you're setting up Beszel for the first time.
Requirements
If the agent and hub are on different hosts, you may need to update the firewall on your agent system to allow incoming TCP connections on the agent's port.
Alternatively, use software like WireGuard, Tailscale (video instructions), Cloudflare Tunnel (instructions), or Pangolin to securely bypass the firewall.
Using the Hub
The docker-compose.yml
or binary install command is provided for copy/paste in the hub's web UI when adding a new system.

Docker or Podman
TIP
Preconfigured docker-compose.yml
content can be copied the hub's web UI when adding a new system, so in most cases you do not need to set this up manually.
services:
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/disk1/.beszel:/extra-filesystems/disk1:ro
environment:
LISTEN: 45876
KEY: '<public key>'
docker run -d \
--name beszel-agent \
--network host \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-e KEY="<public key>" \
-e LISTEN=45876 \
henrygd/beszel-agent:latest
podman run -d \
--name beszel-agent \
--network host \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-e KEY="<public key>" \
-e LISTEN=45876 \
docker.io/henrygd/beszel-agent:latest
Why host network mode?
The agent must use host network mode to access the host's network interface stats. This automatically exposes the port, so change the port using an environment variable if needed.
If you don't need host network stats, you can remove that line from the compose file and map the port manually.
When connecting to a local agent, localhost
will not work because the containers are in different networks. See the Getting Started guide for an example of how to connect using a unix socket.
Binary
Beszel is written in pure Go and can be easily compiled (or cross-compiled) if a prebuilt binary isn't available.
1. Linux install script
Root privileges required
The script needs root privileges to create a beszel
user and set up a service to keep the agent running after reboot. The agent process itself does not run as root.
The script installs the latest binary and optionally enables automatic daily updates.
-k
: Public key (enclose in quotes; interactive if not provided)-p
: Port or address (default: 45876)-u
: Uninstall--auto-update
: Enable or disable automatic daily updates (interactive if not provided)--china-mirrors
: Use GitHub mirror to resolve network issues in mainland China-h
: Show help
curl -sL https://get.beszel.dev -o /tmp/install-agent.sh && chmod +x /tmp/install-agent.sh && /tmp/install-agent.sh
2. Manual download and start (Linux, FreeBSD, others)
Click to expand/collapse
Download the binary
Download the latest binary from releases that matches your server's OS / architecture.
curl -sL "https://github.com/henrygd/beszel/releases/latest/download/beszel-agent_$(uname -s)_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/armv6l/arm/' -e 's/armv7l/arm/' -e 's/aarch64/arm64/').tar.gz" | tar -xz -O beszel-agent | tee ./beszel-agent >/dev/null && chmod +x beszel-agent
Start the agent
Use -h
to see all available options.
./beszel-agent -listen "45876" -key "<public key>"
Update the agent
./beszel-agent update
Create a service (optional)
If your system uses systemd, you can create a service to keep the agent running after reboot.
- Create a service file in
/etc/systemd/system/beszel-agent.service
.
[Unit]
Description=Beszel Agent Service
After=network-online.target
Wants=network-online.target
[Service]
ExecStart={/path/to/working/directory}/beszel-agent
Environment="LISTEN=$LISTEN"
Environment="KEY=$KEY"
# Environment="EXTRA_FILESYSTEMS=sdb"
Restart=on-failure
RestartSec=5
StateDirectory=beszel-agent
# Security/sandboxing settings
KeyringMode=private
LockPersonality=yes
NoNewPrivileges=yes
ProtectClock=yes
ProtectHome=read-only
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectSystem=strict
RemoveIPC=yes
RestrictSUIDSGID=true
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
- Enable and start the service.
sudo systemctl daemon-reload
sudo systemctl enable beszel-agent.service
sudo systemctl start beszel-agent.service
3. Manual compile and start (any platform)
Click to expand/collapse
Compile
See Compiling for information on how to compile the agent yourself.
Start the agent
Use -h
to see all available options.
./beszel-agent -listen "45876" -key "<public key>"
Update the agent
./beszel-agent update
Create a service (optional)
If your system uses systemd, you can create a service to keep the agent running after reboot.
- Create a service file in
/etc/systemd/system/beszel-agent.service
.
[Unit]
Description=Beszel Agent Service
After=network-online.target
Wants=network-online.target
[Service]
ExecStart={/path/to/working/directory}/beszel-agent
Environment="LISTEN=$LISTEN"
Environment="KEY=$KEY"
# Environment="EXTRA_FILESYSTEMS=sdb"
Restart=on-failure
RestartSec=5
StateDirectory=beszel-agent
# Security/sandboxing settings
KeyringMode=private
LockPersonality=yes
NoNewPrivileges=yes
ProtectClock=yes
ProtectHome=read-only
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectSystem=strict
RemoveIPC=yes
RestrictSUIDSGID=true
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
- Enable and start the service.
sudo systemctl daemon-reload
sudo systemctl enable beszel-agent.service
sudo systemctl start beszel-agent.service
Homebrew (macOS, Linux)
Environment variables can be changed in ~/.config/beszel/beszel-agent.env
.
Logs are written to ~/.cache/beszel/beszel-agent.log
.
Homebrew install script
-k
: SSH key (interactive if not provided)-p
: Port (default: 45876)-h
: Show help
curl -sL https://get.beszel.dev/brew -o /tmp/install-agent.sh && chmod +x /tmp/install-agent.sh && /tmp/install-agent.sh
Homebrew manual install
mkdir -p ~/.config/beszel ~/.cache/beszel
echo 'KEY="ssh-ed25519 AAAA..."' > ~/.config/beszel/beszel-agent.env
brew tap henrygd/beszel
brew install beszel-agent
brew services start beszel-agent
WinGet / Scoop (Windows)
The agent is available as a package in WinGet and Scoop.
The script below uses Scoop if you have it installed, otherwise it uses WinGet if that's installed. If neither are available, it will install both Scoop and the agent.
It also installs NSSM and creates a service to keep the agent running after reboot.
-Key
: SSH key (interactive if not provided)-Port
: Port (default: 45876)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser; & iwr -useb https://get.beszel.dev -OutFile "$env:TEMP\install-agent.ps1"; & "$env:TEMP\install-agent.ps1"
The script's source code is available on GitHub.
Edit configuration
Edit the service in NSSM by running the command below. Scroll to the right in the GUI to find environment variables.
nssm edit beszel-agent
You can also change options directly from the command line:
nssm set beszel-agent AppEnvironmentExtra "+EXTRA_FILESYSTEMS=D:,E:"
Restart the service when finished: nssm restart beszel-agent
Logs
Logs are saved in C:\ProgramData\beszel-agent\logs
.
Upgrade
Scoop
nssm stop beszel-agent; & scoop update beszel-agent; & nssm start beszel-agent
WinGet
nssm stop beszel-agent; & winget upgrade henrygd.beszel-agent; & nssm start beszel-agent
Uninstall
Scoop
nssm stop beszel-agent
nssm remove beszel-agent confirm
scoop uninstall beszel-agent
WinGet
nssm stop beszel-agent
nssm remove beszel-agent confirm
winget uninstall henrygd.beszel-agent
FreeBSD / OPNSense
A FreeBSD port is on the roadmap but not yet available (contributions welcome!). We'll also add FreeBSD compatibility to the main install script.
For now, the agent can be installed manually. See the following for more information:
- https://forum.opnsense.org/index.php?topic=45619.0#msg229919
- https://github.com/henrygd/beszel/discussions/39
Home Assistant
See the Home Assistant Agent page for instructions on setting up the agent as a Home Assistant add-on.