> For the complete documentation index, see [llms.txt](https://docs.cybus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cybus.io/1-9-0/documentation/agents/installing-agents/installing-agents-via-docker.md).

# Installing Agents via Docker

The following explains how to install agents via the `docker run`command using an example.

In this example, we will install an agent named `myAgent` that persists data to `/tmp/cybus` on the host system.

* In your terminal, enter the following command using to install an agent. For the `IMAGE_TAG`variable, make sure to specify the image version that you want to use for the protocol-mapper agent. For example, `1.7.0`.
  * Optional: To run the agent with root permissions, add the parameter `--user=root` to the `docker run` command.

For more information on the parameters, see [Parameters for Installing Agents via Docker](#parameters-for-installing-agents-via-docker)

{% code lineNumbers="true" %}

```yaml
docker run \
-e CYBUS_AGENT_MODE=distributed \
-e CYBUS_AGENT_NAME=myAgent \
-e CYBUS_MQTT_HOST=10.11.12.13 \
-v /tmp/cybus:/data \
--restart unless-stopped \
--net=host \
--hostname=${HOSTNAME} \
registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}
```

{% endcode %}

**Result:** The agent is installed.

## Parameters for Installing Agents via Docker

The following parameters are used to install agents via Docker.

| Parameter                                              | Description                                                                                      |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `-e CYBUS_AGENT_MODE=distributed`                      | This sets the agent to run in distributed mode.                                                  |
| `-e CYBUS_AGENT_NAME=myAgent`                          | Defines the agent name, which must match the `agentName` used in the service commissioning file. |
| `-e CYBUS_MQTT_HOST=10.11.12.13`                       | Specifies the IP address of the Connectware instance.                                            |
| `-v /tmp/cybus:/data`                                  | Mounts a volume to allow the agent to persist data across restarts.                              |
| `--restart unless-stopped`                             | Ensures the container automatically restarts after failures.                                     |
| `--net=host`                                           | Uses host mode networking for the container.                                                     |
| `--hostname=${HOSTNAME}`                               | Assigns a hostname to the container for easier identification.                                   |
| `registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}` | Specifies the image version to be used for the protocol-mapper agent.                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cybus.io/1-9-0/documentation/agents/installing-agents/installing-agents-via-docker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
