> 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/2-6-1/data-flows/agents/restarting-agents.md).

# Restarting Agents

How to restart Connectware agents running in Docker or Kubernetes environments.

Connectware agents run as containerized workloads, which are managed by your chosen deployment method (Docker or Kubernetes). Agent restarts are performed outside of Connectware using standard platform tools.

Restarting an agent can be necessary if the agent becomes unresponsive, loses connectivity, or needs to reload its configuration.

{% tabs %}
{% tab title="Kubernetes" %}

## Restarting Agents on Kubernetes

### Restarting a Single Agent

Use this if you want to restart a single agent.

{% code lineNumbers="true" %}

```bash
kubectl rollout restart statefulset ${STATEFULSET_NAME} -n ${NAMESPACE}
```

{% endcode %}

{% hint style="info" %}
Replace `${STATEFULSET_NAME}` with your agent StatefulSet name and `${NAMESPACE}` with your namespace.
{% endhint %}

### Restarting All Agents from a `connectware-agent` Installation

Use this if you want to restart all agents managed by one `connectware-agent` installation.

{% code lineNumbers="true" %}

```bash
kubectl rollout restart statefulset -l app.kubernetes.io/instance=${INSTALLATION_NAME} -n ${NAMESPACE}
```

{% endcode %}

{% hint style="info" %}
Replace `${INSTALLATION_NAME}` with the name of your `connectware-agent` installation and `${NAMESPACE}` with your namespace.
{% endhint %}

**Result**

After restarting, your agent will automatically reconnect to Connectware once the pod is running again. Restarting an agent does not affect other agents or the Connectware core system.

**Troubleshooting**

If your agent does not reconnect after a restart, check the pod/container logs for errors and ensure network connectivity to Connectware.
{% endtab %}

{% tab title="Docker" %}

## Restarting Agents with Docker

If the agent is running as a Docker container, you can restart it with:

{% code lineNumbers="true" %}

```bash
docker restart ${CONTAINER_NAME}
```

{% endcode %}

{% hint style="info" %}
Replace `${CONTAINER_NAME}` with the name of the agent container that you want to restart.
{% endhint %}

**Result**

After restarting, the agent will automatically reconnect to Connectware once the container or pod is running again.
{% endtab %}
{% endtabs %}

## Additional Resources

For platform-specific details, see the official documentation:

* Docker: <https://docs.docker.com/>
* Kubernetes: <https://kubernetes.io/docs/>


---

# 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/2-6-1/data-flows/agents/restarting-agents.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.
