Skip to main content

How to build Nitro locally (Debian, Ubuntu, MacOS)


This document is currently in public preview and may change significantly as feedback is captured from readers like you. Click the Request an update button at the top of this document or join the Arbitrum Discord to share your feedback.

Arbitrum Nitro is the software that powers all Arbitrum chains. This how-to shows how you can build a Docker image, or binaries, directly from Nitro's source code. If you want to run a node for one of the Arbitrum chains, however, it is recommended that you use the docker image available on DockerHub, as explained in How to run a full node.

This how-to assumes that you're running one of the following operating systems:

Build a Docker image

Step 1. Configure Docker

For Debian/Ubuntu

for pkg in docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli docker-buildx-plugin docker-compose-plugin
sudo service docker start

For MacOS

Depending on whether your Mac has an Intel processor or Apple silicon, download the corresponding disk image from Docker, and move it into your Applications folder.

[Optional] Run docker from a different user

After installing docker, you might want to be able to run it with your current user instead of root. You can run the following commands to do so.

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

For troubleshooting, check Docker's section in their documentation

Step 2. Download the Nitro source code

git clone --branch v2.3.3
cd nitro
git submodule update --init --recursive --force

Step 3. Build the Nitro node Docker image

docker build . --tag nitro-node

That command will build a Docker image called nitro-node from the local source.

Build Nitro's binaries natively

If you want to build the node binaries natively, execute steps 1-3 of the Build a Docker image section and continue with the steps described here. Notice that even though we are building the binaries outside of Docker, it is still used to help build some WebAssembly components.

Step 4. Configure prerequisites

For Debian/Ubuntu

apt install git curl build-essential cmake npm golang clang make gotestsum wabt lld-13 python3
npm install --global yarn
ln -s /usr/bin/wasm-ld-13 /usr/local/bin/wasm-ld

For MacOS

Install Homebrew package manager and add it to your PATH environment variable:

/bin/bash -c "$(curl -fsSL"
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zprofile && source ~/.zprofile

(replace ~/.zprofile with ~/.bash_profile if you use bash instead of zsh).

Install essentials:

brew install git curl make cmake npm go gvm golangci-lint wabt llvm gotestsum
npm install --global yarn
sudo mkdir -p /usr/local/bin
sudo ln -s /opt/homebrew/opt/llvm/bin/wasm-ld /usr/local/bin/wasm-ld

Step 5. Configure node 16.19

For Debian/Ubuntu

curl -o- | bash
source "$HOME/.bashrc"
nvm install 16.19
nvm use 16.19

For MacOS

curl -o- | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"
nvm install 16.19
nvm use 16.19

Step 6. Configure Rust 1.73

curl --proto '=https' --tlsv1.2 -sSf | sh
source "$HOME/.cargo/env"
rustup install 1.73
rustup default 1.73
rustup target add wasm32-unknown-unknown --toolchain 1.73
rustup target add wasm32-wasi --toolchain 1.73
cargo install cbindgen

Step 7. Configure Go 1.21

Install Bison

For Debian/Ubuntu
sudo apt-get install bison
For MacOS
brew install bison

Install and configure Go

bash < <(curl -s -S -L
source "$HOME/.gvm/scripts/gvm"
gvm install go1.21
gvm use go1.21 --default
curl -sSfL | sh -s -- -b $(go env GOPATH)/bin v1.54.2

If you use zsh, replace bash with zsh.

Step 8. Start build


Step 9. Produce binaries

make build

Step 10. Run your node

To run your node using the generated binaries, use the following command from the nitro folder, with your desired parameters

./target/bin/nitro <node parameters>