_desktopdocs
guide

Quickstart

Launch named Linux desktops, open noVNC, and give an agent access to the daemon.

Launch a named desktop

Install Docker and Node.js 20 or newer. Run these commands in your terminal:

sh
git clone https://github.com/tanav29/desktop.git
cd desktop
node desktop-cli.mjs new --name research --cpus 2 --memory 3g

The launcher builds the image the first time and reuses it for later desktops. It prints a localhost API URL, an API bearer token, a noVNC URL, and a noVNC password. Keep the credentials private. Wait for healthy in:

sh
docker ps --filter name=desktop-research

Open the desktop

Open the printed noVNC URL and enter the viewer password. You can see and interact with the same XFCE session your agent controls.

Connect your agent

Point your agent at the printed API URL and tell it to read GET /. The response includes the instructions guide. To check it manually, replace 49152 with your printed API port:

sh
curl http://127.0.0.1:49152/
curl http://127.0.0.1:49152/api/identity

In PowerShell, use curl.exe. These two endpoints are available without a token. Supply the bearer token through your agent's secret configuration for desktop actions, shell commands, and screenshots.

To connect from Node.js, build the SDK from the checkout:

sh
cd sdk
npm ci
npm run build

From sdk/, run the following as a Node.js module. Replace 49152 with the printed API port and set DESKTOP_TOKEN in your local environment to the token printed by the launcher.

js
import { Desktop } from "./dist/index.js";

const desktop = new Desktop({
  host: "127.0.0.1",
  port: 49152,
  token: process.env.DESKTOP_TOKEN,
  workspace: "../.desktop-workspaces/research",
});

await desktop.create("xterm", { title: "desktop-demo" });
await desktop.waitFor("desktop-demo");
await desktop.screenshot("example.png");

The screenshot appears in .desktop-workspaces/research/example.png at the repository root.

Add another desktop

From the repository root, run:

sh
node desktop-cli.mjs new --name coding --cpus 1.5 --memory 4g

Use its printed URL and token to connect a second agent. Both desktops run independently and write to separate host workspaces.

sh
docker stop desktop-research
docker start desktop-research

Stopping and starting keeps the same container and workspace. After you remove a container, launching the same name again reuses its workspace by default. See Docker setup for more lifecycle commands or Self-hosting and security for remote access.