> 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/adapters/h/hetzner.md).

# Hetzner

Hetzner Cloud provides virtual servers and managed certificates. OctoXLabs reads the servers of one project as devices and the project certificates as certificates.

## Use cases

* List Hetzner servers by operating system.

```
Adapters = hetzner AND OS.Type = Linux
```

* Review the certificates stored in your Hetzner project and their expiry dates in the certificate inventory.

## Before you begin

### Network

| Source              | Destination         | Port | Protocol |
| ------------------- | ------------------- | ---- | -------- |
| OctoXLabs connector | `api.hetzner.cloud` | 443  | HTTPS    |

### Required permissions

| Scope or role            | Permission | Needed for        |
| ------------------------ | ---------- | ----------------- |
| API token of the project | Read       | Devices (servers) |
| API token of the project | Read       | Certificates      |

## Create credentials in Hetzner

{% stepper %}
{% step %}

### Open the project

In the Hetzner Console choose the project that holds your servers.
{% endstep %}

{% step %}

### Generate a token

Go to **Security** > **API Tokens** and generate a new token. A read only token is enough for OctoXLabs; the connector sends only GET requests.
{% endstep %}

{% step %}

### Copy the token

Copy it when it is shown and paste it into the API Token field.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type    | Default | Description                                                          |
| --------- | -------- | ------- | ------- | -------------------------------------------------------------------- |
| API Token | Yes      | Text    | None    | API token of the Hetzner project.                                    |
| Timeout   | No       | Integer | `30`    | Seconds to wait for API responses.                                   |
| Proxy     | No       | Text    | None    | Proxy in `host:port` form. The connector prefixes it with `http://`. |

## Troubleshooting

| Error message                               | Cause                                                               | Fix                                                             |
| ------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------- |
| Not verified                                | `AuthenticationTokenError` is raised when the API answers HTTP 401. | Check that the token is valid and belongs to the right project. |
| `Request to <url> failed after 5 attempts.` | The API kept returning HTTP 429.                                    | Run discovery again later.                                      |

## Change history

{% hint style="info" %}
Available starting from version 6.4.0.
{% endhint %}
