# ⚙️  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-v1.19.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/.kusama
chown -R $(id -u):$(id -g) $HOME/.kusama
setenforce 0
```

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

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

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

[Service]
Type=simple
User=$current_user
WorkingDirectory=$HOME/.kusama
ExecStart=/usr/local/bin/polkadot \
  --validator \
  --name "$STARTNAME" \
  --chain=kusama \
  --database RocksDb \
  --base-path $HOME/.kusama \
  --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 kusama.service
sudo systemctl restart kusama.service
sudo journalctl -u kusama.service -f
```
