# Initial Server Setup

<details>

<summary>Reconfigure DNS (Recommended)</summary>

By default DNS resolution is managed by \`systemd-resolved\`, however, we sometimes notice slow resolution time. Is it why we recommend to setup DNS resolution manually to point to fast DNS servers (Google or Cloudflare)?

```bash
sudo rm -rf /etc/resolv.conf && \
sudo touch /etc/resolv.conf && \
echo -e "nameserver 8.8.8.8\nnameserver 8.8.1.1\n" | sudo tee /etc/resolv.conf
```

</details>

<details>

<summary>Format and mount a primary disk for accounts, snapshots and logs (Optional)</summary>

This step depends on how your server is initially configured. For instance, if the first disk is where the OS is installed by default and enough space is available to contain accounts, snapshots, and logs, you can skip this step.

Find unused disk

```bash
sudo parted -l | grep Error
```

Choose partitioning Standard

```bash
sudo parted /dev/<device> mklabel gpt
```

Create the new Partition

```bash
sudo parted -a opt /dev/<device> mkpart primary ext4 0% 100%
```

Create a filesystem on the new partition

```bash
sudo mkfs.ext4 -L solana_ledger /dev/<device partition>
```

Get the uuid

```bash
sudo lsblk -o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT
```

Add mount entry in /etc/fstab

```sh
/dev/disk/by-uuid/<device partition uuid> /mnt/solana ext4 defaults 0 2
```

Mount device

```bash
sudo mount -ab
```

</details>

<details>

<summary>Format and mount a secondary disk for the ledger (Recommended)</summary>

If you deploy your server with no RAID option in order to dedicate a disk for the ledger, you can configure your secondary disk as follow:

Find unused disk

```bash
sudo parted -l | grep Error
```

Choose partitioning Standard

```bash
sudo parted /dev/<device> mklabel gpt
```

Create the new Partition

```bash
sudo parted -a opt /dev/<device> mkpart primary ext4 0% 100%
```

Create a filesystem on the new partition

```bash
sudo mkfs.ext4 -L solana_ledger /dev/<device partition>
```

Get the uuid

```bash
sudo lsblk -o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT
```

Add mount entry in /etc/fstab

```sh
/dev/disk/by-uuid/<device partition uuid> /mnt/solana_ledger ext4 defaults 0 2
```

Mount device

```bash
sudo mount -ab
```

</details>

<details>

<summary>Install generic ubuntu kernel (Recommended)</summary>

It's possible that your Ubuntu server is installed with a low-latency kernel. In this case, we recommend you install the generic kernel.

First, identify if you have a low-latency kernel

```bash
uname -a
# In case of low latency kernel, you should got something like that:
# 5.4.0-139-lowlatency #156-Ubuntu SMP PREEMPT Fri Jan 20 18:09:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```

If low latency kernel is installed then install generic kernel

```
sudo apt-get install --install-recommends linux-generic-hwe-20.04
```

Reboot when installation is completed

</details>


---

# 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://solana-boot.manystake.com/initial-server-setup.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.
