A JavaScript, TypeScript, and WebAssembly runtime with secure defaults, built on V8, Rust, and Tokio.
cloudflare/workerd
A JavaScript/Wasm server runtime built from the same code that powers Cloudflare Workers, for self-hosting and local development.
- Stars
- 9,036
- Forks
- 796
- Open issues
- 813
- Last commit
- 5 hours ago
What is it?
workerd is a server runtime that runs JavaScript and WebAssembly code written for Cloudflare Workers. It can serve as an application server to self-host Workers applications, as a local development and testing tool, or as a programmable forward or reverse HTTP proxy that intercepts, modifies and routes requests.
Applications are split into nanoservices that call each other within the same thread and process, and resources are connected through capability bindings in a Cap'n Proto configuration file rather than global namespaces. Built-in APIs follow web platform standards such as fetch(), and each version is dated to a compatibility date so that older API behavior can be emulated.
The project is written in C++ and built with Bazel, with prebuilt binaries distributed through npm. It is tested on Linux, macOS and Windows, and works with Wrangler through the MINIFLARE_WORKERD_PATH environment variable. The project states it is not a hardened sandbox, so untrusted code should be run inside a VM or similar isolation.
Key features
- 01Runs JavaScript and Wasm code written for Cloudflare Workers.
- 02Splits applications into nanoservices that call each other in-process.
- 03Configured with a Cap'n Proto file using capability bindings.
- 04Supports compatibility dates to emulate past API behavior.
- 05Can run as a forward or reverse programmable HTTP proxy.
- 06Supports systemd socket inheritance via --socket-fd.
Use cases
- Self-hosting applications originally designed for Cloudflare Workers.
- Developing and testing Workers code locally with Wrangler.
- Building a programmable HTTP proxy that modifies or routes requests.
Quick start
- 1
Build the workerd binary with Bazel
bazel build //src/workerd/server:workerd - 2
Write a config file (e.g. my-config.capnp) that defines your services and sockets
- 3
Serve your config with workerd
workerd serve my-config.capnp
Things to know
- workerd is not a hardened sandbox, so run untrusted code inside a virtual machine or other secure sandbox.
- Building from source requires a large toolchain, such as clang 22+, libc++ 22+ and LLD 22+ on Linux, or Xcode 16.3 on macOS.
- Officially tested only on Linux, macOS and Windows on x86-64 and arm64.
Topics
FAQ
- What is workerd?
- A JavaScript/Wasm server runtime built from the same code that powers Cloudflare Workers, for self-hosting and local development. workerd is a server runtime that runs JavaScript and WebAssembly code written for Cloudflare Workers. It can serve as an application server to self-host Workers applications, as a local development and testing tool, or as a programmable forward or reverse HTTP proxy that intercepts, modifies and routes requests.
- Is workerd free to use? What license does it have?
- workerd is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is workerd still maintained?
- Actively maintained. The last commit to workerd was on Oct 21, 2026.
- What can I use workerd for?
- Self-hosting applications originally designed for Cloudflare Workers. Developing and testing Workers code locally with Wrangler. Building a programmable HTTP proxy that modifies or routes requests.
- How do I install workerd?
- Build the workerd binary with Bazel: bazel build //src/workerd/server:workerd Write a config file (e.g. my-config.capnp) that defines your services and sockets Serve your config with workerd: workerd serve my-config.capnp
- Where can I get workerd?
- The source code and installation instructions are on GitHub: https://github.com/cloudflare/workerd
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A self-hosted, Cloudflare Workers-compatible platform packaged as a single Rust binary for running Workers, KV, D1, R2 and more on one machine.
Node.js is an open-source, cross-platform JavaScript runtime for running JavaScript outside the browser.
A fast all-in-one JavaScript and TypeScript toolkit: runtime, bundler, test runner, and package manager in a single executable.
A self-hostable email service built on Cloudflare Workers, letting you create multiple mailboxes under one domain with sending, attachments and a responsive web UI.
A TypeScript SDK for building persistent, stateful AI agents on Cloudflare Durable Objects, with real-time state sync, scheduling, and MCP support.