> 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-7-3/documentation/agents/installing-agents/installing-agents-via-docker-compose.md).

# Installing Agents via Docker Compose

The following explains how to install agents via Docker Compose using an example.

{% hint style="warning" %}
If multiple agents are running on the same machine, each agent must be assigned its own Docker volume. Otherwise, the agents will overwrite each other’s persisted data, including username and password credentials.
{% endhint %}

1. To log in to the Cybus Docker registry, enter the following command in your terminal:

{% code lineNumbers="true" %}

```yaml
docker login registry.cybus.io
```

{% endcode %}

When prompted, enter the following credentials:

* Username: `license`
* Password: Your Connectware license key

2. Create a folder (e.g. `myAgent`)
3. Create a new file and name it `docker-compose.yml`.
4. Paste the following service commissioning file example into the file. 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`.

{% code lineNumbers="true" %}

```yaml
version: '2.0'
services:
    protocol-mapper-agent:
        image: registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}
        environment:
            CYBUS_AGENT_MODE: distributed
            CYBUS_AGENT_NAME: myAgent
            CYBUS_MQTT_HOST: 10.11.12.13
        volumes:
            - protocol-mapper-agent:/data
        restart: unless-stopped
        network_mode: host
        hostname: <some-suitable-hostname>
volumes:
    protocol-mapper-agent:
```

{% endcode %}

5. In your terminal, enter the following command to run the file:

{% code lineNumbers="true" %}

```yaml
docker compose up -d
```

{% endcode %}

6. Optional: To run the agent with root permission, add `user: root` to the `docker-compose.yml` file.

{% code lineNumbers="true" %}

```yaml
version: '2.0'
services:
  protocol-mapper-agent:
    user: root
    image: registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}
    [...]
```

{% endcode %}

**Result:** The agent is installed.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.cybus.io/1-7-3/documentation/agents/installing-agents/installing-agents-via-docker-compose.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
