Compiling
Both the hub and agent are written in Go, so you can easily build them yourself, or cross-compile for different platforms. Please install Go first if you haven't already.
Clone the repository
# Clone the repository
git clone --branch v0.9.0 --depth 1 https://github.com/henrygd/beszel.git
# Navigate to the project directory
cd beszel/beszel
Commands below assume you are in the project directory (/beszel
).
Using Makefile
Run make
. This creates a build
directory containing the binaries.
# Builds both the agent and hub
make
# Builds the agent only
make build-agent
# Builds the hub only (requires Node or Bun)
make build-hub
You can also build for different platforms:
make OS=freebsd ARCH=arm64
See a list of valid options by running go tool dist list
.
Manual compilation
Prepare dependencies
go mod tidy
Agent
Go to beszel/cmd/agent
and run the following command to create a binary in the current directory:
CGO_ENABLED=0 go build -ldflags "-w -s" .
Hub
The hub embeds the web UI in the binary, so you must build the website first. I use Bun, but you may use Node.js if you prefer:
cd site
bun install
bun run build
Then in /beszel/cmd/hub
:
CGO_ENABLED=0 go build -ldflags "-w -s" .
Cross-compiling
You can cross-compile for different platforms using the GOOS
and GOARCH
environment variables.
For example, to build for FreeBSD ARM64:
GOOS=freebsd GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-w -s" .
See a list of valid options by running go tool dist list
.