Skip to main content
A service is a command that a Devbox keeps running for you. The Devbox starts it when you create it and again every time the Devbox boots. If the command exits with an error, the Devbox restarts it. Its output is retained, so you can read the logs of a crashed dev server long after you closed the terminal that started it. Use services for the processes your work depends on, for example:
  • A dev server: pnpm dev
  • Your favorite coding agent in a remote session: amp --no-tui or claude --remote-control
  • A file watcher, a local database, or an API mock

Manage Services

A service needs a name and a command. The command runs in the Devbox’s default directory unless you choose another one. Service names must be unique on a Devbox. Deleting a service stops it first.
The command runs without a shell. For shell syntax or built-ins, use sh -c '...' on Linux and macOS, or powershell.exe -Command '...' on Windows. list and describe accept --output json. delete asks for confirmation; pass --force when running without a terminal. See devbox service for every option.
A service is in one of these states:

Start and Stop Services

Start and stop a service yourself, or let its policies decide when the Devbox starts it automatically and restarts it after it exits. On a persistent Devbox, a stopped service stays stopped across Devbox restarts until you start it again. By default, the process receives SIGTERM on Linux and macOS, or CTRL_BREAK on Windows, and is killed if it has not exited by the end of the grace period. Stopping an ephemeral Devbox removes its services and logs. Blueprint services are recreated on its next start.
Add --force to kill the process immediately. Start it again with:

Start and Restart Policies

When a Devbox boots, it starts its services after checking out repositories and running the init script. A service that keeps failing is restarted with an increasing delay, up to about a minute between attempts. The delay resets once the service has run for a minute. Two policies control this behavior:
  • Start policy: on-boot (default) starts the service when it is created and every time the Devbox boots. manual starts it only when you start it explicitly.
  • Restart policy: on-failure (default) restarts the service after a non-zero exit. always restarts it after any exit. never leaves it stopped, and its status becomes failed after a non-zero exit.
Services created with the CLI use the defaults: they start on boot and restart on failure.

View Service Logs

The Devbox retains the output of each service run. Logs replay what has already been captured, then follow new output until that run exits. After a restart, read the logs again to see the new run.
Add --no_follow to print the retained output and return.Each service run is also an execution, so it appears in devbox logs list.

Expose a Service

Expose a service’s HTTP port on a shareable URL to open it in your browser. For a dev server listening on port 3000:
1

Create the service

2

Expose the port

The CLI prints the devbox.so URL of the service.

Next Steps

devbox service

Every devbox service subcommand and option.

Blueprints

Define services for every Devbox created from a blueprint.

TS SDK: Run services

Manage services from TypeScript.
Last modified on November 13, 2026