# ⚙️  Installation on Almalinux

***Update System and Install Dependencies***

```bash
sudo dnf update -y
sudo dnf upgrade -y
sudo dnf install -y \
  curl git make clang cmake gcc gcc-c++ \
  pkg-config openssl-devel systemd-devel \
  wget tar lz4 which
```

***Install GO***

<pre class="language-bash"><code class="lang-bash"><strong>GO_VERSION=1.24.2
</strong>curl -Ls https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local

echo 'export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH' | sudo tee /etc/profile.d/golang.sh > /dev/null
echo 'export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

go version
</code></pre>

***Install Rust***

```bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

rustup update
rustup component add rust-src
rustup target add wasm32-unknown-unknown

rustup install nightly-2024-01-21
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-01-21
```

***Install Protobuf***

```bash
cd ~
git clone --recurse-submodules -b v25.3 https://github.com/protocolbuffers/protobuf.git protobuf-25.3
cd protobuf-25.3
mkdir build && cd build

cmake .. -Dprotobuf_BUILD_TESTS=OFF
make -j$(nproc)
sudo make install
sudo ldconfig

protoc --version
```

***Clone and Build Polkadot SDK***

```bash
cd ~
git clone https://github.com/paritytech/polkadot-sdk.git
cd polkadot-sdk
git checkout polkadot-stable2509-2
cargo build --release
```

***Install binaries into the system directory***

```bash
sudo mkdir -p /usr/lib/polkadot
sudo cp target/release/polkadot* /usr/lib/polkadot/
sudo ln -sf /usr/lib/polkadot/polkadot /usr/local/bin/polkadot
```

***Create working directory***

```bash
mkdir -p $HOME/.polkadot
chown -R $(id -u):$(id -g) $HOME/.polkadot
setenforce 0
```

***Configure and Create a Systemd Service***

```bash
current_user=$(whoami)
STARTNAME="Your_Node_Name"
```

```bash
sudo tee /etc/systemd/system/polkadot.service > /dev/null <<EOF
[Unit]
Description=Polkadot Validator Node
After=network.target

[Service]
Type=simple
User=$current_user
WorkingDirectory=$HOME/.polkadot
ExecStart=/usr/local/bin/polkadot \
  --validator \
  --name "$STARTNAME" \
  --chain=polkadot \
  --database RocksDb \
  --base-path $HOME/.polkadot \
  --state-pruning 64 \
  --blocks-pruning 64 \
  --public-addr /ip4/$(wget -qO- eth0.me)/tcp/30333 \
  --port 30333 \
  --rpc-port 9933 \
  --prometheus-external \
  --prometheus-port=9615 \
  --unsafe-force-node-key-generation \
  --telemetry-url "wss://telemetry-backend.w3f.community/submit/ 1" \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF
```

***Start and Enable the Service***

```bash
sudo systemctl daemon-reload
sudo systemctl enable polkadot.service
sudo systemctl restart polkadot.service
sudo journalctl -u polkadot.service -f
```


---

# 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://services.validexis.com/mainnets/polkadot/installation-on-almalinux.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.
