> ## 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.

# Overview

> This document provides a step-by-step guide for installing SCANOSS in an on-premises environment.

This section covers everything required to install, configure, and verify a self-hosted SCANOSS deployment. All installation scripts and resources referenced in this guide are available in the [scanoss/on-premise](https://github.com/scanoss/on-premise) repository.

## TL;DR

For users who want to get up and running quickly:

```bash theme={null}
# 1. Clone the repository
git clone https://github.com/scanoss/on-premise.git

# 2. Add execution permissions to the installation scripts
cd on-premise/install/ && chmod +x *.sh

# 3. Install SCANOSS applications — choose option 1) Install everything
sudo ./install-scanoss.sh

# 4. Run the Knowledge Base script — choose whether to install the Full KB, the Test KB, or update an existing KB
sudo ./kb-download.sh
```

## Installation Flow

To better understand the installation process, refer to the Installation Flow Diagram below.

```mermaid theme={null}
flowchart TD
    START([Start Installation]) --> PREP[Prepare Environment<br/>Set permissions]

    PREP --> INSTALL[Run sudo install-scanoss.sh]

    INSTALL --> MENU{Installation Menu}

    MENU -->|Option 1| ALL[Install Everything<br/>Complete automation]
    MENU -->|Options 2-5| MANUAL[Manual Step-by-step]

    ALL --> DEPS[Install Dependencies<br/>Based on OS]
    MANUAL --> DEPS

    DEPS --> SFTP[Setup SFTP Credentials<br/>Username & Password]

    SFTP --> DOWNLOAD[Download Applications<br/>From SFTP Server]

    DOWNLOAD --> APPS[Install SCANOSS Apps<br/>Engine, API, LDB, Encoder]

    APPS --> API_START{Start API Service?}
    API_START -->|Yes| START_API[systemctl start<br/>scanoss-go-api.service]
    API_START -->|No| KB_DOWNLOAD
    START_API --> KB_DOWNLOAD[Run kb-download.sh]

    KB_DOWNLOAD --> KB_MENU{Download Mode}

    KB_MENU -->|Full KB| FULL_KB[Download Full SCANOSS KB<br/>Split destinations<br/>Use tmux recommended]
    KB_MENU -->|Update| UPDATE_KB[Download KB Update<br/>Then run ldb-import.sh]
    KB_MENU -->|Test KB| TEST_KB[Download Test KB<br/>Small size, for testing]

    FULL_KB --> VERIFY[Run test.sh]
    UPDATE_KB --> VERIFY
    TEST_KB --> VERIFY

    VERIFY --> TEST_MENU{Verification Menu}

    TEST_MENU --> SCAN_TEST[Test Scanning Feature<br/>Check scan_results.json]
    TEST_MENU --> API_TEST[Check API Status<br/>Expect alive response]
    TEST_MENU --> METRICS[Check API Metrics<br/>Request counts, etc.]

    SCAN_TEST --> SUCCESS
    API_TEST --> SUCCESS
    METRICS --> SUCCESS[Installation Complete!<br/>SCANOSS Ready to Use]

    SUCCESS --> END([End])

    style START fill:#c8e6c9
    style SUCCESS fill:#c8e6c9
    style END fill:#c8e6c9
    style FULL_KB fill:#ffecb3
    style UPDATE_KB fill:#fff9c4
    style TEST_KB fill:#e1f5fe
    style API_START fill:#f3e5f5
```
