---
title: Develop locally with Containers and the Cloudflare Vite plugin
description: The Cloudflare Vite plugin now supports configuring Containers in your Worker
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/) 

## Develop locally with Containers and the Cloudflare Vite plugin

Aug 01, 2025 

[ Workers ](https://edgetunnel-b2h.pages.dev/workers/) 

You can now configure and run [Containers](https://edgetunnel-b2h.pages.dev/containers) alongside your [Worker](https://edgetunnel-b2h.pages.dev/workers) during local development when using the [Cloudflare Vite plugin](https://edgetunnel-b2h.pages.dev/workers/vite-plugin/). Previously, you could only develop locally when using [Wrangler](https://edgetunnel-b2h.pages.dev/workers/wrangler/) as your local development server.

#### Configuration

You can simply configure your Worker and your Container(s) in your Wrangler configuration file:

* [  wrangler.jsonc ](#tab-panel-2897)
* [  wrangler.toml ](#tab-panel-2898)

**JSONC**

```jsonc
{
  "name": "container-starter",
  "main": "src/index.js",
  "containers": [
    {
      "class_name": "MyContainer",
      "image": "./Dockerfile",
      "instances": 5
    }
  ],
  "durable_objects": {
    "bindings": [
      {
        "class_name": "MyContainer",
        "name": "MY_CONTAINER"
      }
    ]
  },
  "migrations": [
    {
      "new_sqlite_classes": [
        "MyContainer"
      ],
      "tag": "v1"
    }
  ],
}
```

**TOML**

```toml
name = "container-starter"
main = "src/index.js"


[[containers]]
class_name = "MyContainer"
image = "./Dockerfile"
instances = 5


[[durable_objects.bindings]]
class_name = "MyContainer"
name = "MY_CONTAINER"


[[migrations]]
new_sqlite_classes = [ "MyContainer" ]
tag = "v1"
```

#### Worker Code

Once your Worker and Containers are configured, you can access the Container instances from your Worker code:

**TypeScript**

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


export class MyContainer extends Container {
  defaultPort = 4000; // Port the container is listening on
  sleepAfter = "10m"; // Stop the instance if requests not sent for 10 minutes
}


async fetch(request, env) {
  const { "session-id": sessionId } = await request.json();
  // Get the container instance for the given session ID
  const containerInstance = getContainer(env.MY_CONTAINER, sessionId)
  // Pass the request to the container instance on its default port
  return containerInstance.fetch(request);
}
```

#### Local development

To develop your Worker locally, start a local dev server by running

```sh
vite dev
```

in your terminal.

#### Resources

Learn more about [Cloudflare Containers ↗](https://edgetunnel-b2h.pages.dev/containers/) or the [Cloudflare Vite plugin ↗](https://edgetunnel-b2h.pages.dev/workers/vite-plugin/) in our developer docs.

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/post/2025-08-01-containers-in-vite-dev/#page","headline":"Develop locally with Containers and the Cloudflare Vite plugin · Changelog","description":"The Cloudflare Vite plugin now supports configuring Containers in your Worker","url":"https://edgetunnel-b2h.pages.dev/changelog/post/2025-08-01-containers-in-vite-dev/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/changelog-preview.png","dateModified":"2025-08-01","datePublished":"2025-08-01","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/"}}
```
