---
schema_version: "1"
id: 8ef6c8253386a50aa2934aa8dea484c442c840a6cdcd035ccf3789efdb5ed0b1
title: Uninstall Self-Managed Flex Gateway
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.9/flex-gateway-uninstall.md
canonical_url: https://docs.mulesoft.com/gateway/1.9/flex-gateway-uninstall
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2c5eaa479f9dd172a9add132d58698d1d88f8944f938a002a9b94588e560cb28
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
---
product: Omni Gateway
version: 1.9
---

# Uninstall Self-Managed Flex Gateway

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

You can uninstall Flex Gateway running as a Linux service, in a container, or in a Kubernetes
cluster.

<table><colgroup><col> <col> <col></colgroup><tbody><tr><td><div><div><p><span><a href="#linux"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-linux-logo.png" alt="20%" width="20%"></a></span></p></div></div></td><td><div><div><p><span><a href="#docker"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-docker-logo.png" alt="25%" width="25%"></a></span></p></div></div></td><td><div><div><p><span><a href="#kubernetes"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-kubernetes-logo.png" alt="20%" width="20%"></a></span></p></div></div></td></tr><tr><td><div><div><p><a href="#linux">Uninstall Flex Gateway Running as a Linux Service</a></p></div></div></td><td><div><div><p><a href="#docker">Uninstall Flex Gateway Running in a Docker Container</a></p></div></div></td><td><div><div><p><a href="#kubernetes">Uninstall Flex Gateway Running in a Kubernetes Cluster</a></p></div></div></td></tr></tbody></table>

## Uninstall Flex Gateway Running as a Linux Service

Flex Gateway can be uninstalled as any other package:

```ssh
sudo apt remove -y flex-gateway
```

## Uninstall Flex Gateway Running in a Docker Container

To uninstall Flex Gateway, stop and remove the Flex Gateway container:

1.  Determine the Flex Gateway container ID by listing all the running containers:

    ```ssh
    docker ps
    ```

2.  In the list of containers, note the container ID associated with the Flex Gateway container you
    want to uninstall.

3.  Stop the Flex Gateway container:

    ```ssh
    docker stop <container id>
    ```

    Replace `<container-id` with the container ID of the Flex Gateway container you want to stop:

4.  Remove the Flex Gateway container:

    ```ssh
    docker rm <container id>
    ```

    Replace `<container-id` with the container ID of the Flex Gateway container you want to remove.
    The command permanently deletes the container and its associated resources.

5.  Optionally, remove the Flex Gateway container image:

    ```ssh
    docker rmi mulesoft/flex-gateway
    ```

6.  To confirm that Flex Gateway is uninstalled, run the `docker ps` command again. The uninstalled
    container no longer appears in the list.

## Uninstall Flex Gateway Running in a Kubernetes Cluster

To uninstall Flex Gateway running in a Kubernetes cluster:

1.  Uninstall the Helm release. The following example removes a release called “my-release”:

    ```ssh
    helm delete my-release
    ```

    > [!NOTE] Update `my-release` to the release you have running. To see a list of all releases,
    > use the command `helm list -A`.

2.  Delete the release namespace if one was specified:

    ```ssh
    kubectl delete namespace gateway
    ```

3.  Delete the custom resource definitions:

    ```ssh
    kubectl delete crds \
         apiinstances.gateway.mulesoft.com \
         configurations.gateway.mulesoft.com \
         extensions.gateway.mulesoft.com \
         policybindings.gateway.mulesoft.com \
         services.gateway.mulesoft.com
    ```
