Agent Install & systemd
Install verified prebuilt ferro-agent binaries (or build from source), configure systemd LoadCredential and OS job sandboxing, and verify heartbeats.
Relay Mode by default; Direct Offload uses pinned TLS
By default, ferro-agent requires no inbound ports and binds port 7420 to 127.0.0.1:7420 only. CLI offloads sync through the Control Plane in Relay Mode. To opt into Direct Mode over a LAN or WireGuard/Tailscale network, bind FERRO_BIND_ADDR to your private interface and set an https:// FERRO_DIRECT_URL: the agent auto-generates a persistent self-signed TLS certificate and pins its SHA-256 fingerprint automatically.
1. Release binaries & building from source
Tagged releases publish static Linux (musl) tarballs for x86_64 and aarch64 along with SHA256SUMS and a keyless Sigstore Cosign bundle (SHA256SUMS.sigstore.json). The dashboard bootstrap script, scripts/install-agent.sh,ferro agent-install, and Hetzner cloud-init templates all download, verify SHA-256 (and Cosign when cosign is installed), and install /usr/local/bin/ferro-agent automatically.
Private repo mirror note: While the GitHub repository is private, configure FERRO_AGENT_DOWNLOAD_BASE_URL to point to a public bucket/CDN mirror containing the v<VERSION>/ release assets, or build from source directly:
cargo build --release -p ferro-agentsudo install -m 0755 target/release/ferro-agent /usr/local/bin/ferro-agent/usr/local/bin/ferro-agent --version2. Bootstrap with systemd
You can generate a ready-to-run bootstrap script from Dashboard → Fleet Nodes → Add Linux server, print one with ferro agent-install --url <URL> --token <FRN_TOKEN>, or run scripts/install-agent.sh from this repository:
sudo FERRO_CONTROL_PLANE="https://ferro.example.com" \ FERRO_NODE_TOKEN="frn_YOUR_NODE_TOKEN" \ FERRO_LABELS="linux,x86_64,nvme" \ bash scripts/install-agent.sh# Optional: opt into pinned-TLS Direct Mode on a private LAN/VPN interface:# FERRO_BIND_ADDR="10.88.0.12:7420" \# FERRO_DIRECT_URL="https://10.88.0.12:7420"The installer creates two dedicated system users — ferro (for the agent daemon) and ferro-job (nologin UID for executing sandboxed runs) — writes the node bearer token to /etc/ferro/node-token (0600 root:root) loaded via systemd LoadCredential, places non-secret settings (FERRO_SANDBOX=auto, FERRO_SANDBOX_JOB_USER=ferro-job, FERRO_SANDBOX_MEMORY_MAX=4G, FERRO_SANDBOX_TASKS_MAX=256) in /etc/ferro/agent.env (0640 root:ferro), locks down blobs/, mirrors/, and agent-home/ to 0700 agent-only, and installs the Polkit rule permitting ferro to manage transient ferro-job-*.service units via systemd-run.
3. Generated systemd unit & Polkit rule
scripts/install-agent.sh, generated bootstrap scripts, and Hetzner cloud-init install the following unit at /etc/systemd/system/ferro-agent.service and Polkit rule at /etc/polkit-1/rules.d/50-ferro-agent.rules:
[Unit]Description=Ferro BYO-Metal CI AgentAfter=network-online.targetWants=network-online.target[Service]Type=simpleUser=ferroGroup=ferroEnvironmentFile=/etc/ferro/agent.envLoadCredential=ferro-node-token:/etc/ferro/node-tokenWorkingDirectory=/var/lib/ferro-agentExecStart=/usr/local/bin/ferro-agentNice=5Restart=alwaysRestartSec=5NoNewPrivileges=yesPrivateTmp=yesProtectSystem=strictProtectHome=yesReadWritePaths=/var/lib/ferro-agentProtectKernelTunables=yesProtectControlGroups=yesRestrictSUIDSGID=yesLockPersonality=yesCapabilityBoundingSet=CAP_CHOWN CAP_FOWNERAmbientCapabilities=CAP_CHOWN CAP_FOWNERUMask=0077[Install]WantedBy=multi-user.target// /etc/polkit-1/rules.d/50-ferro-agent.rules// Allow the ferro agent user to start, stop, and kill transient ferro-job-*.service// units via systemd-run without interactive authentication.polkit.addRule(function(action, subject) { if ( subject.user === "ferro" && action.id === "org.freedesktop.systemd1.manage-units" ) { var unit = action.lookup("unit"); var verb = action.lookup("verb"); if ( unit && unit.indexOf("ferro-job-") === 0 && unit.slice(-8) === ".service" && (verb === "start" || verb === "stop" || verb === "kill") ) { return polkit.Result.YES; } }});LoadCredential=ferro-node-token:/etc/ferro/node-token keeps the node bearer token out of /etc/ferro/agent.env, while CAP_CHOWN / CAP_FOWNER allow the agent to prepare ferro-job-owned run workspaces before launching each transient systemd-run sandbox with ProtectSystem=strict and cgroup v2 limits. Jobs still share the host Linux kernel and host network namespace; see Security Model for complete isolation boundaries and Polkit trust notes.
4. Flags & environment variables
All runtime options in crates/ferro-agent/src/lib.rs can be set via CLI flag or environment variable:
| Flag / Env Var | Default | Description |
|---|---|---|
--control-plane FERRO_CONTROL_PLANE | http://127.0.0.1:3000 | Base URL of the Ferro Control Plane (https:// required unless loopback or --insecure-dev). |
--token-file FERRO_NODE_TOKEN_FILE | $CREDENTIALS_DIRECTORY/ferro-node-token | Path to a file containing the node bearer token (preferred over --token / FERRO_NODE_TOKEN; systemd LoadCredential populates $CREDENTIALS_DIRECTORY/ferro-node-token automatically). |
--token FERRO_NODE_TOKEN | (fallback) | One-time node bearer token (frn_...) created in Fleet Nodes. Scrubbed from process env at startup; prefer --token-file or systemd LoadCredential in production. |
--bind-addr FERRO_BIND_ADDR | 127.0.0.1:7420 | Socket address for the opt-in Direct Offload TLS server (loopback only by default; override for LAN/VPN). |
--direct-url FERRO_DIRECT_URL | (optional) | Opt-in https:// URL advertised to the CLI for pinned-TLS Direct Offload (leave unset for Relay Mode). |
--insecure-dev FERRO_INSECURE_DEV | false | Allow non-loopback http:// control-plane URLs during local development only. |
--work-dir FERRO_WORK_DIR | $HOME/.ferro-agent (or /var/lib/ferro-agent) | Root directory containing work/, cache/, blobs/, mirrors/, agent-home/, and private/. |
--labels FERRO_LABELS | linux,byo | Comma-separated runner capability labels matched during dispatch. |
--max-concurrency FERRO_MAX_CONCURRENCY | 2 | Maximum simultaneous runs allowed on this node (>= 1). |
--heartbeat-secs FERRO_HEARTBEAT_SECS | 15 | Heartbeat interval in seconds (>= 1). Nodes time out after 90s. |
--poll-ms FERRO_POLL_MS | 1500 | Job claim poll interval in milliseconds (>= 100). |
--sandbox FERRO_SANDBOX | auto | Per-run OS sandbox backend: auto (prefers systemd-run, then bwrap; fails closed if neither works), systemd, bwrap, or none. |
--i-understand-jobs-are-not-isolated FERRO_I_UNDERSTAND_JOBS_ARE_NOT_ISOLATED | false | Explicit operator acknowledgement required to start with --sandbox=none (unisolated nodes are flagged in the dashboard). |
--sandbox-job-user FERRO_SANDBOX_JOB_USER | ferro-job | Dedicated unprivileged Unix user for systemd-run sandboxed jobs (must differ from the ferro agent UID). |
--sandbox-memory-max FERRO_SANDBOX_MEMORY_MAX | 4G | Per-run cgroup v2 MemoryMax limit (e.g. 4G, 512M, or none for unlimited; pairs with MemorySwapMax=0). |
--sandbox-tasks-max FERRO_SANDBOX_TASKS_MAX | 256 | Per-run cgroup v2 TasksMax (PID) limit (>= 1). |
--sandbox-cpu-quota FERRO_SANDBOX_CPU_QUOTA | (optional) | Optional per-run cgroup v2 CPUQuota percentage (e.g. 200%, 50%). |
--job-path FERRO_JOB_PATH | system default PATH | Explicit PATH passed into executed job commands and agent git subprocesses. |
--job-passthrough-env FERRO_JOB_PASSTHROUGH_ENV | (optional) | Comma-separated agent env var names allowed into job environments (never FERRO_* or CREDENTIALS_DIRECTORY). |
--cache-max-gb FERRO_CACHE_MAX_GB | 20 | Maximum warm dependency cache size in GiB before LRU eviction at startup and after each run. |
--blobs-max-gb FERRO_BLOBS_MAX_GB | 10 | Maximum direct-offload blob store size in GiB before LRU eviction. |
--mirrors-max-gb FERRO_MIRRORS_MAX_GB | 10 | Maximum bare Git mirror store size in GiB before LRU eviction. |
5. Docker & Hetzner provisioning notes
You can also build and run the non-root container image defined in Dockerfile.agent (which includes bubblewrap so --sandbox=auto uses the bwrap backend inside containers when user namespaces are permitted; note that cgroup limits require systemd):
docker build -f Dockerfile.agent -t ferro-agent:1.0 .docker run -d \ --name ferro-agent \ --restart unless-stopped \ -e FERRO_CONTROL_PLANE="https://ferro.example.com" \ -e FERRO_NODE_TOKEN="frn_YOUR_NODE_TOKEN" \ -e FERRO_LABELS="linux,x86_64" \ ferro-agent:1.0For one-click Hetzner Cloud provisioning and ephemeral autoscaling pools from Dashboard → Fleet Nodes, Ferro fetches live Hetzner server types and regional pricing, attaches a managed firewall, and generates a cloud-init config that exchanges a short-lived one-time enrollment code for the node token (written to /etc/ferro/node-token for LoadCredential), blocks cloud metadata (169.254.169.254) for non-root users via nftables/iptables, downloads and verifies ferro-agent, installs ferro-job + Polkit + ferro-agent.service, and enables the service on boot.
6. Verify service health
sudo systemctl status ferro-agentsudo journalctl -u ferro-agent -n 50 --no-pagercurl -kfsS https://127.0.0.1:7420/healthIf the node stays offline or direct offload cannot connect, check Troubleshooting.