> For the complete documentation index, see [llms.txt](https://docs.xrpl-commons.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xrpl-commons.org/core-dev-bootcamp/module01/environment-build-toolchain.md).

# Environment & Build Toolchain

[← Back to Rippled I Overview](/core-dev-bootcamp/module01.md)

***

## Introduction

Before diving into Rippled’s architecture or contributing to the codebase, it’s essential to prepare a clean and consistent development environment. Rippled is a high-performance C++ application with multiple system dependencies from compiler toolchains to build systems and scripting utilities that must be properly configured to ensure smooth compilation and runtime behavior.

This section provides a **step-by-step setup guide for macOS**, focusing on the tools and configurations required to compile Rippled from source. You’ll install Node.js for build tooling, configure your compiler (Clang) and Xcode environment, and prepare Python dependencies used in the build process.

By the end of this section, your environment will be fully ready to build and run Rippled locally, following the same structure used by production and continuous integration setups.

***

## macOS

Install Node.js via nvm for easy version management:

```bash
# Install nvm (if not already installed)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Install and use the latest LTS version of Node.js
nvm install --lts
nvm use --lts
```

### Prerequisites for Compiling Rippled

* macOS with administrator rights
* Apple account (to download certain versions of Xcode)
* Stable internet connection for dependencies

### Checking Clang Version

```bash
clang --version
```

### Installing Xcode (if needed)

1. Download Xcode from Apple Developer Downloads
2. Extract the .xip file and rename it (e.g., Xcode\_16.2.app)
3. Move it to /Applications and set it as the default toolchain:

```bash
sudo mv Xcode_16.2.app /Applications/
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
export DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
```

4. Verify the installation:

```bash
clang --version
git --version
```

> You should see something like this for clang: `Apple clang version 16.0.0 (clang-1600.0.26.3)`

### Installing Build Tools

```bash
# Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Essential dependencies
brew update
brew install xz pyenv
```

### Python Configuration

```bash
# Install Python 3.13 via pyenv
pyenv install 3.11.13
pyenv global 3.11.13
eval "$(pyenv init -)"

# Install Conan and CMake
pip install 'conan>2.16'
pip install 'cmake>3.21'
```

***

## Ubuntu

### Prerequisites

* Ubuntu with administrator rights
* Stable internet connection

### Installing Build Tools

```bash
apt update
apt install --yes curl git libssl-dev pipx python3.11 python3-pip make g++-11 libprotobuf-dev protobuf-compiler

# Install CMake
curl -LO "https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz"
tar -xzf cmake-3.25.1.tar.gz
cd cmake-3.25.1
./bootstrap --parallel=$(nproc)
make --jobs $(nproc)
make install
cd ..

# Install Conan
pipx install 'conan>2.16'
pipx ensurepath
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xrpl-commons.org/core-dev-bootcamp/module01/environment-build-toolchain.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
