Skip to content

AgentMux Headless

AgentMux Headless is AgentMux without the desktop app: your agents, tasks and memory run in a server on a machine, and the window is a browser on that machine’s own loopback address. It is for a machine that has no screen of its own, or where you want the agents to keep running with no window open. A release has it for Windows (x64), macOS (Apple Silicon) and Linux (x86_64 and arm64). The desktop app is Standard; the two of the same version run side by side.

Headless runs on its own channel, headless, with its own data folder, settings, ports and agents, so it can run beside a desktop AgentMux of the same person without sharing anything with it.

Install it from a terminal with the release’s install script, which checks the download against the release’s signed manifest.

macOS and Linux install into ~/.agentmux/headless:

Terminal window
curl -fsSL https://agentmux.ai/install.sh | sh -s -- --headless

Add --setup to also run agentmux setup with its defaults and a login service (see setup). The script links the command as agentmux-headless in ~/.local/bin, and as agentmux too when nothing of that name is there (the desktop app’s launcher has that name and is not replaced). Examples below say agentmux; where something else has the name, read agentmux-headless. An Intel Mac has no Headless package.

Windows (PowerShell) installs for you only, with no administrator rights:

Terminal window
& ([scriptblock]::Create((irm https://agentmux.ai/install.ps1))) -Headless

It puts the program in %LOCALAPPDATA%\AgentMux\Headless\<version>, makes %LOCALAPPDATA%\AgentMux\Headless\current a link to it, and adds %LOCALAPPDATA%\AgentMux\Headless\current\bin to your user PATH. Open a new PowerShell window so the PATH is read, then run agentmux setup. The package is not code-signed. Started from a PowerShell window, the programs ran without a Windows prompt in our check; double-clicking one in File Explorer may show a Windows security warning. Nothing is written outside your profile.

Optional: run it as a Windows service. At the end the installer asks whether you also want AgentMux Headless to run as a Windows service, so that it starts when the computer does, with nobody signed in. The answer is no unless you say yes: the installer never sets it up by itself, and if you decline, AgentMux Headless stays as above and starts at sign-in, as a Scheduled Task once you run agentmux setup. The question says what the service does, that Windows asks you to allow an administrator step, and how to remove it. It is offered by this installer only: the desktop app and its installer do not have it. To say yes ahead of time, for a script that has a person to answer the administrator prompt, add the switch:

Terminal window
& ([scriptblock]::Create((irm https://agentmux.ai/install.ps1))) -Headless -WindowsService

See Run as a Windows service for what the service is and how to update or remove it.

Update by running the same command again: it installs the new version beside the old one, moves the link and removes the old folder. agentmux update prints the command for your system. Then run agentmux restart to run the new version.

Uninstall with agentmux uninstall: it removes the login service or task, the program folder and its links (on Windows, the PATH entry too). It does not remove a Windows service and refuses while one is installed: run agentmux service uninstall first. Your data folders stay unless you add --remove-data (it asks first, or take --yes); the shared folder your desktop app uses is never touched.

CommandWhat it does
agentmux setupThe first-run choices, then starts the server and offers to sign a browser in.
agentmux doctorChecks the machine for the server and says what to do about each problem. --port checks the port you mean to run on.
agentmux startStarts the server in the background and waits until it answers. It works without setup: with nothing kept, it uses port 7380 and keeps secrets in owner-only files.
agentmux stopAsks the server to shut down. --force ends it at once if it has not left after 30 seconds.
agentmux restartStops it, then starts it. Run it after an install to run the new version.
agentmux statusSays whether the server is running, its version, address, data folder, whether the login service is installed, how many browsers are signed in and how the recent sign-ins were confirmed.
agentmux openSigns a browser in (see Sign a browser in).
agentmux logoutSigns every browser out.
agentmux logsShows the server’s log.
agentmux versionShows the version.
agentmux updatePrints the command that installs the current release over this one.
agentmux uninstallRemoves what the install script put in place (see Install).
agentmux runRuns the server in this terminal, which is what the login service (the Scheduled Task on Windows) runs.

status, doctor and version take --json. doctor checks the port setup kept (7380 when there is none) unless you give --port <port> (1024 to 65534; a server that is running is judged on the port it runs on). --channel <name> before or after any command works on another server channel. --home <folder> before or after any command keeps everything in that folder instead of ~/.agentmux (see Where things are). Exit codes are 0 for done, 1 when the thing asked is not so (the server is not running, a check failed), 2 for a command used wrongly and 3 when the command could not do it.

start and run take --port (1024 to 65534), --secret-store, --public-origin, --srv-bin and --web-dir; their defaults are what setup kept. When a login service is installed, start and restart refuse these flags, because the service starts the server from the saved settings: change them with agentmux setup instead.

agentmux logs shows the last 50 lines. --lines <n> changes how many, --since <age> shows only what was written in the last while (a number and s, m, h or d, such as 30m), and -f keeps showing new lines until you interrupt it.

agentmux setup asks, in your terminal:

  • The web port the browser opens (default 7380; the next port is used too).
  • Where secrets live: file (owner-only files, for a machine with no keychain; the default) or keychain (this machine’s keychain, as the desktop app uses).
  • Whether to start AgentMux at every login, as a user service (see Start at login).
  • Whether to sign a browser in now.

It runs the same checks as doctor first, and stops if one fails. Give each choice as a flag to skip its question: --port, --secret-store file|keychain, --service or --no-service, --public-origin. --no-start does not start the server and --no-open does not offer to sign a browser in. With no terminal (a script), setup asks nothing and needs --yes to take the current choices; for example:

Terminal window
agentmux setup --yes --port 7380 --secret-store file --service --no-open

A rerun changes only what it is told to. The choices are kept in the channel’s folder, in agentmux-server.json, and the server reads them at each start. --public-origin is for a browser that reaches the server on another address, such as the end of an SSH tunnel; it must be http://127.0.0.1:<port>.

Models sign in where their command-line tools do: run the tool (for example claude) once in a terminal pane of the server.

With --service, setup installs a user service, one that needs no root, on Linux and macOS: a systemd user unit on Linux (agentmux.service in ~/.config/systemd/user) and a launchd agent on macOS (in ~/Library/LaunchAgents). It starts the server at every login and starts it again if it stops with an error. A server on another channel gets a service of its own, with the channel in its name.

On Windows there are two choices. setup registers a per-user Scheduled Task that starts Headless when you sign in: it runs as you, with no administrator rights and no stored password, through a small program that shows no console window, and it shares your shared folder with the desktop app, so it shows the same agents. Or you say yes when the Headless installer offers a Windows service, which starts when the computer does, with nobody signed in, and keeps running after you sign out: see Run as a Windows service. agentmux setup --no-service removes the task. setup refuses to register it when the program folder or the channel’s data folder can be opened by other accounts, and says which folder and what to change.

On Linux the service runs only while you are logged in. To keep it running with no one logged in, run loginctl enable-linger $USER once; setup prints the line. agentmux setup --no-service removes the service. With a service installed, agentmux stop stops the server through the service, and agentmux status shows installed (starts at every login).

A Windows service starts when the computer does, before anyone signs in, and keeps running after you sign out. It is an option of the Windows Headless installer: the installer offers it, you choose, and the answer is no unless you say yes. Nothing else installs it: the desktop app, its installer and its settings do not. If you declined and change your mind, run the Headless installer again (-Headless) and say yes; the installer does it with the command below, which you can also run yourself from a normal PowerShell window, with the agentmux command the installer put on your PATH:

Terminal window
agentmux service install

Windows asks you once to allow an administrator step. The command first reads the program you ran it from, checks every file and holds them, then the administrator step installs exactly those files and starts the service. Nothing you can change from your own account runs as an administrator.

  • Where it is. The program is in %ProgramFiles%\AgentMux\Headless\<version>, which only administrators can change, with current pointing at the version in use. The service’s data is in %ProgramData%\AgentMux\Headless, a folder only the service’s account and administrators can open. The service is named AgentMuxHeadless (shown as “AgentMux Headless” in the Services list); another channel (agentmux --channel work service install) gets AgentMuxHeadless-work and its own folders with -work in their names.
  • Who it runs as. Its own account, NT SERVICE\AgentMuxHeadless: no password, not your account, never an administrator and not the all-powerful system account. It starts after a failure: Windows restarts it after a minute, twice, and then leaves it to you.
  • What it can see. It starts empty: no agents, accounts or tasks of yours, and it never reads your profile or your shared folder. Add what you want through the browser. A browser signed in to the service sees everything that is in the service, so sign in only on a computer and an account you trust with it.
  • Port. --port N (1024 to 65534) chooses the web port, the next one is its websocket port; with none, the service uses its saved settings, else 7380. It listens on the loopback address only, and the port is held exclusively: no other program can take it while the service runs.
  • Domain. On a computer that belongs to a domain the install is refused, because the service’s account reaches the network as the computer. --allow-domain-joined installs it anyway.

These commands are for the service. install, update and uninstall need the administrator step; start and stop do too; status does not:

CommandWhat it does
agentmux service installInstalls the service and starts it. Run again, it installs this program’s version over the running service.
agentmux service statusThe service’s state, its account and the command it runs. --json for a machine.
agentmux service start / stopStarts or stops the installed service.
agentmux service updatePuts this program’s version in the installed service and keeps its port, its data and the browsers’ sign-ins. It does nothing when the service already runs this version, and refuses to go back to an older one.
agentmux service uninstallStops and removes the service. Its program folder and its data stay. --purge also deletes the data (its agents, its keys and the browsers’ sign-ins); it asks first, and --yes skips the question. With no terminal and no --yes it deletes nothing.

Sign a browser in. Run agentmux open in a normal terminal, as the person who ran service install; the service gives that account, and only it, read access to its key, so the check phrase works as below. A browser that signed in stays signed in across a restart of the service or of the computer, as for any AgentMux Headless (see below). agentmux logout signs every browser out.

Update. The install script (-Headless again) puts the new version in your own folder and prints the exact agentmux service update command for each service it finds, with --channel for a channel other than the default. It does not change the service itself: run the printed command, and allow the administrator step. Your sign-ins in the browser stay.

Uninstall. agentmux service uninstall, then agentmux uninstall if you also want the copy in your own folder removed. agentmux uninstall refuses while a service of the channel is installed, and says so.

Logs. The service’s server.log is in its data folder, and the Windows Event Log has one entry when it is running, when Windows asks it to stop, when it has stopped, and when the server ends by itself or does not start: Event Viewer, Windows Logs, Application, source “AgentMux Headless”. agentmux doctor has a windows service line: the state, the account, the program, the version and the time of its last start.

The server serves its own web UI on http://127.0.0.1:<port>, and a browser must sign in before it shows anything. Run this in a terminal on the server’s machine, as the same user:

Terminal window
agentmux open

It opens your browser at the server, which shows a short check phrase. The terminal then asks A browser entered with "<phrase>". Is that the page you opened? [y/N]. Answer y only when the browser shows that same phrase; any other answer discards the sign-in. Nothing answers for you: there is no flag for it, and open needs a terminal.

  • The one-time code in the address works for 60 seconds and once.
  • --print prints the address for you to open in your own browser instead of opening one.
  • --origin http://127.0.0.1:<port> is for a browser that reaches the server on another address, such as the end of an SSH tunnel; it must match the server’s --public-origin.
  • If the long address wraps in a narrow terminal and will not copy, open also prints the short address, <origin>/auth/enter, and the code on a line of its own: open the address in your browser and paste the code into the page.
  • Before it sends anything, open proves it holds the server’s key file and the server proves itself to it; the key is never sent.
  • The server takes your answer only from a process on this machine that is outside every agent’s process tree. An answer from inside an agent’s tree, from a process the server cannot identify, or through a proxy is refused, and the refusal says what works. agentmux status lists how the recent sign-ins were confirmed.

A signed-in browser stays signed in until it has had no request for 12 hours, and ends a week after you confirmed it whatever its use, when you sign in again with agentmux open. The server keeps its browsers’ sign-ins across a restart in an owner-only file in its data folder, as digests only: no cookie or token is written. It ignores and clears the file when it cannot be trusted (another account can open it, it is damaged, its times do not add up, or it was made under another sign-in key you provided). agentmux logout signs every browser out. In a signed-in browser, Sign Out of This Browser in the command palette ends that browser’s own session, and Sign Out of Every Browser ends all of them.

agentmux doctor prints one line per check, ok, warn or FAIL, with what to do under each one that is not ok. It exits with 1 when any check fails.

  • platform: Windows on x86_64, macOS or Linux on x86_64 or arm64 (the packages that exist).
  • install: the server program and the web UI are where the command expects them.
  • folders: the channel’s folders are writable.
  • disk: a failure under 200 MiB free, a warning under 1 GiB.
  • key file: the server’s key file is readable by its owner only.
  • port: the server answers on its port, or the port and the next one are free to bind.
  • tools: node, npm and git are on the PATH. Agents’ command-line tools are installed through npm.
  • node version: Node.js 20 or newer, which is the least any agent in the new-agent panel needs; some agents need a newer one.
  • certificates (Linux): the system’s certificates are found. Without them every https request the server makes (models, updates, connected accounts) fails. Install the ca-certificates package, or point SSL_CERT_FILE at a bundle, then restart the server.
  • libraries (Linux): libdbus-1.so.3 and libxcb.so.1, which the agent tools use.
  • shared folder: another AgentMux of a different version holds the folder this version’s data needs, so the server did not start. Close that AgentMux and run agentmux start, or update one of the two so both are the same version.
  • version: the running server is not the installed version; agentmux restart runs the installed one.
  • service: whether a login service (on Windows, the per-user Scheduled Task) is installed and runs this install of the command.
  • windows service (Windows): when a Windows service is installed, its state, its account, the program it runs, its version and the time of its last start. It warns when the service is stopped, runs as another account, or is an older version than this install (agentmux service update puts this one in).

The server’s data, settings and agents are in ~/.agentmux/channels/headless/ (on Windows, %USERPROFILE%\\.agentmux\\channels\\headless\\; another channel has its own folder there). agentmux status prints the exact data folder. Agent definitions, accounts and the rest of the account-wide data are in shared/ under ~/.agentmux, the same folder the desktop app uses, so a headless server on the same account shows the same agents. To run it fully apart from the desktop app, give it a folder of its own with --home <folder>: its own data and the agents, accounts and history that servers on that folder share all live there, and it shares nothing with the AgentMux on this machine. The login service that setup makes carries the same folder. The server’s log is server.log in the channel’s folder, which agentmux logs reads.