top of page
Get An Offer
bo4FYkhx6p.jpg

Cloudflare Containers: A Game-Changer for the Edge Platform

This article provides a comprehensive technical overview of Cloudflare Containers—Cloudflare’s new runtime for running Docker-based applications at the edge. It explains what containers are, how they differ from and complement Cloudflare Workers, and walks through deployment, capabilities, pricing, and real-world use cases. Whether you're building scalable microservices, running AI inference at the edge, or simply looking to extend your Worker-based architecture, this guide outlines the value and potential of the new runtime.
What are Containers? Containers are lightweight, portable units that package an application and its dependencies together, enabling it to run reliably across different computing environments. Cloudflare’s implementation allows these containers to be deployed globally on-demand with minimal configuration.

Cloudflare Workers have long been an efficient serverless solution—ideal for running lightweight JavaScript or WASM-based code without managing servers or infrastructure. While optimized for speed and responsiveness, Workers had limitations: no file system access, restricted runtime duration, and a limited set of supported languages.

While both Workers and Containers are part of the broader Cloudflare developer platform, it's important to note that Containers are not an extension of the Workers runtime. Instead, they represent a separate compute environment designed for heavier or more customized workloads. Developers can use both runtimes together, orchestrating them to handle different parts of an application based on performance, complexity, or resource needs.

Containers directly address the limitations of Workers, offering a similar developer experience while dramatically expanding runtime possibilities.—ideal for running lightweight JavaScript or WASM-based code without managing servers or infrastructure. While optimized for speed and responsiveness, Workers had limitations: no file system access, restricted runtime duration, and a limited set of supported languages. Containers directly address these limitations, offering a similar developer experience while dramatically expanding runtime possibilities.


Technical Comparison: Workers vs. Containers

Feature

Workers

Containers

Supported Languages

JavaScript, WASM, others

Any language via Docker

File System

No

Full disk access

Runtime Duration

Limited (~30 seconds)

Unlimited, including idle/wakeup

Runtime Environment

Predefined, limited

Full custom Docker image

Resources

Lightweight

Up to 4GB RAM and 0.5 vCPU

Deployment Method

Script-based

wrangler deploy with Dockerfile

Key Benefits of Cloudflare Containers

  • Scale-to-Zero: Containers automatically shut down when idle and resume within seconds, making them ideal for infrequent or bursty workloads.

  • Global by Default: With a simple configuration (region: "earth"), containers are deployed globally, removing the need for region selection.

  • Direct Integration with Workers: Containers can be triggered from within Workers and act as intelligent backends for heavy or long-running tasks.

  • Persistent Execution: Unlike Workers, which have execution time limits, containers can run for extended periods and handle background jobs or repeated events.


Deployment & Implementation Details

Cloudflare Containers can be deployed independently by developers or in collaboration with a trusted Cloudflare technology partner such as Nanosek, an Authorized Services Delivery Partner (ASDP). This makes adoption flexible for both small teams and enterprises looking to integrate Containers into their cloud strategy with expert support.

Developers can use familiar tooling, such as wrangler.toml, to configure and deploy containers, similarly to how they use Workers. The deployment flow includes:

  1. Writing a custom Dockerfile.

  2. Adding compatibility_flags = ["containers"] to wrangler.toml.

  3. Deploying via wrangler deploy.

Currently, three container instance sizes are supported:

  • dev – 256MB RAM, 1/16 vCPU, 2GB disk.

  • basic – 1GB RAM, 1/4 vCPU, 4GB disk.

  • standard – 4GB RAM, 1/2 vCPU, 4GB disk.

Pricing is based on actual resource usage:

  • CPU: Billed by the second.

  • Memory: Billed by allocated volume.

  • Storage: Billed per GB/second.



Use Cases & Capabilities

Cloudflare Containers open up a broad set of capabilities beyond what is possible with Workers alone. Here are some concrete examples of what developers can build:

  • Edge Video Transcoding: Use FFmpeg inside a container to transcode user-uploaded videos immediately upon upload at the nearest Cloudflare location, reducing latency and offloading backend services.

  • Python-Based AI Inference: Run trained ML models in Python containers to classify images, analyze text, or generate recommendations—all at the edge.

  • Microservices in Rust or Go: Deploy microservices that require native performance or specific networking libraries not available in Workers.

  • Secure Developer Tools: Launch temporary CLI tools like linters, PDF generators, or zip utilities via a secure container, available on-demand.

  • Dynamic Code Execution: Host sandboxed containers that safely execute code submitted by users (e.g., educational platforms or coding challenges).

  • Localized Data Pre-Processing: Perform geo-distributed ETL jobs, filtering, or normalization of data before sending it to a central data lake.

These capabilities make it possible to design complex, multi-service applications directly within the Cloudflare platform, combining high performance with flexibility across languages and runtimes - Edge Media Processing – Run tools like FFmpeg to transcode video or process images close to end users.

  • Execute Non-JS Scripts – Use Python, Go, or other languages for data analysis, AI inference, or backend logic.

  • Temporary Background Services – Run long-lived processes for indexing, syncing, or job queues.

  • Dynamic Sandbox Environments – Launch secure, isolated code execution environments for user-generated code.


Strategic Significance and Conclusion

The launch of Containers marks a strategic expansion of Cloudflare’s capabilities—from lightweight serverless execution to full application runtime at the edge. It empowers developers to consolidate their backend services and application logic within a single platform, reducing complexity and reliance on multi-cloud infrastructure.

Combining Workers for real-time logic with Containers for heavier workloads offers a hybrid model that scales dynamically and aligns with modern development needs—all without leaving the Cloudflare ecosystem.

Cloudflare Containers offer full runtime flexibility, powerful processing, and simplified management—without compromising developer experience or requiring extensive DevOps expertise. This new service reflects a clear direction: Cloudflare is building a global cloud platform where developers can build, deploy, and scale any application—from lightweight Workers to full-fledged containerized services—with the same unified, streamlined flow.


FAQ:

What is the difference between Cloudflare Workers and Containers?

Workers are optimized for lightweight, short-lived JavaScript/WASM execution with limited runtime and no file system access. Containers are a separate runtime supporting any language and custom environments via Docker, ideal for heavier, stateful, or long-running workloads.

Are Containers a replacement for Workers?

No. Containers complement Workers. Developers can use Workers for routing and fast logic and Containers for compute-heavy or persistent tasks.

Do I need Kubernetes to deploy Cloudflare Containers?

No. Cloudflare handles all orchestration. Developers deploy via wrangler, the same CLI tool used for Workers.

How does billing work?

Billing is based on actual usage: CPU time, memory allocation, and storage bandwidth. This allows cost-efficient scaling with no charges for idle containers (scale-to-zero).

Can I integrate Containers into existing Cloudflare applications?

Yes. Containers can be called directly from Workers and accessed over HTTP, making them easy to integrate into current projects.

Is this suitable for production use?

As of the public beta, Containers are stable and available to paid Cloudflare accounts. Production-readiness depends on workload requirements and should be validated accordingly.

Who can help me implement Cloudflare Containers?

Organizations can work directly or through an experienced Cloudflare partner like Nanosek, the leading ASDP provider, for guidance, best practices, and implementation support.


 
 
 

Comments


bottom of page