You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Install everything you need to begin working with Substrated-based blockchains and the Polkadot SDK, the framework for building blockchains.
2
+
title: Install Polkadot SDK
3
+
description: Install everything you need to begin working with the Polkadot SDK, the framework for building blockchains.
This guide provides step-by-step instructions for installing the dependencies you need to work with the Polkadot SDK-based chains on macOS, Linux, and Windows. Follow the appropriate section for your operating system to ensure all necessary tools are installed and configured properly.
10
+
This guide provides step-by-step instructions for installing the Polkadot SDKon macOS, Linux, and Windows. The installation process consists of two main parts:
11
11
12
-
## macOS
12
+
1. **Installing Dependencies** - Setting up Rust, required system packages, and development tools
13
+
2. **Building the Polkadot SDK** - Cloning and compiling the Polkadot SDK repository
14
+
15
+
Follow the appropriate section for your operating system to ensure all necessary tools are installed and configured properly.
16
+
17
+
## Part 1: Install Dependencies
18
+
19
+
### macOS
13
20
14
21
You can install Rust and set up a Substrate development environment on Apple macOS computers with Intel or Apple M1 processors.
15
22
16
-
### Before You Begin
23
+
#### Before You Begin
17
24
18
25
Before you install Rust and set up your development environment on macOS, verify that your computer meets the following basic requirements:
19
26
@@ -57,7 +64,7 @@ Protobuf must be installed before the build process can begin. To install it, ru
57
64
brew install protobuf
58
65
```
59
66
60
-
### Install Required Packages and Rust
67
+
#### Install Required Packages and Rust
61
68
62
69
Because the blockchain requires standard cryptography to support the generation of public/private key pairs and the validation of transaction signatures, you must also have a package that provides cryptography, such as `openssl`.
63
70
@@ -98,18 +105,19 @@ To install `openssl` and the Rust toolchain on macOS:
98
105
rustup component add rust-src
99
106
```
100
107
101
-
8. [Verify your installation](#verifying-installation).
102
-
9. Install `cmake` using the following command:
108
+
8. Install `cmake` using the following command:
103
109
104
110
```bash
105
111
brew install cmake
106
112
```
107
113
108
-
## Linux
114
+
9. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
115
+
116
+
### Linux
109
117
110
118
Rust supports most Linux distributions. Depending on the specific distribution and version of the operating system you use, you might need to add some software dependencies to your environment. In general, your development environment should include a linker or C-compatible compiler, such as `clang` and an appropriate integrated development environment (IDE).
111
119
112
-
### Before You Begin {: #before-you-begin-linux }
120
+
#### Before You Begin
113
121
114
122
Check the documentation for your operating system for information about the installed packages and how to download and install any additional packages you might need. For example, if you use Ubuntu, you can use the Ubuntu Advanced Packaging Tool (`apt`) to install the `build-essential` package:
115
123
@@ -125,7 +133,7 @@ clang curl git make
125
133
126
134
Because the blockchain requires standard cryptography to support the generation of public/private key pairs and the validation of transaction signatures, you must also have a package that provides cryptography, such as `libssl-dev` or `openssl-devel`.
127
135
128
-
### Install Required Packages and Rust {: #install-required-packages-and-rust-linux }
136
+
#### Install Required Packages and Rust
129
137
130
138
To install the Rust toolchain on Linux:
131
139
@@ -194,15 +202,15 @@ To install the Rust toolchain on Linux:
194
202
rustup component add rust-src
195
203
```
196
204
197
-
9. [Verify your installation](#verifying-installation).
205
+
9. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
198
206
199
-
## Windows (WSL)
207
+
### Windows (WSL)
200
208
201
209
In general, UNIX-based operating systems—like macOS or Linux—provide a better development environment for building Substrate-based blockchains.
202
210
203
211
However, suppose your local computer uses Microsoft Windows instead of a UNIX-based operating system. In that case, you can configure it with additional software to make it a suitable development environment for building Substrate-based blockchains. To prepare a development environment on a Microsoft Windows computer, you can use Windows Subsystem for Linux (WSL) to emulate a UNIX operating environment.
204
212
205
-
### Before You Begin {: #before-you-begin-windows }
213
+
#### Before You Begin
206
214
207
215
Before installing on Microsoft Windows, verify the following basic requirements:
208
216
@@ -211,7 +219,7 @@ Before installing on Microsoft Windows, verify the following basic requirements:
211
219
- **For Windows server**: You must be running Microsoft Windows Server 2019, or later, to install WSL on a server operating system.
212
220
- You have good internet connection and access to a shell terminal on your local computer.
213
221
214
-
### Set Up Windows Subsystem for Linux
222
+
#### Set Up Windows Subsystem for Linux
215
223
216
224
WSL enables you to emulate a Linux environment on a computer that uses the Windows operating system. The primary advantage of this approach for Substrate development is that you can use all of the code and command-line examples as described in the Substrate documentation. For example, you can run common commands—such as `ls` and `ps`—unmodified. By using WSL, you can avoid configuring a virtual machine image or a dual-boot operating system.
217
225
@@ -247,7 +255,7 @@ To prepare a development environment using WSL:
247
255
248
256
For more information about setting up WSL as a development environment, see the [Set up a WSL development environment](https://learn.microsoft.com/en-us/windows/wsl/setup/environment){target=\_blank} docs.
249
257
250
-
### Install Required Packages and Rust {: #install-required-packages-and-rust-windows }
258
+
#### Install Required Packages and Rust
251
259
252
260
To install the Rust toolchain on WSL:
253
261
@@ -295,31 +303,103 @@ To install the Rust toolchain on WSL:
295
303
rustup component add rust-src
296
304
```
297
305
298
-
11. [Verify your installation](#verifying-installation).
306
+
11. Proceed to [Part 2: Build the Polkadot SDK](#part-2-build-the-polkadot-sdk).
307
+
308
+
## Part 2: Build the Polkadot SDK
309
+
310
+
After installing all dependencies, you can now clone and compile the Polkadot SDK repository to verify your setup.
Compile the entire Polkadot SDK repository to ensure your environment is properly configured:
329
+
330
+
```bash
331
+
cargo build --release --locked
332
+
```
333
+
334
+
!!!warning
335
+
This initial compilation will take significant time (30-60 minutes or more) depending on your machine specifications. The `--release` flag optimizes for performance. This step compiles all components of the Polkadot SDK to verify your toolchain is correctly configured.
336
+
337
+
### Verify the Build
301
338
302
-
Verify the configuration of your development environment by running the following command:
339
+
Once the build completes successfully, verify the installation by checking the compiled binaries:
303
340
304
341
```bash
305
-
rustup show
342
+
ls target/release
306
343
```
307
344
308
-
The command displays output similar to the following:
<span data-ty>active because: it's the default toolchain</span>
318
-
<span data-ty>installed targets:</span>
319
-
<span data-ty> aarch64-apple-darwin</span>
320
-
<span data-ty> wasm32-unknown-unknown</span>
321
-
</div>
345
+
You should see several binaries including:
346
+
347
+
- `polkadot` - The Polkadot relay chain node
348
+
- `polkadot-parachain` - The parachain collator node
349
+
- `polkadot-omni-node` - The omni node for running parachains
350
+
- `substrate-node` - The kitchensink node with many pre-configured pallets
351
+
352
+
Verify the Polkadot binary works by checking its version:
353
+
354
+
```bash
355
+
./target/release/polkadot --version
356
+
```
357
+
358
+
This should display version information similar to:
359
+
360
+
```bash
361
+
polkadot 1.16.0-1234abcd567
362
+
```
363
+
364
+
If you see the version output without errors, your development environment is correctly configured and ready for Polkadot SDK development!
365
+
366
+
## Optional: Run the Kitchensink Node
367
+
368
+
The Polkadot SDK includes a feature-rich node called "kitchensink" located at `substrate/bin/node`. This node comes pre-configured with many pallets and features from the Polkadot SDK, making it an excellent reference for exploring capabilities and understanding how different components work together.
369
+
370
+
!!!note
371
+
If you've already compiled the Polkadot SDK in the previous step, the `substrate-node` binary is already built and ready to use. You can skip directly to running the node.
372
+
373
+
### Run the Kitchensink Node in Development Mode
374
+
375
+
From the `polkadot-sdk` root directory, start the kitchensink node in development mode:
376
+
377
+
```bash
378
+
./target/release/substrate-node --dev
379
+
```
380
+
381
+
The `--dev` flag enables development mode, which:
382
+
383
+
- Runs a single-node development chain
384
+
- Produces and finalizes blocks automatically
385
+
- Uses pre-configured development accounts (Alice, Bob, etc.)
386
+
- Deletes all data when stopped, ensuring a clean state on restart
387
+
388
+
You should see log output indicating the node is running and producing blocks, with increasing block numbers after `finalized`.
389
+
390
+
### Interact with the Kitchensink Node
391
+
392
+
The kitchensink node is accessible at `ws://localhost:9944`. To explore its features using the Polkadot.js Apps interface:
393
+
394
+
1. Open [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank} in your web browser
395
+
2. Click the network icon in the top left corner
396
+
3. Scroll to **Development** and select **Local Node**
397
+
4. Click **Switch** to connect to your local node
398
+
399
+
You can now explore the various pallets and features included in the kitchensink node, making it a valuable reference as you develop your own blockchain applications.
400
+
401
+
To stop the node, press `Control-C` in the terminal.
322
402
323
403
## Where to Go Next
324
404
325
-
- **[Parachain Zero to Hero Tutorials](/tutorials/polkadot-sdk/parachains/zero-to-hero/){target=\_blank}**: A series of step-by-step guides to building, testing, and deploying custom pallets and runtimes using the Polkadot SDK.
405
+
- **[Get Started with Parachain Development](/parachains/get-started/){target=\_blank}**: Practical examples and tutorials for buildingand deploying Polkadot parachains, covering everything from launch to customization and cross-chain messaging.
0 commit comments