docs/mounting/hetzner.md
Mounting on Hetzner
A clean VM install and systemd auto-mount path.
Hetzner Cloud VMs (Ubuntu/Debian) are the cleanest target for agent-fs mount: root access, /dev/fuse available out of the box, no sandbox restrictions. The full happy path is four commands.
See `README.md` for the general overview and architecture.
Prerequisites
A Hetzner Cloud Ubuntu 24.04 or Debian 12 server. The fuse3 package is missing from the base image but /dev/fuse is already accessible.
# Provision (host side, with hcloud CLI)hcloud server create \ --name agent-fs-host \ --image ubuntu-24.04 \ --type cx23 \ --ssh-key <your-key># Use `cax11` for ARM (same 2 vCPU / 4 GB tier, slightly cheaper).
ssh root@$(hcloud server ip agent-fs-host)Install + mount
Inside the VM:
# 1. Install fuse3 + Bun installer prereqs (unzip is required by bun.sh/install).apt-get update -qq && apt-get install -y fuse3 curl unzip
# 2. Install Bun + agent-fs.curl -fsSL https://bun.sh/install | bashexport PATH="$HOME/.bun/bin:$PATH"bun install -g @desplega.ai/agent-fs
# 3. Configure auth.mkdir -p ~/.agent-fscat > ~/.agent-fs/config.json <<EOF{ "apiUrl": "https://agent-fs-taras.fly.dev", "apiKey": "<YOUR_API_KEY>"}EOF
# Or via env (preferred for systemd units):# export AGENT_FS_API_URL=https://agent-fs-taras.fly.dev# export AGENT_FS_API_KEY=...
# 4. Verify auth + mount.agent-fs auth whoamimkdir -p /mnt/agent-fsagent-fs mount /mnt/agent-fs --remoteVerify
ls /mnt/agent-fsls /mnt/agent-fs/currentecho "hello from hetzner $(date)" > /mnt/agent-fs/current/hetzner-test.txtcat /mnt/agent-fs/current/hetzner-test.txtrm /mnt/agent-fs/current/hetzner-test.txtUnmount
fusermount3 -u /mnt/agent-fsAuto-mount on boot (systemd)
To mount agent-fs automatically at boot, drop a systemd unit:
# /etc/systemd/system/agent-fs-mount.service
[Unit]
Description=agent-fs FUSE mount (remote)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=AGENT_FS_API_URL=https://agent-fs-taras.fly.dev
Environment=AGENT_FS_API_KEY=<YOUR_API_KEY>
Environment=PATH=/root/.bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ExecStartPre=/bin/mkdir -p /mnt/agent-fs
ExecStart=/root/.bun/bin/agent-fs mount /mnt/agent-fs --remote
ExecStop=/usr/bin/fusermount3 -u /mnt/agent-fs
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.targetActivate:
systemctl daemon-reloadsystemctl enable --now agent-fs-mount.servicesystemctl status agent-fs-mount.serviceSecurity note: putting AGENT_FS_API_KEY directly in the unit file is convenient but readable by anyone with root. Prefer EnvironmentFile=/etc/agent-fs.env with chmod 600 /etc/agent-fs.env, or use systemd credentials (LoadCredential=) on systemd 250+.
Known issues
- `user_allow_other` is not required on stock Hetzner Ubuntu/Debian images because root is the mounting user. If you mount as a non-root user and need other UIDs to read the mount, add
user_allow_otherto/etc/fuse.conf. - Firewall: outbound HTTPS (443) must be open to reach the remote agent-fs API. Hetzner's default firewall allows this; check your custom rules if mount stalls.
- See `fuse-troubleshooting.md` for the full error catalogue.
See also
- `README.md` — overview and shared prerequisites
- `fuse-mount.md` — mount semantics
- `fuse-troubleshooting.md` — full error catalogue