Turn a Mac mini into an AI agent server in 5 minutes
A Mac mini is a near-perfect home for AI coding agents. It's quiet, it sips power, and it can run your agents around the clock without tying up your laptop. Here's how to get Claude Code, Codex, and OpenClaw running on one, each in its own sandbox, reachable from anywhere on your network.
What you need
- A Mac mini. An M1 from 2020 is plenty; an old Intel one works too.
- About five minutes of your attention. The installer does the slow part, downloading Docker and building the binaries, on its own while you do something else.
- A Tailscale account, so you can reach the mini from your laptop without opening any ports. Free for personal use.
- API keys for whatever agents you want to run. You bring your own; Dejima never holds them in a cloud.
You can do all of this sitting at the mini, or over SSH. After setup you won't need to SSH in again.
Step 1: install Dejima
One command. Run it on the mini.
curl -fsSL https://dejima.tech/install.sh | bash
This isn't a toy script that drops a binary and wishes you luck. It checks prerequisites and names the fix for anything missing, installs Docker if you don't have it, builds the dejima and dejimad binaries, and registers the background service as a launchd unit so it comes back after a reboot. When it finishes, the daemon is running.
Step 2: make your first island
An island is one container with its own home, credentials, and network. Your agents live inside; your Mac mini's files stay outside. Point one at a repo.
dejima init --repo git@github.com:you/your-project.git
That clones the repo into a fresh island and seeds it with a Claude Code agent. Working on something you haven't pushed yet? Use --local-copy ./path to copy it in instead.
Step 3: add the agents you want
One island can hold several agents. They share the workspace and tool logins, but each gets its own git worktree, so they don't step on each other. Add a couple.
# a second terminal agent: Codex
dejima agent add your-project --type codex
# a headless one: OpenClaw, running on its own
dejima agent add your-project --type openclaw
Terminal agents are the ones you attach to and watch: Claude Code, Codex, or a plain shell. Headless runtimes like OpenClaw, Letta, and Hermes run on their own and stream output to dejima logs. Mix them however you want, and bring your own keys for each.
Step 4: run it
Start the TUI. It's the dashboard for everything on the box.
dejima
You get one screen listing every island and every agent, with status, memory, and CPU. From there you start, stop, hibernate, or attach to any of them. To drop into an agent's live session:
dejima connect your-project # Ctrl-b d detaches and leaves it running
Step 5: reach it from your laptop
This is where the Mac mini earns its keep. With both machines on your tailnet, point any Dejima command at the mini by setting one variable.
DEJIMA_HOST=mac-mini.your-tailnet.ts.net:7273 dejima connect your-project
Close the laptop, walk away, open it later, reconnect. The session was running on the mini the whole time. The same works from a second device, and two devices can attach to one agent at once.
Why bother with the island instead of just running agents on the mini directly? Because an agent running loose on the box can read your SSH keys, your other repos, and your shell history, and you'd have no record of what it touched. Inside an island it can't, and every bit of host access it does get is granted by you and written to a tamper-evident log. Same convenience, walls added. More on that in the tmux + SSH guide.
Leaving it running
The daemon is already a launchd service, so it survives reboots on its own. A few commands worth knowing for day-to-day life:
dejima hibernate your-projectfrees resources when an island is idle;dejima wakebrings it back.dejima logs your-projecttails what a headless agent is doing.dejima purge your-projectdestroys the island and its volumes when you're done. Push your work out first, since the island's volume goes with it.
That's the whole thing. A quiet box in the corner, a fleet of agents that can't wander off it, and one command from your laptop to check in.
Common questions
Can I run Claude Code on a Mac mini?
Yes. Install Dejima with one command, point an island at your repo, and add a Claude Code agent. You can run Codex and headless agents like OpenClaw alongside it on the same mini, each contained in its own island, and attach from your laptop over Tailscale.
Will the agents keep running when I close my laptop?
Yes. The agents run on the Mac mini, not your laptop. Dejima registers a background service that starts at boot, and sessions survive disconnects, so you can close the laptop, switch devices, and reconnect later with the work still going.
Does an old or low-end Mac mini work?
Yes. An M1 from 2020 is plenty, and older Intel minis work too. Two cores and 4 GB of RAM handle a few agents; add more RAM if you plan to run many at once. Each island has its own Docker volume, so leave some disk free.
Have an AI walk you through it
Paste this into your own AI and it'll guide you through the steps, adapted to your setup.
See the full quickstart, including Linux and cloud VMs →
Related: You're still SSHing into tmux to run your agents? · All guides
