Berthward
Chat with your server on Discord and let it keep watch: Claude asks before
every change and alerts you when something's wrong.
Claude Code as an administrator for your
home server: an always-on container in which Claude looks after your
containers, storage, VMs, plugins and configuration. You talk to it from
Discord, from a terminal in your browser, or from the Claude app,
and it asks you before it changes anything. On Discord the question arrives
as Allow / Deny buttons, so you can approve a fix from your phone.
It also runs monitoring tasks you define, small scripts or questions on a
schedule, and tells you on Discord when something needs attention.
Berthward runs on Unraid today. Releases for TrueNAS, plain Docker and Home
Assistant are planned.
⚠️ For experienced server owners only. This app can do serious damage if
you don't know what you're doing. It gives an AI model root-equivalent
access to your server through the Docker socket. The defaults are
conservative and there are guard rails, but none of them is a security
boundary, and you are the one approving what Claude runs. If you would not
be comfortable doing the same work yourself on the command line, this is
not for you. Read Security Model and the
Disclaimer before installing, and keep backups.
Status: beta. The image is published as ghcr.io/thecode/berthward:beta.
Install it from Unraid's Apps tab: search for berthward (see
Install the container).
Berthward was developed and tried on two Unraid 7.4.1 servers with ZFS pools
and a small XFS array. Not yet seen in action: larger arrays with parity,
btrfs pools, systems without ZFS; the scanner has code paths for those that
nobody has watched run. And it is an AI agent: the rules in CLAUDE.md shape what
Claude does, they do not guarantee it. Expect rough edges and report them in
the issues.
Berthward is based on
claude-unraid-manager by
mygrexit, which provides the container, the host helper, the server scan
and the guard hook. Berthward adds the Discord bridge with approval buttons,
monitoring tasks, the web terminal, login from Discord and the handling of
credentials on the flash drive.
What This Is For
An admin assistant that acts on your server, with you in the loop:
"Plex won't start, find out why", "the cache pool is filling up, what is
taking the space", "set up a container for X so it shows in the Docker tab",
"send me the last 500 lines of the syslog". Claude has the context (your
pools, shares, containers, plugins) and the tools (docker, host zpool …,
host virsh …) to investigate and, after you confirm, to fix things.
And a watchman: "check every 15 minutes that all pools are healthy and
tell me if not", "every morning, a short summary of what changed". Claude
writes the task, you approve it once, and it runs on its schedule.
What it is not:
- Not a replacement for real monitoring. Tasks are small checks that post
to one Discord channel. They have no history, no graphs and no escalation.
If the container or Discord is down, nothing tells you.
- Not an autonomous operator. Conversations ask before they act. A task
runs unattended only after you approved its exact content, and a prompt
task can use nothing beyond the read-only commands that never ask.
- Not a development environment. It can edit files in
/workspace, but
everything about it (context, permissions, guard rails) is built for
administration. For coding, use a normal Claude Code install.
- Not a security boundary. See Security Model: with the
Docker socket mounted, the container is root-equivalent on the host. The
guard rails lower the chance of an accident; they do not contain a
determined attacker or a prompt-injected session.
Features
- Discord — chat with your own private bot. Permission requests arrive as
Allow / Deny buttons that only you can press. Slash commands, files in both
directions, one job at a time with a queue. See docs/discord.md
- Monitoring tasks — script or prompt, on a cron schedule. Quiet when all
is well, one alert when something breaks, one message when it recovers.
Nothing runs before you approve it. See docs/tasks.md
- Web terminal — the Claude session in a browser tab, with sign-in
approved on Discord or by password. See docs/access.md
- Claude app — the same session from phone or tablet through Remote
Control
- Knows your server — on every start it scans the server and writes a
CLAUDE.md with your storage, containers, VMs, plugins, User Scripts and
network
- Safe defaults — flash drive read-only, no shares mounted, bridge
networking, permission prompts on. You opt in to more access
- Guard hook — a short list of catastrophic commands (
mkfs, wipefs,
writing to a disk, zpool destroy, rm -rf on a mount root) is blocked
whichever wrapper is used; a second list (downloads piped to a shell,
network tools, deletes, flash drive writes) always asks you first, with a
reason. A safety net, not a wall; see Defense in Depth
- Credentials kept out of reach — key and password files on the flash
drive are refused, saved container templates ask first, and container
settings are shown with their secrets hidden
- GUI-aware — Claude is told to create dockerMan templates for new
containers and to keep changes manageable through the web UI. Instructions,
not guarantees
Quick Start
The full walk, with every click:
docs/getting-started.md. The short version:
- Create a private Discord bot and note its token, your user ID and a
channel ID (docs/discord.md, about ten minutes).
- Install the container and fill in the template: the two data paths, the
timezone and the three Discord values.
- Start it, turn Autostart on, and send
/login to your bot. Open the
link, sign in to your Anthropic account, send the code back with /code.
- Ask it something: what do you know about this server?
Discord is optional. Without it you log in from the container's Console and
use the terminal, the web terminal (with a password) or the Claude app; there
are no monitoring tasks then, because Discord is where they report.
How It Works
The container holds Claude Code and the Docker CLI. It uses the Docker
socket to manage containers and to run host commands through a host
wrapper: host <command> starts a short-lived privileged helper container
(alpine) that enters the host's namespaces and runs the command there. The
main container itself does not run privileged.
The scan. On every start a script scans the host and writes CLAUDE.md
into the workspace: system info, storage (pools, datasets, array state,
shares, encrypted datasets), containers, VMs, plugins, User Scripts with
their schedule, network interfaces, and which paths are mounted and how.
Claude reads it at the start of every conversation. It is a snapshot from
container start; Claude is told to use live commands for the current state.
The interactive session is Claude Code running in tmux. The Console
button, the web terminal and the Claude app all show this one session.
The Discord bridge connects your bot to Discord (an outgoing connection;
nothing needs to be opened on your router). Each message you send starts a
separate Claude Code run that continues your Discord conversation. When that
run wants to do something that needs permission, the bridge posts the request
with buttons and waits for your answer. The bridge also runs the task
schedule and approves web terminal sign-ins. Discord has its own
conversation, separate from the interactive session; files under /workspace
are shared by both.
Why a bridge of our own and not Anthropic's Discord channel plugin: the
plugin needs the channels research preview, which is off for Team and
Enterprise accounts until an owner turns it on, and there the plugin silently
receives nothing. The bridge also gives approvals as buttons, the task
schedule and a job queue.
Security Model
The Docker socket is equivalent to root access on the host. Any container
with the socket can start a privileged container that reaches the entire
filesystem, all processes, and all data — regardless of what mounts this
template configures. This is not specific to this project; it applies equally
to Portainer, Dockge, Yacht, and every other Docker management tool.
The mount restrictions below are behavioral guardrails: they control what
Claude naturally discovers and works with. They are not security boundaries.
If you need a hard boundary, do not mount the Docker socket — but then Claude
cannot manage containers or run host commands, which is the entire point.
Your Discord account is the key. Whoever controls it can approve
commands, tasks and web terminal sign-ins. Turn on two-factor authentication
for it. The bot answers only the user IDs you list; everyone else is
ignored, including in channels the bot can see. Use one bot per server and
keep it private (docs/discord.md).
What leaves your network. Conversations go to Anthropic, as with any
Claude Code use. What you write to the bot and what it answers goes through
Discord: do not ask it to print secrets there. The optional location lookup
for web sign-ins sends the visitor's public address to ipapi.co; it is off by
default.
Access Control
| Mount |
Default |
What it enables |
| Docker socket |
mounted (rw) |
Container management, host command execution |
/host/boot |
read-only |
View Unraid config, plugins, templates. The flash drive is read-only for Claude in the container by the mount, and for host … commands because they run with /boot remounted read-only in their own mount namespace: an ordinary write fails with "Read-only file system", whatever the command. Host commands still run as root, so one that remounts or re-enters namespaces, or hands the write to a host daemon (cron, at, emcmd, SMB, the web API) or to another container that already mounts /boot, gets around it; the guard asks before the common forms (cron/at, emcmd, curl, smbclient), not before docker exec into such a container |
/host/boot (rw) |
opt-in |
Modify config, install plugins, edit templates; commands that touch the flash drive should ask you first, with a reason (text match, so not every spelling) |
/appdata |
not mounted |
Inspect other containers' configs and logs |
| Any share |
not mounted |
Add it with Add another Path in the template (any container path outside /root, read-only unless Claude should change files). Claude knows which shares exist and tells you how to add one when it matters |
| Host networking |
off (bridge) |
Only needed if something must reach this container directly; outbound SSH to VMs and LAN hosts works in bridge mode |
Every bind mount you add shows up in Claude's CLAUDE.md with its access mode after the next start.
What Claude may do without asking
- Read files in its own folder (
/workspace) and write there.
- Read the flash drive, except the credential files below.
- A list of read-only commands:
docker ps, logs <container>,
inspect <container>, host zpool status, host df, host smartctl -a,
and similar. The full list is permissions.allow in settings.json.
- Send you a file from
/workspace over Discord.
Taken together, the last three mean an ordinary flash drive file can reach
you on Discord without a request: Claude reads it, saves a copy in its folder
and sends it. The credential files below are the exception.
Everything else asks first: in the terminal as a prompt, on Discord as Allow
/ Deny buttons. On Discord a request that is not answered within ten minutes
counts as denied.
Credentials on the flash drive
The flash drive is free for Claude to read, with two exceptions:
- Refused: password hashes (
shadow, smbpasswd, secrets.tdb), the SSH, TLS and WireGuard key folders, and dockerMan's token seed.
- Asks first: saved container templates (they hold every container's passwords and tokens, this one's included), rclone settings, Unraid Connect settings, notification settings and Unassigned Devices share settings.
For a container's settings Claude uses inspect <container>, which hides the values of environment variables; plain docker inspect asks first.
This keeps credentials from being read by accident. It is not a boundary: the lists name known files, so a plugin that is not on them keeps its secrets readable, and a container with the Docker socket is root-equivalent either way. The lists are in settings.json (permissions.deny and permissions.ask); add your own paths there.
Defense in Depth
Three independent layers, in order of how much you should rely on them: