> 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-4-2/deployment/installing-connectware/uninstalling-connectware.md).

# Uninstalling Connectware

This page explains how to completely remove Connectware from your Docker or Kubernetes environment.

{% hint style="warning" %}
Make sure to back up any important data before proceeding with the uninstallation, as this process will permanently remove all Connectware-related data from your system.
{% endhint %}

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

## Prerequisites

* [Helm version 4](https://helm.sh/docs/intro/quickstart/#install-helm) is installed on your system.
* [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) is installed on your system.
* You know the name and namespace of your Connectware installation (see [Obtaining the Name, Namespace, and Version of your Connectware Installation](/2-4-2/cybus-helm-charts/cybus-helm-charts.md#obtaining-the-name-namespace-and-version-of-your-installation)).

## Uninstalling Connectware

To uninstall Connectware, use the helm uninstall command on your Connectware on Kubernetes installation:

{% code lineNumbers="true" %}

```bash
helm uninstall -n ${NAMESPACE} ${INSTALLATION_NAME}
```

{% endcode %}

Replace `${NAMESPACE}` with the namespace of your Connectware installation and `${INSTALLATION_NAME}` with the name of your Connectware installation.

## Cleaning up Leftover Resources

Some resources will intentionally not be removed, like some PersistentVolumeClaims, and potentially ConfigMaps and secrets manually created for mTLS.

If you want to completely clean up, for example for a fresh install, use this command to identify the resources:

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} get all,cm,secret,pvc
```

{% endcode %}

Keep in mind that some resources are part of a standard Kubernetes namespace, for example `configmap/kube-root-ca.crt` or `service/kubernetes`. After identifying the resources for cleanup, use this command to remove them:

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} delete <resource-1> <resource-2> <resource-n>
```

{% endcode %}

**Example**

{% code lineNumbers="true" %}

```bash
kubectl -n ${NAMESPACE} delete persistentvolumeclaim/brokerdata-broker-0
persistentvolumeclaim/brokerdata-broker-1 configmap/cw-mtls-ca-cert
secret/cw-mtls-welder-robots
persistentvolumeclaim/postgresql-postgresql-0
persistentvolumeclaim/certs
```

{% endcode %}

{% hint style="info" %}
If you plan a fresh installation in the same location, make sure to remove `persistentvolumeclaim/postgresql-postgresql-0` and `persistentvolumeclaim/certs`.
{% endhint %}
{% endtab %}

{% tab title="Docker" %}

1. Switch to the root user and navigate to your installation directory:

{% code lineNumbers="true" %}

```bash
sudo -i
cd <installation-directory>
```

{% endcode %}

2. Stop and remove all Docker containers, networks, and volumes associated with Connectware:

{% code lineNumbers="true" %}

```bash
docker compose down -v
```

{% endcode %}

3. Navigate up one directory level and delete the installation directory:

{% code lineNumbers="true" %}

```bash
cd ..
rm -R <installation-directory>
```

{% endcode %}

If you have installed Connectware via systemd, proceed with the next steps.

4. systemd installations only: Disable the Connectware service.

{% code lineNumbers="true" %}

```bash
systemctl disable connectware
```

{% endcode %}

5. Remove the service file:

{% code lineNumbers="true" %}

```bash
rm /etc/systemd/system/connectware.service
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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/2-4-2/deployment/installing-connectware/uninstalling-connectware.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.
