> 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/install-a-remote-connector.md).

# Install a remote connector

Install a connector in another network and register it so adapters can use it.

Install a connector on a separate host and register it with OctoXLabs, so adapters that the main server cannot reach can still collect data. You can run any number of connectors, in the same network as the platform or in other networks.

### Before you begin

* Applies to: OctoXLabs 6.x. Confirm the minimum version before publishing.
* Required role: root, or a user with `sudo`, on the connector host. In the console, a user who can manage connectors (the Admin role from 6.9.0).
* You have the connector package for your distribution, named like `octoxlabs_connector_stable_YOUR_VERSION_amd64_BUILD_offline.deb` or `.rpm`, from OctoXLabs. The connector version should match your platform version.
* The connector host can reach the main server, and the main server can reach the connector host. See the ports below.
* You know the Elasticsearch password of the main server. It is stored as `ELASTICSEARCH_PASSWORD` in `/opt/octoxlabs/data/.env` on that server.

#### Ports to open

| Direction                | Destination    | Default port  |
| ------------------------ | -------------- | ------------- |
| Main server to connector | Connector host | 3443 (HTTPS)  |
| Connector to main server | Backend API    | 8443 (HTTPS)  |
| Connector to main server | Elasticsearch  | 19200 (HTTPS) |

All three ports can be changed. The connector's own port is set with the `CONNECTOR_NGINX_PORT` variable.

{% hint style="warning" %}
The installer creates a Docker network named `octo-network` with the subnet `10.5.0.0/16`. Make sure that range does not clash with networks that the connector host already uses. On Red Hat systems where the installer installs Docker for you, SELinux is set to permissive.
{% endhint %}

### Install the connector

{% stepper %}
{% step %}

#### Copy the package to the connector host

Copy the package to `/tmp` on the connector host.
{% endstep %}

{% step %}

#### Install the package

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

The package loads the connector image. In offline mode it also installs Docker and docker-compose when they are missing.
{% endstep %}

{% step %}

#### Run the connector setup

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

The script asks for the following. It skips any item that is already configured.

1. **Host IP.** Choose the address of the connector host and confirm with a capital `Y`.
2. **Backend URL.** The address of the main OctoXLabs server, for example `https://your-octo-host:8443`.
3. **Elasticsearch Host.** The Elasticsearch address of the main server.
4. **Elasticsearch Password.** Typed silently.

The script also creates the `octo-network` Docker network and a default proxy settings file with empty values.
{% endstep %}

{% step %}

#### Start the connector

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

The command waits until the `octo.connector-api` container reports healthy.
{% endstep %}

{% step %}

#### Get the connector token

```bash
sudo octox-connector-ctl -x token
```

Copy the token that the command prints.
{% endstep %}

{% step %}

#### Register the connector in the console

1. Go to **Settings > Connectors** (under Data Source Settings) and select **Create Connector**.
2. Enter a unique **Connector Name**, for example `Branch office connector`.
3. Enter the **URL**: the base URL of the connector, for example `https://your-connector-host:3443`.
4. Paste the **Token**.
5. If outbound traffic needs a proxy, enter the **HTTPS Proxy** and, if required, the proxy username and password.
6. Select **Create**.
   {% endstep %}

{% step %}

#### Assign the connector to an adapter

1. Open **Adapters** and select the adapter.
2. Select **Create New Connection**.
3. In the **Connector** dropdown, choose your new connector, then complete the connection.

The connector you choose is the one that the adapter uses to talk to its source system.
{% endstep %}
{% endstepper %}

### Verify the result

* `sudo octox-connector-ctl -x ps` lists the connector containers (`octo.connector-api`, `octo.connector-workers`, `octo.connector-database`, `octo.connector-queue-redis`, `octo.connector-nginx`).
* `octox-connector-ctl -v` prints the connector version.
* The new connector appears in the Connectors list, and a connection test on an adapter that uses it succeeds.

### Manage the connector

| Command                                                          | What it does                                                                               |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `octox-connector-ctl -x ps`                                      | Show the running services.                                                                 |
| `octox-connector-ctl -x up`                                      | Start the connector.                                                                       |
| `octox-connector-ctl -x down`                                    | Stop the connector.                                                                        |
| `octox-connector-ctl -x restart`                                 | Stop and start the connector.                                                              |
| `octox-connector-ctl -x token`                                   | Print the connector token.                                                                 |
| `octox-connector-ctl -x set -c CERT.crt -k KEY.key -p PASS.pass` | Replace the connector's TLS certificate. The previous files are kept with a `.old` suffix. |

The connector ships with a placeholder certificate so that it can start. Replace it with your own certificate for production use.

### Troubleshooting

| Symptom                                         | Cause                                                  | Fix                                                                                                      |
| ----------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| `zstd not found and no bundled binary present.` | The installer found no `zstd`.                         | Install it: `sudo apt-get install -y zstd` (Debian-based) or `sudo dnf install -y zstd` (Red Hat-based). |
| `Waiting for connector service...` repeats      | The `octo.connector-api` container is not yet healthy. | Wait, then check the container logs.                                                                     |

<details>

<summary>Read the connector logs</summary>

```bash
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>Connect an adapter</strong></td><td>Create a connection that uses your connector.</td><td></td></tr><tr><td><strong>Offline installation</strong></td><td>Install without internet access.</td><td></td></tr><tr><td><strong>Updating the Platform</strong></td><td>Update the platform and its connectors.</td><td></td></tr></tbody></table>
