---
title: exec() is now available for Containers
description: Control additional processes from the associated Durable Object.
image: https://edgetunnel-b2h.pages.dev/changelog-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://edgetunnel-b2h.pages.dev/changelog/rss/index.xml) [ View RSS feeds ](https://edgetunnel-b2h.pages.dev/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://edgetunnel-b2h.pages.dev/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://edgetunnel-b2h.pages.dev/changelog/) 

## exec() is now available for Containers

Jun 18, 2026 

[ Containers ](https://edgetunnel-b2h.pages.dev/containers/) 

`exec()` is now available for [Containers](https://edgetunnel-b2h.pages.dev/containers/). Use `this.ctx.container.exec()` to start processes inside a running Container, stream standard input and output, inspect exit codes, and signal each process.

Call `exec()` from a class extending `Container`, or from another Durable Object through `this.ctx.container`. The associated Container must already be running.

This example starts the Container when needed, then reads its Node.js version:

* [  JavaScript ](#tab-panel-2716)
* [  TypeScript ](#tab-panel-2717)

**src/index.js**

```js
import { Container } from "@cloudflare/containers";


export class MyContainer extends Container {
  async readVersion() {
    if (!this.ctx.container.running) {
      await this.start();
    }


    const process = await this.ctx.container.exec(["node", "--version"]);
    const output = await process.output();
    const decoder = new TextDecoder();


    return {
      exitCode: output.exitCode,
      stdout: decoder.decode(output.stdout),
      stderr: decoder.decode(output.stderr),
    };
  }
}
```

**src/index.ts**

```ts
import { Container } from "@cloudflare/containers";


export class MyContainer extends Container {
  async readVersion() {
    if (!this.ctx.container.running) {
      await this.start();
    }


    const process = await this.ctx.container.exec(["node", "--version"]);
    const output = await process.output();
    const decoder = new TextDecoder();


    return {
      exitCode: output.exitCode,
      stdout: decoder.decode(output.stdout),
      stderr: decoder.decode(output.stderr),
    };
  }
}
```

The command array starts an executable directly, without an implicit shell. Invoke a shell explicitly for pipes, redirects, or variable expansion.

One RPC method can coordinate multiple `exec()` calls in one caller-to-Durable Object round trip. It can also pass byte-oriented `ReadableStream` input or return streamed output with flow control.

For options and streaming examples, refer to [Execute commands](https://edgetunnel-b2h.pages.dev/containers/execute-commands/).

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-06-18-container-exec/#page","headline":"exec() is now available for Containers · Changelog","description":"Control additional processes from the associated Durable Object.","url":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-06-18-container-exec/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/changelog-preview.png","dateModified":"2026-06-18","datePublished":"2026-06-18","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
```
