Skip to main content
Start with the Runloop Quickstart to use the examples below.

Manual Stopping

You can stop a running Devbox any time using the devbox.shutdown call in the client SDK.
devbox = await runloop.devbox.create()
...
await devbox.shutdown()

Devbox Max Lifetime

When you create a Devbox, it is automatically given a maximum lifetime. This prevents unwanted charges by leaving Devboxes running when they are not needed. The default lifetime is 1 hour, but this can be configured when you create the Devbox:
devbox = runloop.devbox.create(
  launch_parameters={
    keep_alive_time_seconds: 1800
  }
)

Idle Behavior

You can also configure your Devboxes to automatically shutdown or suspend when they are idle using the after_idle launch parameter. By default, Runloop will do nothing if your Devbox is idle.
devbox = runloop.devbox.create(
  launch_parameters={
    after_idle: {
      idle_time_seconds: 1800,
      on_idle: "suspend"  # or "shutdown"
    }
  }
)