> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LDB Installation

> The [LDB](https://github.com/scanoss/ldb) is the underlying database engine for the Knowledge Base (KB) and is required for the [SCANOSS Engine](https://github.com/scanoss/engine) to run.

## Installation

> **Note:** The commands below download from the `master` branch. If the repository has been updated to use `main` or another default branch, adjust the URL accordingly.

```bash theme={null}
wget -O ldb.zip https://github.com/scanoss/ldb/archive/master.zip
unzip ldb.zip
cd ldb-master
make
make lib
sudo make install
```

## Directory Setup

In production environments, the Knowledge Base (KB) is typically stored on a dedicated disk or logical volume. Create your KB directory as follows:

```bash theme={null}
sudo mkdir -p /data/ldb/oss  # 'oss' is the KB name
sudo chown -R user:user /data/ldb  # Replace 'user' with your system username
sudo chmod -R 755 /data/ldb
```

> **Note:** Replace `user` with the username that will run the SCANOSS Engine.

Create a symbolic link from the default LDB path (`/var/lib/ldb`) to your KB directory:

```bash theme={null}
sudo ln -s /data/ldb /var/lib/ldb
```

The subdirectories (`purl`, `url`, `file`, `wfp`) are created automatically during the KB import process — you do not need to create them manually.

## Verify Installation

Run the following command to confirm LDB is installed correctly:

```bash theme={null}
ldb
```

You should see the following output:

```
Welcome to LDB 2.02
Use help for a command list and quit for leaving this session
```

To exit the LDB session, run:

```bash theme={null}
ldb> quit
```
