Run a Threadmark hub
The hub is the server the Threadmark apps connect to. It is free to run under the Threadmark License.
The hub keeps track of your machines (the “hosts”), relays their AI agent sessions to the apps, runs routines and holds the fleet’s settings. Your prompts and transcripts stay on your hub and your hosts; nothing goes to the developer.
What you need
- A Linux machine with Docker and Docker Compose, for the hub.
- A domain name pointed at it, with ports 80 and 443 open, so the apps and hosts can reach it over HTTPS.
- The machines you want to run agents on: Linux, Windows or macOS, each with Node.js 22 or later.
- An AI subscription or API endpoint for the agents to use; you add it in the hub’s settings.
1. Start the hub
In an empty folder, save this as compose.yaml, with your own address in place of hub.example.com:
name: threadmark-hub
services:
hub:
image: git.rhymelikedi.me/donut/threadmark-hub:stable
restart: unless-stopped
environment:
THREADMARK_PUBLIC_URL: https://hub.example.com
ports:
- "127.0.0.1:8321:8321"
volumes:
- data:/data
volumes:
data: {}
Then start it and check that it answers:
docker compose up -d
curl -s http://127.0.0.1:8321/api/health
The data volume holds everything the hub keeps, including the keys of the hosts that joined it. Back it up.
2. Put it behind HTTPS
The hub listens on 127.0.0.1 only, so a reverse proxy on the same machine is the way in. With Caddy, add this to your Caddyfile and reload Caddy; it gets the certificate by itself:
hub.example.com {
encode zstd gzip
@hub path /api/* /ws/*
handle @hub {
reverse_proxy 127.0.0.1:8321 {
flush_interval -1
}
}
handle {
reverse_proxy 127.0.0.1:8321
}
}
Any other proxy works if it passes /api/* and /ws/* through untouched, WebSocket upgrades included, and does not buffer responses.
3. Sign in to the web UI
Open https://hub.example.com. It asks for the hub’s token, which it generated at its first start:
docker compose exec hub cat /data/token
Anyone with the token can control your hosts, so keep it private.
4. Add your machines
In the web UI, open the server menu, choose Add a host and Generate install code. Run the line it shows on the machine, as the user the agent should run as (not with sudo). On Linux:
curl -fsSL https://hub.example.com/api/v1/install.sh | THREADMARK_JOIN=XXXX-XXXX-XXXX sh -s --
The Windows line is shown next to it. A Mac can join too, though without a background service yet. The code works once and expires after 30 minutes. The host appears in the web UI within seconds.
5. Give the agents a model
Open Settings → Providers in the web UI: sign in to a subscription, or add an OpenAI-compatible endpoint (LiteLLM, vLLM, Ollama and the like). Every host receives the models.
6. Connect the apps
In the web UI, the server menu’s Sign in the desktop or phone app shows the hub’s address and token. Enter them in the Threadmark app for iPhone, iPad or Android, or in the desktop app.
Updating
docker compose pull
docker compose up -d
The hub then builds a new release for your hosts, and each one installs it as soon as no session on it is in the middle of a turn.
Questions: threadmark@rhymelikedi.me.