> For the complete documentation index, see [llms.txt](https://doc-op.blurit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc-op.blurit.io/2.15.0/blurit-on-premise/installation/linux-dependencies.md).

# Linux dependencies

*Note: Don't follow this step if you plan to run BlurIt OP on Windows.* *Go there* *instead.*

## Choice 1 : use the Blurit CLI (recommended)

{% hint style="warning" %}
The `install_dependencies.sh` script shipped with older archives is deprecated. Dependencies are now installed by the Blurit CLI, with the `blurit requirements` command described below.
{% endhint %}

### Step 1 : extract the archive

The **Blurit CLI** enables you to easily **configure**, **start**, and **interact** with Blurit. It provides a command-line interface to manage features and streamline platform usage.

The `blurit` binary is provided in the archive you received: there is nothing to download and nothing to install — run it straight from the directory where you extracted the archive:

```bash
tar -xzf filename.tar.gz
cd blurit-op
```

Replace "filename" with the actual name of the archive that was provided to you.

At the end of the `requirements` run, the command detects that `blurit` is not in your `PATH` and offers to copy it there for you, so you don't have to do it by hand.

### Step 2 : run `./blurit requirements`

{% hint style="warning" %}
If you are installing BlurIt on an old server and want to maintain specific version dependencies, we don't recommend to use it but rather to [manually install everything](#choice-2-manual-dependencies-installation).
{% endhint %}

{% code lineNumbers="true" %}

```sh
chmod +x ./blurit
./blurit requirements
```

{% endcode %}

{% hint style="danger" %}
Run the command as your **regular user, not with `sudo`**. It calls `sudo` on its own for every step that needs root privileges (you will be prompted for your password), and it adds **the user running it** to the `docker` group. Launching it with `sudo` would add `root` to that group instead, and you would still not be able to use Docker as your own user afterwards.
{% endhint %}

The command is **interactive** and **safe to re-run**: it only checks what is already present and installs what is missing, so you can run it again after fixing a problem or after adding a GPU to the server.

#### 1. Distribution detection

The distribution and version are read from `/etc/os-release` (or `lsb_release`).

An unsupported distribution or version does not stop the command: it is reported as a failed `OS` requirement and the other steps still run, but the installation is then unsupported and may fail.

#### 2. Installation type

You are asked to choose between a CPU-only and a GPU installation:

```
Choose installation type:
1) CPU-only installation (no NVIDIA components)
2) GPU installation (with NVIDIA drivers and container toolkit)
Enter your choice (1 or 2):
```

Choose **2** if the server has an NVIDIA GPU — this is the recommended setup for Blurit OP, and by far the fastest. Choose **1** for a CPU-only server: all NVIDIA-related steps are then skipped.

#### 3. GPU detection

For a GPU installation, the GPU is detected with `lspci` (or `nvidia-smi` when `lspci` is not available) and the driver to install is selected accordingly — a **Tesla** (datacenter) GPU uses the NVIDIA CUDA repositories, a standard GPU uses the distribution's driver packages.

If no NVIDIA GPU is found, the NVIDIA components are skipped and a warning is printed at the end of the run.

#### 4. Requirements report

The status of every requirement is then printed, in green when satisfied, in red when missing, in yellow for warnings:

```
Requirements:
  OS............................. Ubuntu 22.04.4 LTS
  RAM (>= 16 GB)................. Installed
  Disk space (>= 60 GB).......... Yes
  Docker......................... Not installed
  Docker Compose (optional)...... Not installed
  User in docker group (optional) Missing
  Shell completion (optional).... Not installed
  NVIDIA driver.................. Not installed
  NVIDIA Container Toolkit....... Not installed
  Docker NVIDIA runtime.......... Not configured
```

{% hint style="info" %}
If you run `blurit requirmeents` after havign already installed Blurit OP, the CLI may report insufficient disk space. In that cas, you can probably safely ignore the warning as no extra installation files will be downloaded.
{% endhint %}

| Requirement                  | What is checked                                                                                            | What is installed / configured                                                                                                |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **OS**                       | Distribution and version are in the supported list                                                         | Nothing — informational warning only                                                                                          |
| **RAM (>= 16 GB)**           | Total RAM reported by `/proc/meminfo`                                                                      | Nothing — a warning is printed below 16 GB, BlurIt may not run optimally                                                      |
| **Disk space (>= 60 GB)**    | Free space on the Docker data directory (`docker info -f '{{.DockerRootDir}}'`, usually `/var/lib/docker`) | Nothing — a warning is printed below 60 GB, BlurIt may not run optimally                                                      |
| **Docker**                   | The `docker` command exists                                                                                | Docker CE from Docker's official repository (`docker-ce`, `docker-ce-cli`, `containerd.io`, buildx and compose plugins)       |
| **Docker Compose**           | `docker compose version` succeeds, or `docker-compose` exists                                              | Installed with Docker; on Amazon Linux, the latest Compose plugin is downloaded into `/usr/local/lib/docker/cli-plugins`      |
| **User in docker group**     | Your user belongs to the `docker` group                                                                    | `sudo usermod -aG docker $USER`, so that BlurIt can be operated without `sudo`                                                |
| **Shell completion**         | The completion line is present in your `~/.bashrc` or `~/.zshrc`                                           | Adds the `blurit` auto-completion line to that file                                                                           |
| **NVIDIA driver**            | The `nvidia-smi` command exists                                                                            | The NVIDIA driver for your distribution and GPU model (GPU installation only)                                                 |
| **NVIDIA Container Toolkit** | The `nvidia-ctk` command exists                                                                            | `nvidia-container-toolkit`, then `nvidia-ctk runtime configure --runtime=docker` and a Docker restart (GPU installation only) |
| **Docker NVIDIA runtime**    | `"default-runtime": "nvidia"` is set in `/etc/docker/daemon.json`                                          | Writes that runtime configuration into `/etc/docker/daemon.json` and restarts Docker (GPU installation only)                  |

Requirements marked **(optional)** are not blocking: BlurIt runs without them, but you will have to prefix every Docker command with `sudo` if you skip the `docker` group.

#### 5. Selecting what to install

Only the missing requirements are then offered, in a checkbox list where everything is selected by default:

```
Select requirements to install (up/down to move, space to toggle, enter to confirm):
> [x] Docker
  [x] Docker Compose
  [x] User in docker group
  [x] Shell completion
  [x] NVIDIA driver
  [x] NVIDIA Container Toolkit
  [x] Docker NVIDIA runtime
```

* **up / down arrows** move the cursor,
* **space** toggles the entry under the cursor,
* **enter** confirms and starts the installation.

Uncheck an entry to keep an existing setup of your own — for example a Docker installation managed by your IT department. If you uncheck everything, nothing is installed.

If all requirements are already satisfied, the command simply prints `All requirements are already installed.` and moves on to the final steps.

#### 6. Installation

Each selected requirement is installed in turn, then re-checked. The output of the underlying package manager is displayed as it runs, and `sudo` may ask for your password. If a requirement is still missing after its installation step, the command stops with an error so that you can fix the cause before going further.

Installing an NVIDIA driver takes several minutes, during which the server may seem unresponsive. This is expected — do not interrupt the command.

#### 7. Final steps

Depending on what was installed, the command ends with up to three questions:

1. **Reboot** — if an NVIDIA driver was installed, a reboot is required to load it:

   ```
   NVIDIA drivers were installed and require a reboot to load. Reboot now? THE SERVER WILL BE RESTARTED! [y/N]:
   ```

   Answer `y` to reboot immediately, or `N` to reboot yourself later. **The driver is not usable until the server has rebooted.**
2. **`newgrp docker`** — if your user was added to the `docker` group, the change only applies to new sessions. Accepting opens a new shell with the group applied, so you can continue right away; otherwise, log out and log back in.
3. **Installing the CLI** — if `blurit` is not in your `PATH`, the command offers to copy the binary there:

   ```
   The 'blurit' binary is not in your PATH, do you want to install it somewhere in your PATH?
   Be sure to choose a directory that is listed in your PATH
   Installation directory [/usr/local/sbin]:
   ```

   Accept the proposed directory (or type another one that is in your `PATH`) and every later command can be called as `blurit ...` instead of `./blurit ...`.

{% hint style="info" %}
If you would rather install it yourself, move it to a directory of your `PATH` and drop the `./` prefix from every command below:

```bash
sudo mv blurit /usr/local/sbin
```

And if running `./blurit` reports `Permission denied`, the executable bit was lost while copying the archive around: restore it with `chmod +x blurit`.
{% endhint %}

### Amazon Linux

Amazon Linux images are expected to ship with Docker and, for GPU instances, with the NVIDIA driver, the container toolkit and the Docker NVIDIA runtime already installed and configured. The command therefore only checks them, and installs Docker Compose when it is missing. A missing `docker` binary is a fatal error: install Docker before running `blurit requirements`.

### Verifying the installation

After the run (and after the reboot, if there was one):

{% code lineNumbers="true" %}

```bash
docker version            # Docker is installed and usable without sudo
docker compose version    # Docker Compose plugin
nvidia-smi                # GPU installation only: driver loaded, GPU visible
```

{% endcode %}

For a GPU installation, you can also check that Docker can reach the GPU:

```bash
docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
```

### Troubleshooting

* **`permission denied` on the Docker socket** — your session does not have the `docker` group yet. Run `newgrp docker`, or log out and log back in.
* **`blurit: command not found`** — the binary is not in your `PATH`. Call it from the directory where you extracted the archive with `./blurit`, or move it to a directory of your `PATH` (`sudo mv blurit /usr/local/sbin`).
* **A requirement fails to install** — the command stops with `<requirement> installation failed`. Fix the cause reported by the package manager above that line (no network access, proxy, repository not reachable, disk full), then run `./blurit requirements` again: the steps already completed are skipped.
* **Unsupported distribution** — the `OS` requirement is red. You can continue at your own risk, or follow the [manual installation](#choice-2-manual-dependencies-installation).

### Running it as part of the installation

The requirements steps can also be run right before the BlurIt configuration, in a single command:

```bash
./blurit install --requirements
```

:rotating\_light: If NVIDIA drivers were installed, please reboot the server to load them, then go to the Configuration page. :rotating\_light:

## Choice 2 : manual dependencies installation

### Nvidia drivers Installation

1. Download the NVIDIA driver >= 470 runfile from: <https://www.nvidia.com/Download/index.aspx?lang=en-us>
2. Open a terminal and navigate to the directory where the downloaded runfile is located.
3. `$ chmod +x <filename>.run`\
   Replace `<filename>` with the actual name of the downloaded runfile.
4. `$ sudo ./<filename>.run`
5. `$ sudo reboot`

### Docker Installation

The Docker installation documentation is [here](https://docs.docker.com/engine/install/).

{% tabs %}
{% tab title="Ubuntu" %}
{% code lineNumbers="true" fullWidth="false" %}

```bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin
```

{% endcode %}
{% endtab %}

{% tab title="Debian" %}
{% code lineNumbers="true" %}

```bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin
```

{% endcode %}
{% endtab %}

{% tab title="Centos" %}
{% code lineNumbers="true" %}

```bash
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker
```

{% endcode %}
{% endtab %}

{% tab title="RHEL" %}
{% code lineNumbers="true" %}

```bash
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker
```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Post-install docker linux (required):

{% code lineNumbers="true" %}

```bash
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
```

{% endcode %}

### Nvidia-docker installation

Nvidia-docker installation documentation is [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

{% tabs %}
{% tab title="Ubuntu / Debian" %}
{% code lineNumbers="true" %}

```bash
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
```

{% endcode %}
{% endtab %}

{% tab title="Centos / RHEL" %}
{% code lineNumbers="true" %}

```bash
curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
  sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo

sudo yum clean expire-cache
sudo yum install -y nvidia-container-toolkit
```

{% endcode %}
{% endtab %}
{% endtabs %}

Configure the Docker daemon to recognize the NVIDIA Container Runtime:

{% code lineNumbers="true" %}

```bash
sudo nvidia-ctk runtime configure --runtime=docker
```

{% endcode %}

Restart the Docker daemon to complete the installation after setting the default runtime:

{% code lineNumbers="true" %}

```bash
sudo systemctl restart docker
```

{% endcode %}

Test if Nvidia-docker is installed:

{% code lineNumbers="true" %}

```bash
sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
```

{% endcode %}

This should result in a console output shown below:

```
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.51.06    Driver Version: 470.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            On   | 00000000:00:1E.0 Off |                    0 |
| N/A   34C    P8     9W /  70W |      0MiB / 15109MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
```

### Configuring daemon.json

Open `/etc/docker/daemon.json` with your favorite text editor.

Add `"default-runtime": "nvidia",` to the json. Exemple:

{% code title="/etc/docker/daemon.json" lineNumbers="true" %}

```json
{
  "default-runtime": "nvidia",
  "runtimes": {
    "nvidia": {
      "args": [],
      "path": "nvidia-container-runtime"
    }
  }
}
```

{% endcode %}
