Docs / Guides / Set up amux on Linux
Guides
Set up amux on Linux
From a fresh Linux machine to running coding-agent sessions: install Claude Code, install amux and the amux-nui-public commands, sign in, and check the machine is actually ready.
This is the first thing to do on a new Linux machine. At the end you will have coding-agent sessions running in tmux, each one surviving a closed laptop lid or a dropped SSH connection, and a single command that tells you whether the machine is set up correctly.
You only need one computer for this. Connecting a second one comes later and changes nothing you do here.
What you need first
- A Linux machine you can log into. Fedora, Ubuntu, Debian, Arch and openSUSE are all fine — the setup script works out which package manager you have.
- A Claude subscription (Pro or Max). Claude Code does not work on the free plan.
git, and a terminal.
Everything else gets installed along the way.
Step 1 — install Claude Code
curl -fsSL https://claude.ai/install.sh | bash
Then start it once and sign in:
claude
It opens a browser to complete the sign-in. Type /login inside Claude Code if it does not prompt you.
Sign in with /login, not a token
There are two ways to authenticate Claude Code, and the choice decides what you can do.
/login is the browser sign-in you just did. It is the right choice on a machine you sit in front of, because it is the only mode where Claude Code can drive your browser through the Claude in Chrome extension.
The other way is a long-lived token from claude setup-token. That one works over SSH with no browser, which makes it right for a headless server — but Claude Code then keeps browser control switched off on purpose, even if you pass --chrome.
Start with /login. You can switch later once you know which you need.
Step 2 — get the commands
git clone https://git.nuilab.org/f.ortega/amux-nui-public.git
cd amux-nui-public
./install.sh
install.sh symlinks the commands into ~/.local/bin, so a later git pull updates all of them at once. If it warns that ~/.local/bin is not on your PATH, follow the line it prints and open a new terminal.
Step 3 — install amux itself
./setup/bootstrap
This works out which platform and package manager the machine has, then installs what is missing — tmux, python3, curl, and amux
itself. It asks before each install and prints the exact command it is about to run. Re-running it is safe.
Three flags cover the non-interactive cases: --yes assumes yes to every prompt (for scripted setup), --dry-run prints what it would do without changing anything, and --no-claude skips installing Claude Code.
amux is not a pip package
pip install amux does not work — amux is not published on PyPI. bootstrap installs it from source into ~/.local/bin, which needs no sudo. On macOS it uses the Homebrew tap instead.Step 4 — check the machine is actually ready
amux-doctor
This is the command to run now, and again any time something behaves oddly. It does not guess from version numbers: it starts a throwaway tmux session and runs the exact operations amux depends on, then reports what worked.
A healthy machine looks like this:
Core tools
✓ python3 (Python 3.14.6)
✓ curl
✓ tmux present (tmux 3.7b)
✓ tmux supports every call amux makes
amux
✓ amux CLI on PATH (/home/you/.local/bin/amux)
✓ amux-remote is the amux-nuilab version
Claude Code
✓ claude on PATH (2.1.220 (Claude Code))
✓ auth: interactive login (/login)
Chrome integration is available in this mode (claude --chrome).
Anything marked ✗ comes with the command that fixes it. Lines marked ! are worth reading but do not block you.
Step 5 — your first session
Register a project directory, then start it:
amux register myproject --dir ~/code/myproject
amux start myproject
amux start drops you inside the session. Detach with Ctrl-b d — the agent keeps working. Come back with:
amux start myproject
To see everything on this machine at a glance:
amux-ls
example-host (local) · 3 sessions · 2 ● running
1 ● myproject 2 ● notes 3 ○ scratch
Useful from day one
| Command | What it does |
|---|---|
amux-ls | Every session on this machine, compact or -v for detail |
amux-convos <session> | Past conversations in a session, so you can resume the right one instead of the newest |
amux-doctor | Whether this machine is set up correctly, and why not |
check-claude-auth | Whether sessions here will actually authenticate |
amux-reauth <session> | Recover a session stuck at a login prompt, without a browser |
When something goes wrong
Run amux-doctor first — it identifies most problems by name.
The one worth knowing in advance: if a session says Please run /login and the rest of the line reads 401 The socket connection was closed unexpectedly, that is a network hiccup wearing an authentication error’s clothes. Your sign-in is fine. Wait for the connection to come back and send the message again. Signing in again does not help.
The repository’s docs/troubleshooting.md covers the rest.
Where to go next
Adding a second machine is the next step, and nothing above changes when you do. One machine runs a small server, and amux-config add on the other writes the config file that reaches it — then commands like amux-all and ccjump cover every machine at once. See amux-tools
and docs/remote.md in the repository, and Connect machines with hcom
for the coordination layer that sits on top.
Source: content/guides/set-up-amux-on-linux.md · maintained in the nuilab-agenticai repository.