> For the complete documentation index, see [llms.txt](https://skyneticlabs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skyneticlabs.gitbook.io/docs/services/mainnet-networks/polkadot/installation.md).

# Installation

This guide includes:

1. Requirements
2. Installing dependencies
3. Installing Rust
4. Building Polkadot from source
5. Launching the node
6. Running with snapshots
7. Recommended telemetry configuration

Everything is written for **Linux**, but macOS steps are included where needed.

***

## &#x20;System Requirements

* Ubuntu/Debian or macOS
* Rust (stable + nightly)
* 4 GB RAM minimum (8+ recommended)
* 200+ GB free disk space
* Open ports: **30333** (p2p), **9933/9944** (optional RPC)

***

## Install Dependencies

#### Ubuntu/Debian:

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

#### macOS:

```bash
brew install git cmake pkg-config openssl zstd
```

***

## Install Rust (Stable + Nightly + WASM target)

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
```

Then:

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

***

## Clone and Build Polkadot

```bash
git clone https://github.com/paritytech/polkadot-sdk
cd polkadot-sdk
cargo build --release -p polkadot
```

Binary will be located at:

```
target/release/polkadot
```

(Optional) Install to system path:

```bash
sudo cp target/release/polkadot /usr/local/bin/
```

***

## Running the Polkadot Node

### Mainnet (Polkadot):

```bash
polkadot --chain polkadot
```

### Validator mode:

```bash
polkadot --chain polkadot --validator
```

### Westend testnet:

```bash
polkadot --chain westend
```

### Local development network:

```bash
polkadot --dev
```

***

## Adding Telemetry (Recommended)

Telemetry helps the Polkadot ecosystem monitor node performance.

Your telemetry flags:

```bash
--telemetry-url "wss://telemetry-backend.w3f.community/submit/ 1" \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
```

* `1` = detailed telemetry
* `0` = minimal telemetry

#### Full example (recommended launch):

```bash
polkadot \
  --chain polkadot \
  --name "MyNode01" \
  --telemetry-url "wss://telemetry-backend.w3f.community/submit/ 1" \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
```

Validator example:

```bash
polkadot \
  --chain polkadot \
  --validator \
  --name "MyValidator01" \
  --telemetry-url "wss://telemetry-backend.w3f.community/submit/ 1" \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
```

***

## Snapshot Sync (Fast Sync)

Using a snapshot avoids downloading months/years of block history.

### Step 1 — Stop your node

If running in terminal: **CTRL+C**\
If running in background:

```bash
pkill polkadot
```

***

### Step 2 — Clear old chain data

For Polkadot mainnet:

```bash
rm -rf ~/.local/share/polkadot/chains/polkadot
```

For Westend:

```bash
rm -rf ~/.local/share/polkadot/chains/westend
```

***

### Step 3 — Extract the snapshot

Example for `.tar.zst`:

```bash
tar -I zstd -xf snapshot.tar.zst -C ~/.local/share/polkadot/chains/
```

After extraction, you should see one of the following:

#### RocksDB snapshot:

```
~/.local/share/polkadot/chains/polkadot/db/
```

#### ParityDB snapshot:

```
~/.local/share/polkadot/chains/polkadot/paritydb/
```

***

### Step 4 — Launch the node with the correct DB type

#### RocksDB (default):

```bash
polkadot --chain polkadot
```

#### ParityDB:

```bash
polkadot --chain polkadot --database paritydb
```

#### With telemetry:

```bash
polkadot \
  --chain polkadot \
  --database paritydb \
  --name "MyNode01" \
  --telemetry-url "wss://telemetry-backend.w3f.community/submit/ 1" \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
```

***

## Useful Flags

| Flag                    | Description                    |
| ----------------------- | ------------------------------ |
| `--validator`           | Start in validator mode        |
| `--name`                | Custom node name               |
| `--database paritydb`   | Use ParityDB                   |
| `--pruning archive`     | Archive mode                   |
| `--rpc-port 9944`       | RPC port                       |
| `--unsafe-rpc-external` | Allow external RPC (dangerous) |

***

## Updating Your Node

```bash
cd polkadot-sdk
git pull
cargo build --release -p polkadot
sudo cp target/release/polkadot /usr/local/bin/
```

Then restart manually.
