Building Node Software from Source
Overview
This guide shows you how to build the Aztec node Docker image from source, including all build tools and dependencies.
Building from source allows you to:
- Run a specific tagged version
- Verify the build process matches the official CI pipeline
- Customize the software for development or testing
- Audit the complete build chain
Requirements
Hardware:
- 4 core / 8 vCPU
- 16 GB RAM for Docker
- 150 GB free disk space
- Stable internet connection
Software:
- Git to clone the repository
- Docker version 20.10 or later with at least 16 GB RAM allocated
This guide assumes you're using a standard Linux distribution such as Debian or Ubuntu. While other operating systems may work, these instructions are tested and optimized for Linux environments.
These requirements are for building the software. Running a node has different requirements—see Running a Full Node.
Build Steps
Step 1: Clone the Repository
Clone the Aztec packages repository:
git clone https://github.com/AztecProtocol/aztec-packages.git
cd aztec-packages
Step 2: Check Out a Version Tag
Check out the version tag you want to build. For example, to build version 4.1.0-rc.2:
git checkout v4.1.0-rc.2
View all available release tags with:
git tag | grep "^v[0-9]"
Step 3: Build the Container with Build Tools
Build the container image with all necessary compilation tools:
cd build-images/src
docker build --target build -t aztec-build-local:3.0 .
cd ../..
The tag aztec-build-local:3.0 avoids conflicts with the official Docker Hub image and clearly indicates this is a locally-built version.
What this does:
- Builds the
buildstage frombuild-images/src/Dockerfile - Installs Node.js 24.12.0 from NodeSource repository
- Installs Clang 16, 18, and 20 from LLVM
- Installs Rust 1.85.0 using the Rust toolchain installer with wasm32 targets
- Downloads and installs WASI SDK 27 from GitHub releases
- Builds Foundry v1.4.1 from source
- Installs CMake, Ninja, and other build essentials
This step builds all compilation tooling from scratch. The Dockerfile uses multi-stage builds—you only need the build target. Other targets (devbox and sysbox) are for development environments.
After the build completes, inspect the image to verify its contents:
# Run a shell in the container to explore
docker run -it --rm aztec-build-local:3.0 /bin/bash
# Check specific versions once inside:
node --version # Should show v24.12.0
rustc --version # Should show Rust 1.85.0
clang-20 --version # Should show clang 20.x
forge --version # Should show v1.4.1
cmake --version # Should show cmake 3.24+
You can review the Dockerfile at build-images/src/Dockerfile to see exactly what's installed and verify each step.
Step 4: Compile the Source Code
Run the bootstrap script inside the build container to compile all source code:
docker run --rm \
-v $(pwd):/workspaces/aztec-packages \
-w /workspaces/aztec-packages \
aztec-build-local:3.0 \
./bootstrap.sh full
What this does:
- Mounts your local repository into the container
- Compiles C++ code (Barretenberg proving system)
- Compiles Rust code (Noir compiler and ACVM)
- Builds TypeScript/JavaScript packages
- Writes compiled artifacts to your local filesystem (persist after container exits)
- Runs tests to verify the build
The bootstrap process is incremental—if interrupted, restart it to resume from where it left off. Git submodules for L1 contract dependencies are initialized automatically during the build.
Step 5: Build the Runtime Base Image
Build the runtime base image with Node.js dependencies. This image contains only runtime requirements—no build tools or compiled code:
docker build -f release-image/Dockerfile.base -t aztecprotocol/release-image-base .
The tag aztecprotocol/release-image-base must match exactly—the Dockerfile in Step 6 references this specific tag. This image is not published to Docker Hub; it exists only locally.
What this does:
- Installs production Node.js dependencies (no dev dependencies)
- Includes Node.js 24 runtime and system utilities
- Copies Foundry tools (anvil, cast) from the build container
- Creates a slim Ubuntu-based runtime environment without build tools