Blog / coding agents

How to Run a Coding Agent Continuously on Your Own Machine

Keep an autonomous coding agent working on your own computer or server, without paying for cloud sandboxes. Setup, trade-offs and commands.

Run a coding agent continuously on your own machine

To run an autonomous coding agent continuously without paying for cloud sandboxes, run it on hardware you already have: your own computer, or a server you own or rent. Each task should run in its own sandbox and come back as a pull request, so you can start several and review them later. If the agent runs on a server, it keeps working while your laptop is closed.

Directionally Local sets this up with two commands. This guide covers the options and the trade-offs. Last reviewed October 2026.

Three places an agent can run

Cloud sandbox service Your own computer Your own server
What you pay Usage-based fees for sandbox time Nothing extra The server you already have or rent
Keeps going when your laptop is closed Yes No: tasks pause while it sleeps Yes
Where your code runs The provider's machines Your machine Your server
Where your API keys live Usually passed to the provider Your machine Your server

A cloud sandbox is the easiest to start with. But costs grow with every hour of agent time, and your code runs on someone else's machines. Your own hardware costs nothing extra to run longer.

Set it up

On your laptop:

npm install -g directionallylocal
dl

dl asks one question: where should agents run?

  1. On this computer. It starts right away. On macOS it needs Docker Desktop, OrbStack or colima. Tasks pause while the computer sleeps.
  2. On my own server. It keeps going while your laptop is closed. dl finds the servers in your ~/.ssh/config and sets everything up over SSH. The server needs Ubuntu 24.04 or 22.04, or Debian 12, with root or passwordless sudo, 4 GB of memory and 15 GB of disk.

It reuses your GitHub CLI login if you have one, after asking, and lets you pick a model provider. Keys are stored only where the agents run, never inside a sandbox.

Run tasks

From inside any GitHub repository:

dl run "fix the flaky checkout test"

Your uncommitted changes go along with the task. It runs in its own sandbox and opens a pull request when it's done. Start a few at once if you like: each gets its own sandbox and branch.

Then check on them:

dl runs        # tasks and their pull requests
dl pull <id>   # check a task's branch out locally

Things to know

  • Models: dl works with OpenRouter, DeepSeek, OpenAI, Ollama and other providers. You pick one during setup, and dl provider set switches later.
  • Capacity: dl estimates how many agents fit at once, at about 1 GB of memory per sandbox. It's an estimate until measured numbers are available.
  • Sleep: if you choose "this computer", tasks pause while it sleeps. Use a server for work that should keep going overnight.

FAQs

Can a coding agent keep working when my laptop is closed?

Yes, if it runs on a server. Choose "On my own server" when you set up dl, and tasks keep running while your laptop is closed or asleep. If agents run on your own computer, tasks pause while it sleeps.

Do I need to pay for a cloud sandbox service?

No. dl runs each task in its own sandbox on your own computer or on a server you already own or rent. You still pay your model provider for the tokens the agent uses.

What server do I need?

Ubuntu 24.04 or 22.04, or Debian 12, with root or passwordless sudo, at least 4 GB of memory and 15 GB of free disk. dl finds servers in your ~/.ssh/config and installs everything over SSH.

How many agents can run at once?

dl shows an estimate during setup, based on about 1 GB of memory per sandbox. Heavy builds need much more. A large monorepo build can need over 11 GB, as measured in our sandbox benchmark.

Which models can the agent use?

dl works with OpenRouter, DeepSeek, OpenAI, Ollama and other providers. You pick one during setup and can switch later with dl provider set or dl model.

Where are my API keys stored?

Only where the agents run: on your server or on your computer. They are never placed inside a sandbox. Each sandbox calls models through a gateway that adds the real key on the way out.