# Installing Substrate Dependencies

**Installing Substrate Dependencies**

Substrate is a modular framework that enables you to create purpose-built blockchains by composing custom or pre-built components. Below is a markdown document that you can use as a template for creating a guide on installing Substrate dependencies.

#### **1. Install Rust** <a href="#id-1.-install-rust" id="id-1.-install-rust"></a>

Substrate is developed using Rust; hence, Rust is a prerequisite for Substrate. Install Rust using rustup by running the following command in your terminal:

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

After completing the installation, restart your terminal and run:

```
source $HOME/.cargo/env
```

Or, add the following line to your shell profile file (e.g., `~/.bashrc` or `~/.zshrc`):

```
export PATH=$HOME/.cargo/bin:$PATH
```

**Update Rust**

Keep your Rust installation up to date by running:

```
rustup update
```

#### **2. Install Additional Libraries** <a href="#id-2.-install-additional-libraries" id="id-2.-install-additional-libraries"></a>

Substrate has several library dependencies. Install them using the appropriate commands for your operating system:

**For Ubuntu**

```
sudo apt update
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev
```

**For macOS**

```
brew install cmake pkg-config openssl git llvm
```

#### **3. Install Substrate** <a href="#id-3.-install-substrate" id="id-3.-install-substrate"></a>

With Rust and the necessary libraries installed, proceed to install Substrate:

```
curl https://getsubstrate.io -sSf | bash -s -- --fast
```

#### **4. Verify Installation** <a href="#id-4.-verify-installation" id="id-4.-verify-installation"></a>

Check your Substrate installation by running:

```
substrate --version
```

This command should output the installed Substrate version.

#### **5. Configure Rust Toolchain** <a href="#id-5.-configure-rust-toolchain" id="id-5.-configure-rust-toolchain"></a>

Configure the Rust toolchain for Substrate by running:

```
rustup default nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
```

**Completion**

At this point, you should have a working Substrate development environment. Regularly check for updates and keep your installations current by running `rustup update` and `cargo update`.

Remember to replace the placeholder text with the actual content, and feel free to modify the structure and formatting to suit your preferences and requirements.


---

# Agent Instructions: 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:

```
GET https://doc.magport.io/product-guides/setup-a-local-node/installing-substrate-dependencies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
