> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/documentation/deploy-and-administer/installation.md).

# Installation

Check the requirements, install the OctoXLabs server from the package, and confirm that the platform is healthy.

Install OctoXLabs on a Linux server, set up the default connector, and confirm that the platform is running. This page covers the standard installation from the installation package. Use the sub-pages for installs without internet access and for connectors in other networks.

### Before you begin

* Applies to: OctoXLabs 6.x. The procedure below is written from the installation guide and the 6.x notes; confirm the minimum version before publishing.
* Required role: root, or a user with `sudo`, on the server.
* You have the OctoXLabs installation package (`.deb` for Debian-based systems, `.rpm` for Red Hat-based systems) from OctoXLabs.
* You can reach the server from your workstation with `scp` or WinSCP, and open `https://your-octo-host` in a browser after the install.

{% hint style="info" %}
OctoXLabs runs as Docker containers on Ubuntu or Red Hat distributions. The platform is installed on-premises, on a server that you control.
{% endhint %}

### Requirements

#### Server sizing

Resource use is driven mostly by Elasticsearch and grows with the number of unique assets. The peak happens during discovery. Choose the row that matches your environment.

| Unique assets and/or adapters          | RAM (GB)          | CPU cores | Disk (GB) | Disk type |
| -------------------------------------- | ----------------- | --------- | --------- | --------- |
| 500 to 10k assets and/or 10 adapters   | 48                | 8         | 500       | SSD       |
| 10k to 25k assets and/or 20 adapters   | 64                | 8         | 500       | SSD       |
| 25k to 100k assets and/or 20 adapters  | 128               | 16        | 1000      | SSD       |
| 100k to 500k assets and/or 20 adapters | 256               | 32        | 1500      | SSD       |
| More than 500k assets and 20 adapters  | Contact OctoXLabs |           |           |           |

#### Operating system

* Ubuntu and other Debian-based distributions: install the `.deb` package.
* Red Hat-based distributions (RHEL, CentOS): install the `.rpm` package.
* On Ubuntu, the installer checks for `bzip2` and `curl` before it continues (6.5.0 and later). Install both first on minimal images.

#### Ports

| Service       | Default port | Protocol | Who connects                                       | Can you change it? |
| ------------- | ------------ | -------- | -------------------------------------------------- | ------------------ |
| UI (frontend) | 443          | HTTPS    | Users' browsers                                    | No                 |
| Backend API   | 8443         | HTTPS    | API users and remote connectors                    | Yes                |
| Elasticsearch | 19200        | HTTPS    | Remote connectors                                  | Yes                |
| Connector     | 3443         | HTTPS    | The backend, when the connector is on another host | Yes                |

PostgreSQL is not exposed outside the internal Docker network. Open the Backend API, Elasticsearch and connector ports only when you use remote connectors.

#### Outbound access for optional services

| Service       | Destination                                                                    | Port     | Needed for                                   |
| ------------- | ------------------------------------------------------------------------------ | -------- | -------------------------------------------- |
| Online update | OctoXLabs Online Update Service (IP-restricted, see Use Online Update Service) | 80 / 443 | Updating online                              |
| Query AI      | `ai.octoxlabs.io`                                                              | 80       | Natural-language queries in the query wizard |
| AVM           | `vulnman.octoxlabs.io`                                                         | 443      | Vulnerability inventory services             |

### Install the server

{% stepper %}
{% step %}

#### Upload the package

Copy the package to the `/tmp` directory on the server. Replace the file name with your package.

```bash
scp octoxlabs-package.deb user@your-octo-host:/tmp/
```

{% endstep %}

{% step %}

#### Install the package

Install the package with the tool for your distribution. Replace `PACKAGE_PATH` with the file name.

{% tabs %}
{% tab title="Debian and Ubuntu" %}

```bash
sudo dpkg -i /tmp/PACKAGE_PATH
```

{% endtab %}

{% tab title="Red Hat and CentOS" %}

```bash
sudo rpm -i /tmp/PACKAGE_PATH
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### Run the setup script

```bash
sudo octox-ctl -x setup
```

The script asks two things:

1. **Host IP.** It lists the IP addresses on the host. Choose the address where you installed OctoXLabs and press Enter. When it asks `Are you sure? [Y/n]`, type a capital `Y` and press Enter.
2. **Root company name.** Enter the name and press Enter.
   {% endstep %}

{% step %}

#### Start OctoXLabs

```bash
sudo octox-ctl -x up
```

This starts all the containers that OctoXLabs needs.
{% endstep %}

{% step %}

#### Sign in

Open `https://your-octo-host` in a browser. For the first sign-in credentials, contact the OctoXLabs Solutions team.
{% endstep %}

{% step %}

#### Set the default connector token

1. In the console, go to **Settings > Connectors** (under Data Source Settings) and select **Edit** for the **Default Connector**.
2. On the server, print the connector token:

   ```bash
   sudo octox-ctl -x token
   ```
3. Paste the token into the **Token** field. If your network needs a proxy, assign it here.
4. Select **Save**, then **Send Test**.
   {% endstep %}

{% step %}

#### Add the licence key

1. Go to **Settings > Product Licence** and copy the **Company Key**.
2. Send the Company Key to OctoXLabs to get your licence key.
3. Paste the licence key into the box under **Company Key**, then sign out and sign back in.
   {% endstep %}
   {% endstepper %}

### Post-install checks

Run these checks before you add adapters.

* Services: `sudo octox-ctl -x ps` lists the running OctoXLabs services. The main containers are `octo.backend-django`, `octo.backend-workers`, `octo.frontend`, `octo.data-elastic` and the connector containers.
* Connector: the **Send Test** in the last step succeeds.
* Licence: after you sign back in, the Product Licence page shows your licence.
* Elasticsearch: the cluster health is `green`, with `unassigned_shards` at `0`.

```bash
ELASTIC_PASSWORD=$(grep "ELASTICSEARCH_PASSWORD=" /opt/octoxlabs/data/.env | cut -d '=' -f2- | tr -d '\r')
curl -s -k -u "elastic:$ELASTIC_PASSWORD" "https://localhost:19200/_cluster/health?pretty"
```

If the status is `yellow`, follow the Elasticsearch steps in Updating the Platform.

### Troubleshooting

| Symptom                          | Cause                                        | Fix                                                                                             |
| -------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `dpkg` or `rpm` reports an error | The package does not match the distribution. | Use the `.deb` package on Debian-based systems and the `.rpm` package on Red Hat-based systems. |
| `Permission denied`              | The user lacks the required privileges.      | Run the commands as root or with `sudo`.                                                        |

<details>

<summary>Read the backend or connector logs</summary>

The backend and connector write debug logs inside their containers.

```bash
docker exec -it octo.backend-django cat /app/debug.log
docker exec -it octo.connector-api cat /code/debug.log
```

</details>

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Offline installation</strong></td><td>Install on a server without internet access.</td><td></td></tr><tr><td><strong>Install a remote connector</strong></td><td>Reach adapters that the main server cannot.</td><td></td></tr><tr><td><strong>Add an SSL certificate</strong></td><td>Replace the default certificate with your own.</td><td></td></tr><tr><td><strong>Updating the Platform</strong></td><td>Upgrade to a newer version.</td><td></td></tr></tbody></table>
