Cohort on a server
A Linux server running Cohort is one more machine on your account. Its agents work there, with its files and tools, and you chat with them from your computer or your phone as with any other machine (Your phone and other computers). Everything on the server is done over SSH, with no window.
It runs on x86_64 and arm64 Linux.
1. Give it a user of its own
Section titled “1. Give it a user of its own”Agents act with the rights of the user Cohort runs as. Make one that holds nothing it shouldn’t:
sudo useradd --create-home --shell /bin/bash cohortsudo -iu cohort- No production credentials for that user: no cloud admin keys, no deploy keys that can write to production, no database passwords. Give the agents what a new contractor would get.
- Git: a deploy key or a bot account with access to the repositories it works on, and nothing more.
2. Install and start Cohort
Section titled “2. Install and start Cohort”Copy the Linux cohort and cohortd to the server, then:
mkdir -p ~/.local/bin && cp cohort cohortd ~/.local/bin/cohort daemon install # a systemd user service, started nowsudo loginctl enable-linger cohort # from an admin account: keep it running with nobody logged in, start it at bootcohort doctor # the daemon, git, each agent CLI and login, the secrets storecohort daemon install runs Cohort as a service. --system installs a system service instead (run it with sudo), --print shows what it would write without changing anything, and cohort daemon uninstall removes it. The agent CLIs (claude, codex) must be installed for that user and on its PATH when you run it.
On Linux, Cohort keeps secrets in an encrypted file in its data folder (~/.local/share/cohort), under a key next to it. cohort doctor says which store it uses.
3. Sign the server in
Section titled “3. Sign the server in”cohort remote login --name build-server # your email, then the code from the emailcohort remote statusYour computer and phone now list build-server under Your machines. The first time each of them connects, the server must approve it. From the SSH session:
cohort remote devices # trusted devices, and the ones waiting with their codescohort remote devices approve 4821-0937 # the code your phone or computer showsOr run cohort remote pair: it draws a QR code in the terminal for your phone to scan (Settings → Devices → Scan a pairing code), and the phone is trusted at once.
Two-factor. On a server, only devices signed in with two-factor are let in. Turn on two-factor for your Bussin Bytes account, or (not recommended on a server) turn it off with cohort settings set require_mfa false. It can only be changed on the server itself.
4. Sign in the agents
Section titled “4. Sign in the agents”Agent logins stay on the server. Sign each agent CLI in there, in the SSH session, with its own login: run claude and use its /login, or codex login --device-auth (it gives you a code to enter on another device).
For a second subscription (a customer’s, say), add a login and sign it in:
cohort login add claude-code --name acmecohort login signin acmecohort login listThe app on your computer shows the server’s logins in Settings → Accounts (pick the server in its machine picker), but signing in happens on the server. See Logins.
5. Add projects
Section titled “5. Add projects”cohort project clone git@github.com:acme/api.git # into ~/.local/share/cohort/repos/apicohort project add /srv/api # or a repository already on the serverFrom the app: with the server picked, Add project browses the server’s folders (under its home, /srv, /opt and /var/www), and Clone a repository instead clones one there.
Permissions. Leave the server’s projects on the default permission mode, where agents ask before running commands. You answer from the Needs you cards on your phone. Give more access only to projects where a wrong command can’t hurt. See Project settings.
6. Hand work to the server
Section titled “6. Hand work to the server”Start threads on the server like on any machine: in New thread, pick one of the server’s projects (a thread runs on its project’s machine). An agent on your computer can also hand work to it: ask “do this on build-server”. Its Cohort tools take a machine (start_thread with machine: "build-server", then wait_for_threads), and list_machines lists what your account can reach (Agents that drive Cohort).
The first time, your computer’s Cohort is a new device to the server: approve it there with cohort remote devices approve <code>. The agent is given the code while it waits. The child thread runs on the server, and its parent on your Mac hears when it’s done, as with any child.
7. Keep an eye on it
Section titled “7. Keep an eye on it”cohort remote activitylists every change another device made on the server: what, which device, when. Settings → Devices shows it for the machine you’re on.cohort remote devices revoke <name>closes a device’s connections and forgets it. From your computer: Settings → Devices → Your machines → the server’s Devices → Revoke.journalctl --user -u cohortd -ffollows the daemon’s log.
On a CI machine
Section titled “On a CI machine”- Untrusted text. Issue and pull request text from people outside your team (titles, bodies, comments, commit messages) is written by whoever wants. Don’t paste it into the prompts of agents that can push or hold secrets, or run those agents in the default mode and read what they do.
- Secrets. A project’s secrets go to every thread of that project. Keep CI tokens in a project used only for CI, scoped to what CI needs.
- Clean up. Archive finished threads: their worktrees go, their branches stay. A loop can do it.
