# Set up the Agent

### Overview

Our lightweight agent (aka `hardpointd`) connects your private infrastructure to your serverless functions.

It's a standalone binary which creates a secure, outbound-only tunnel to our network mesh and handles traffic coming from functions without exposing anything to the internet.

We support Linux and container-based deployments (MacOS support is coming soon).

It's developed in the open in its own [public GitHub repo](https://github.com/hardpointlabs/agent).

### Installation & setup

#### 1. Prerequisite: Getting your Org ID

{% hint style="warning" %}
You need your Org ID to identify agent instances on your Hardpoint network
{% endhint %}

Find your Org ID on the [Settings](https://dashboard.hardpoint.dev/#settings) page in your dashboard. It starts with the `org_` prefix. You'll need to pass this to the agent to identify & admit it to your Hardpoint network.

#### 2. Install the agent

<details>

<summary>Docker</summary>

#### Run the agent directly

You can pull and run the agent inline using the normal `docker run` command:

```bash
docker run --rm -e HARDPOINT_ORG_ID=<YOUR_ORG_ID> --rm -it ghcr.io/hardpointlabs/agent:latest connect
```

This is great for experimentation, however you'll have to manually approve agents in the dashboard each time it starts up via Docker. If you need a longer-lived solution and auto-approval, consider a Kubernetes-based deployment.

</details>

<details>

<summary>Kubernetes</summary>

</details>

<details>

<summary>Linux (Ubuntu &#x26; Debian)</summary>

{% hint style="info" %}
The agent supports most recent Debian & Ubuntu-based distros and has no additional dependencies
{% endhint %}

We release Debian packages of the agent through our APT repository. There is a one-line install script to expedite this process:

#### One-liner

```bash
curl -fsSL https://pkg.hardpoint.dev/setup.sh | bash -s <YOUR_ORG_ID>
```

This will configure our repo with your local apt and install the agent.

#### Manual APT setup

Add our GPG key:

```bash
curl -fsSL https://pkg.hardpoint.dev/apt/hardpoint.gpg | sudo gpg --dearmor -o /usr/share/keyrings/hardpoint-archive-keyring.gpg
```

Add our repository:

```bash
echo "deb [signed-by=/usr/share/keyrings/hardpoint-archive-keyring.gpg] https://pkg.hardpoint.dev/apt/ stable main" | sudo tee /etc/apt/sources.list.d/hardpoint.list
```

Update your local apt cache:

```bash
sudo apt-get update
```

Set your Org ID:

{% hint style="danger" %}
Make sure you set this value **before** installing the agent.
{% endhint %}

```bash
echo "hardpointd hardpointd/org_id string <YOUR_ORG_ID>" | sudo debconf-set-selections
```

Install the agent:

```bash
sudo apt-get install hardpointd
```

Check that it's running:

```bash
sudo service hardpointd status
```

</details>

#### 3. Approve the agent on your network

Go to the [Agents](https://dashboard.hardpoint.dev/#agents) page in your dashboard. You should see a new entry for the agent that you just installed, with the fingerprint corresponding to the one in the agent logs.

If you are sure the fingerprints match, hit the <kbd>Approve</kbd> button.

The agent is now a member of your Hardpoint network!

### Next step: add services

You now have a tunnel to your private network. To allow your agents to accept traffic, you need to explicitly expose services you want your functions to connect to.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hardpoint.dev/hardpoint-connect/getting-started/set-up-the-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
