Self-host on one machine
In this tutorial, you set moor up on one Linux host and start a Box there. It takes three commands. No sign-in provider, DNS name, or TLS is needed for local use. You add those later, when teammates join.
You need:
- a Linux host with rootless Docker, set up with Set up a rootless Docker host for Boxes. moor refuses rootful Docker.
/dev/kvmthat Boxes can open, since every Box gets KVM (see KVM)claudeandghon your own computer, signed in
Each Box’s work place runs with --privileged so Docker works inside it. A Box
that breaks out is your user on this host, not root. Use this setup for your own
Boxes.
1. Install moor
curl -fsSL https://github.com/IniZio/moor/releases/latest/download/install.sh | shThe script puts moor, moor-gate, moor-egress-forward,
moor-machine-agent, and moor-machine-runner in ~/.local/bin. Make sure
that directory is on your PATH.
2. Set the host up
moor upmoor up prints one line per step, each ok, warn, or fail. A failed
line carries its fix. Rerun moor up after a fix. A rerun changes nothing that
is already in place.
- It checks that
docker infoworks for your user and names rootless Docker. It checks the daemon is set up for Boxes, and says what a Box that breaks out can reach. - It writes the controller config,
~/.config/moor/controller.yaml, with a front for the gate that may report steps, and adds the controller to~/.config/moor/config.yaml. It also addsmoor_service, which routesmoor.moor.internalto127.0.0.1:8444. A workflow with a plan needs both. A controller config that already hasfronts, or amoor_servicethat names another listener, means you run the gate yourself. moor up then starts none. - It installs and starts the controller as the systemd user units
moor.socketandmoor.service. It then startsmoor-gate.service, amoor-gatewith no public listener and no sign-in. It servesreport_stepto Boxes at127.0.0.1:8444. moor up makes a key once, in~/.local/state/moor/service.env. It goes to the controller and the gate. No other process on the host can name a Box. - It creates your moor user and asks for your
claudeandgithubsecrets. Paste whatclaude setup-tokenandgh auth tokenprint. - It starts
moor-relay.service, which carries Box egress from inside the rootless daemon’s network namespace to the controller’s Proxy. It then starts the machine runner asmoor-runner.service. The runner takes agent links on a loopback port. - It runs
moor node add localwith an agent home under the controller’s state directory,~/.local/state/moor/agent-home. The node is shared, and needs no sign-in. - It starts the machine agent as
moor-agent.service, run as that agent home. The agent makes the node’s Docker Boxes. It waits for the link. - It runs
moor doctorand prints the next command to run.
moor up picks the three ports once and keeps them in
~/.local/state/moor/up-ports.json.
If a line warns that the controller stops when you log out, run
loginctl enable-linger once.
To skip the prompts in step 4, set CLAUDE_CODE_OAUTH_TOKEN and GH_TOKEN
before you run moor up.
3. Check the node
moor node lsYou see the local node, with docker as how it provides Boxes. The node
takes as many Boxes as the host’s free memory allows.
4. Start a task
moor ask --repo OWNER/NAME "Say hello and stop"Use a repo that your gh auth token can push to. The command prints the
agent place that took the task, such as place-1a2b3c4d. The agent answers
there, and starts a work Box when the task needs code run. The first Box of a
repo takes a few minutes, because it clones and installs from scratch.
Watch the agent with moor inspect place-1a2b3c4d. It shows the agent’s
state, its latest messages, and the end of its terminal.
5. Close the place
moor close place-1a2b3c4dThe agent closes the work Boxes it started once their work is pushed.
moor close refuses a Box that holds work that is not pushed, and says how to
push it. --force discards that work.
Next
- To let teammates in, add the gate. Follow Run on one host and Sign-in with OIDC.
- To stop the controller, run
moor down. It keeps the config, the state, and the secrets. - Back up
~/.config/moor/vault.key. Without it, no stored secret can be read. Upgrade and back up has the rest.