# Install

Before you can begin developing, it’s essential to prepare your development environment by installing the necessary compiler and tools. Since Substrate—and most of the tools used for Substrate development—are built using the Rust programming language, the first step is to install Rust on your computer.

The installation process for Rust varies depending on your operating system. Below are the instructions for each platform:

* **Linux**

Here's an improved version of your Rust installation guide. I've organized the information more clearly, enhanced readability, and provided additional context where needed.

## Rust Installation Guide for Linux

## Before You Begin

### Prerequisites

Before installing Rust, ensure your system meets the following requirements:

1. **Check Documentation:** Refer to your operating system's documentation for information about installed packages and how to download and install any necessary packages.
2. **Required Packages:** At a minimum, you need the following packages:

&#x20;        `clang`

&#x20;        `curl`

&#x20;        `git`

&#x20;        `make`

3. **Cryptography Support:** Since blockchain development requires standard cryptography for generating public/private key pairs and validating transaction signatures, you also need a package that provides cryptography:

&#x20;       For Debian-based systems (like Ubuntu): `libssl-dev`

&#x20;       For Red Hat-based systems (like Fedora): `openssl-devel`

## Install Required Packages

To install the necessary packages, follow these steps:

1. **Open a Terminal:** Log on to your computer and open a terminal shell.
2. **Check Installed Packages:** Use the appropriate package management command for your Linux distribution to check installed packages.
3. **Install Missing Dependencies:** Run the following command to install the required packages. Adjust the command based on your distribution.

### Example for Ubuntu:

{% code overflow="wrap" %}

```bash
sudo apt install --assume-yes git clang curl libssl-dev protobuf-compiler
```

{% endcode %}

### Other Distributions:

* **Debian:**

{% code overflow="wrap" %}

```bash
sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
```

{% endcode %}

* **Arch:**

```bash
sudo pacman -S git clang curl openssl protobuf
```

* **Fedora:**

```bash
sudo dnf install git clang curl openssl-devel protobuf-compiler
```

* **OpenSUSE:**

{% code overflow="wrap" %}

```bash
sudo zypper install git clang curl libopenssl-devel protobuf-compiler
```

{% endcode %}

> ### **Note:**
>
> Different distributions may use different package managers and package names. Ensure you adjust the commands accordingly.

## Install Rust

1. **Download and Install rustup:** Use the following command to download and install the Rust toolchain:

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

* Follow the on-screen prompts to proceed with the default installation.

2. **Update Your Shell:** To ensure your current shell session recognizes Cargo (Rust's package manager), run:

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

3. **Verify Installation:** Check that Rust is installed correctly by running:

```bash
rustc --version
```

## Configure Rust Toolchain

1. **Set Default Toolchain:** Configure the Rust toolchain to default to the latest stable version:

{% code overflow="wrap" %}

```bash
rustup default stable
rustup update
```

{% endcode %}

2. **Add Nightly Release and Targets:** If you need nightly features or WebAssembly support, add the nightly release and targets:

```bash
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
```

3. **Verify Configuration:** Check your development environment configuration:

```bash
rustup show
rustup +nightly show
```

&#x20;  You should see output similar to:

<pre class="language-bash" data-overflow="wrap"><code class="lang-bash">   # rustup show
   active toolchain
   ----------------
   stable-x86_64-unknown-linux-gnu (default)
   rustc 1.62.1 (e092d0b6b 2022-07-16)

   # rustup +nightly show
   active toolchain
   ----------------
<strong>   nightly-x86_64-unknown-linux-gnu (overridden by +toolchain on the    command line)
</strong>   rustc 1.65.0-nightly (34a6cae28 2022-08-09)
</code></pre>

You have successfully installed the Rust toolchain on your Linux system! You can now start developing Rust applications. For more resources and documentation, visit [The Rust Programming Language](https://doc.rust-lang.org/book/).

* **macOS**

Here's an improved version of your documentation for installing Rust on macOS. You can copy this text into Google Docs to save it in .docx format.

## Rust Installation Guide for macOS

### Before You Install

Before setting up your development environment on macOS, ensure your computer meets the following requirements:

* **Operating System:** macOS 10.7 Lion or later
* **Processor Speed:** At least 2 GHz (3 GHz recommended)
* **Memory:** Minimum of 8 GB RAM (16 GB recommended)
* **Storage:** At least 10 GB of available storage
* **Internet Connection:** Broadband connection
* **Apple Silicon Support:** Ensure your setup supports Apple Silicon.

Additionally, **Protobuf** must be installed before the build process begins. To install it, run the following command:

```bash
brew install protobuf
```

## Install Homebrew

Homebrew is the recommended package manager for macOS. If you don't have it installed, follow these steps:

1. **Open Terminal:** Launch the Terminal application on your Mac.
2. **Install Homebrew:** Run the following command to download and install Homebrew:

{% code overflow="wrap" %}

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

{% endcode %}

3. **Verify Installation:** Check that Homebrew is installed successfully by running:

```bash
brew --version
```

You should see output similar to:

### Installation of Rust and Dependencies

To set up Rust and its dependencies, follow these steps:

1. **Open Terminal:** Ensure you are in the Terminal application.
2. **Update Homebrew:** Make sure Homebrew is up to date by running:

```bash
brew update
```

3. **Install OpenSSL:** Install the OpenSSL package:

```bash
brew install openssl
```

4. **Install Rust:** Download the `rustup` installation program and use it to install Rust:

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

5. **Follow Prompts:** Follow the on-screen prompts to complete the default installation.
6. **Update Shell:** Include Cargo in your current shell session:

```bash
source ~/.cargo/env
```

7. **Verify Installation:** Confirm that Rust is installed correctly by running:

```bash
 rustc --version
```

## Configure the Rust Toolchain

1. **Set Default Toolchain:** Configure the Rust toolchain to use the latest stable version:

```bash
   rustup default stable
   rustup update
   rustup target add wasm32-unknown-unknown
```

2. **Add Nightly Release and Targets:** To include nightly features and WebAssembly support, run:

```bash
   rustup update nightly
   rustup target add wasm32-unknown-unknown --toolchain nightly
```

3. **Verify Configuration:** Check your Rust environment configuration:

```bash
   rustup show
   rustup +nightly show
```

&#x20;  You should see output similar to:

<pre class="language-bash" data-overflow="wrap"><code class="lang-bash"><strong>   # rustup show
</strong>   active toolchain
   ----------------
   stable-x86_64-apple-darwin (default)
   rustc 1.61.0 (fe5b13d68 2022-05-18)

   # rustup +nightly show
   active toolchain
   ----------------
   nightly-x86_64-apple-darwin (overridden by +toolchain on the command line)
   rustc 1.63.0-nightly (e71440575 2022-06-02)
</code></pre>

## Install CMake

To complete your setup, install CMake with the following command:

```bash
brew install cmake
```


---

# 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://dev.phron.ai/quick-start/install.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.
