Skip to main content
Cursor Cloud Agents can run their tool calls on Self-Hosted Machines. Cursor keeps the agent loop, the model, and the Cloud Agent experience; a worker you run executes the file edits and terminal commands. An Agent37 instance makes a good one: an always-on Linux computer that keeps your checkout, dependencies, and build cache on its own disk between sessions, and bills by the minute, from $4.76 a month.
Paste this into your coding agent

How it works

  • Cursor runs the agent loop and the model. You start agents from cursor.com/agents, the desktop app, Slack, GitHub, Linear, or the Cloud Agents API.
  • Your Agent37 instance runs agent worker, the worker from Cursor’s CLI. It executes each tool call in your checkout and sends the results back.
  • The worker only makes outbound HTTPS connections to Cursor (api2.cursor.sh, api2direct.cursor.sh, and an artifact bucket). The instance needs no public URL or open port.

Before you begin

  • An Agent37 API key in AGENT37_API_KEY and a funded workspace wallet. Create a key in the dashboard.
  • A Cursor user API key from Cursor Dashboard > API Keys, exported as CURSOR_API_KEY. It connects the instance as one of your My Machines, which needs no Enterprise plan. For a team fleet, see Team Pools.
  • The repository the agent works on, exported as REPO_URL (for example https://github.com/your-org/your-repo).
  • Node.js, curl, and jq on your computer. The cloud build needs no local Docker.

1. Build the worker image

Put this Dockerfile in an empty folder:
Dockerfile
The image installs Cursor’s CLI under /opt and puts agent on the PATH, since /home/node is the instance’s persistent home and is mounted over the image at runtime. Add the toolchain your repository needs in the same way, outside /home/node. The main process keeps the instance available; you start the worker after cloning. Build it as a workspace template:
Omit --default-port: the worker needs no listening port.

2. Create the instance

Leave auto-sleep off: the worker’s outbound connection does not keep an instance awake. The worker reads CURSOR_API_KEY from its environment, where commands the agent runs can read it too, so use a key dedicated to this instance.

3. Clone the repository

Check exit_code is 0. For a private repository, use a URL that carries a token with read access, or SSH into the instance and clone it with your own credentials. The checkout’s origin remote tells Cursor which repository this machine serves.

4. Start the worker

A successful exec response only means the launch command ran. Read the worker’s log after a few seconds:
stdout contains Worker is now running with the name agent37. If it does not, run agent worker --worker-dir /home/node/repo debug through exec: it checks the key, the repository, and whether Cursor can see the worker.

5. Run an agent and read its file

Open cursor.com/agents, pick agent37 in the environment menu, and send a task. Or start one through the Cloud Agents API:
Check the run until its status is FINISHED:
Then read the file directly from your instance:
stdout is the instance id, which is its hostname. That verifies the Cursor agent ran its command on your Agent37 instance.

Team Pools

On a Cursor Enterprise plan, the same image serves a Team Pool. Create the instance with a service account API key as CURSOR_API_KEY, then start the worker with a pool name:
Each Cloud Agent session claims one pool worker at a time, so create one instance per worker you want in the pool. --idle-release-timeout 0 keeps an always-on worker connected; by default a pool worker exits after an hour idle. Start pool agents with env: { type: "pool", name: "agent37" }, or pick the pool on cursor.com/agents.

Lifecycle and cleanup

The worker stops with its instance. If you stop, restart, or update the instance, start the worker again with step 4. The checkout in /home/node/repo, with its dependencies and build output, survives all of those. When you no longer need the machine, delete the instance and revoke its Cursor key in the Cursor dashboard:
Agent37 bills compute and storage through your wallet; Cursor bills model usage through your Cursor plan.

Provider listing

Cursor lists infrastructure partners on its Self-Hosted Machines integrations page, each linking to the partner’s own guide. Everything needed to add Agent37 is below.
Provider description
Partner guide entry