Skip to main content
If you want to contribute to Deno or build a custom version, you’ll need to build Deno from source. If you just want to use Deno, you can download a prebuilt executable.

Prerequisites

Before building Deno, you need to install several required tools and dependencies.

Rust

Deno requires a specific release of Rust. The version required is specified in the rust-toolchain.toml file. Deno may not support building on other versions or on Rust Nightly releases.
Install or update Rust and verify the installation:
rustc -V
cargo -V

Native Compilers and Linkers

Many components of Deno require a native compiler to build optimized native functions.
Install LLVM 17 and required build tools:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh 17
apt install --install-recommends -y cmake libglib2.0-dev

Protocol Buffers Compiler

Deno requires the Protocol Buffers compiler.
apt install -y protobuf-compiler
protoc --version  # Ensure version is 3+

Python 3

Deno requires Python 3 for running Web Platform Tests (WPT).
Ensure that a suffix-less python or python.exe exists in your PATH and refers to Python 3.

Cloning the Repository

Deno uses git submodules, so you must clone with the --recurse-submodules flag.
git clone --recurse-submodules https://github.com/denoland/deno.git

Building Deno

The easiest way to build Deno is by using a precompiled version of V8.
For WSL users: Make sure you have sufficient memory allocated in .wslconfig. It is recommended that you allocate at least 16GB.

Standard Build

Build using precompiled V8 (recommended for most development):
cargo build -vv

Build from Source with V8

If you’re doing lower-level V8 development or using a platform without precompiled V8:
V8_FROM_SOURCE=1 cargo build -vv
When building V8 from source, there may be additional dependencies. See rusty_v8’s README for details.

Build Variants

# Standard debug build
cargo build -vv

Troubleshooting Build Issues

If you encounter build errors:
# Ensure you have the latest code
git pull origin main

# Clean and rebuild
cargo clean && cargo build -vv

Running Your Build

After building, the binary is located at ./target/debug/deno:
./target/debug/deno run tests/testdata/run/002_hello.ts

Running Tests

Deno has a comprehensive test suite written in both Rust and TypeScript.

Rust Tests

Run Rust tests during the build process:
cargo test -vv

TypeScript Tests

Run the TypeScript unit tests:
target/debug/deno test -A --unstable \
  --lock=tools/deno.lock.json \
  --config tests/config/deno.json \
  tests/unit

Working with Multiple Crates

If you’re working on changes that span multiple Deno crates, you can use Cargo’s patch feature.
denoland/
  deno/
  deno_core/
  deno_ast/
  ...

Using Cargo Patch

Override dependency paths on the command line:
cargo build --config 'patch.crates-io.deno_ast.path="../deno_ast"'
The version in your local crate’s Cargo.toml must match the version Deno expects. Use cargo search <dependency_name> to check versions.

Next Steps

Now that you have Deno built from source:

Build docs developers (and LLMs) love