Remove the node
sudo detachbox-node-host uninstall --confirm
The uninstall puts the server back the way the install found it. Every terminal ends, and the node stops for good.
What runs goes first: node-host and the tunnel, then every terminal and the edge, then Incus with every process, bridge, firewall rule and mount it had. After that go the packages the install added, with everything apt pulled in for them, the Incus and Cloudflare repositories, Incus's system user, the node's sysctl settings, and the install's config, keys and state. detachbox-node-host itself stays while the pool does, so you can remove it later.
Then tell your detachbox contact, who takes the node off your account.
Your files stay on the pool
The pool boxes with your account's files stays, exported, with ZFS to read it:
sudo zpool import boxes # brings the pool back
sudo zfs list -r boxes/custom # lists your account's folders
sudo mount -t zfs boxes/custom/<folder> /mnt # opens one
When you no longer need those files, sudo detachbox-node-host uninstall --confirm --destroy-pool destroys the kept pool and everything on it, and removes ZFS and detachbox-node-host. uninstall --confirm without it, run again, says the node is uninstalled already and names that command. On a server where detachbox-node-host is gone, the install's check prints the command to use.
A new install on this server refuses the kept pool's disk and says why: a new node never takes over the old node's files. Give the new node another disk, or remove the kept pool first with the command the check prints. The OpenZFS packages the old node kept become the new install's.
Destroy the pool as well
sudo detachbox-node-host uninstall --confirm --destroy-pool
This destroys the pool and every file on it. It touches only the pool this install made, and it wipes the disk only when everything on it is the install's: the same disk the pool was made on, by its WWN or serial, with only the pool's own partitions. Then the disk is left empty, as the install found it: the pool's labels cleared, every signature and the partition table wiped, the disk checked the way the install checks it. Otherwise the disk stays as it is, and the uninstall says why and what to do, as Node troubleshooting shows. Then it removes OpenZFS and every package the install added for it. Afterwards the server passes the install's checks for a new install.
If a step fails
The uninstall stops at that step and lists what is still on the server. Nothing a second run needs is gone: ZFS stays while the pool does, and node-host keeps its record to the end. Fix what the line says and run the same command again; it goes on from that step.
With --destroy-pool, the last thing the uninstall removes is detachbox-node-host itself; with the pool kept, the program stays on the server. The uninstall's log, with every run of the install before it, stays in /var/log/detachbox-node-uninstall.log, readable by root only.
Remove it by hand
Only for the worst case: uninstall stops on the same step again and again, and no fixed node-host can reach the server, because a node taken off its account no longer updates itself. Run these as root, in this order, and skip what is already gone. Here the pool's disk is /dev/sdb and its ZFS partition /dev/sdb1:
cp /var/lib/detachbox-node/install/install.log /var/log/detachbox-node-uninstall.log # keep the log
systemctl disable --now detachbox-node-host cloudflared-detachbox
rm -f /etc/systemd/system/detachbox-node-host.service /etc/systemd/system/cloudflared-detachbox.service
# every terminal and the edge, then Incus itself
incus list --all-projects -c ne -f csv | while IFS=, read -r name project; do incus delete --force "$name" --project "$project"; done
systemctl stop incus-startup incus incus.socket incus-user.socket incus-lxcfs
# the pool, kept with your files:
zpool export boxes
# or, only to destroy it with every file on it and empty its disk:
zpool import -N boxes 2>/dev/null; zpool destroy -f boxes
zpool labelclear -f /dev/sdb1 # the labels are on the partition, not on the whole disk
wipefs -a /dev/sdb1 /dev/sdb9 && wipefs -a /dev/sdb && blockdev --rereadpt /dev/sdb
# packages, sources, files, users
apt-mark unhold incus incus-base incus-client cloudflared
apt-get purge incus incus-base incus-client cloudflared 'openzfs-*' # keep openzfs-* if you kept the pool
rm -rf /var/lib/incus /var/lib/incus-lxcfs /etc/apt/sources.list.d/zabbly-incus-stable.sources \
/etc/apt/sources.list.d/cloudflared.list /etc/apt/keyrings/zabbly.asc /etc/apt/keyrings/cloudflare-main.asc \
/etc/sysctl.d/90-detachbox.conf /etc/modprobe.d/zfs.conf /usr/src/openzfs-build /etc/cloudflared/detachbox.token \
/etc/detachbox-node /usr/local/lib/detachbox-node /usr/local/bin/detachbox-node-host /var/lib/detachbox-node
userdel incus; groupdel incus-admin; userdel cloudflared
systemctl daemon-reload; update-initramfs -u -k all; reboot # the reboot ends anything still running
After the reboot, apt-get autoremove --purge removes what apt pulled in for them, and the server passes the install's checks again.