> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archil.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uninstall tools

> Remove the Archil client, the disk CLI, and the CSI driver.

This page covers removing each Archil tool:

* **The Archil client**, which mounts disks: [Linux](#linux) and [macOS](#macos)
* **The [`disk` npm package](#disk-npm-package)**, which provides the `disk` and `sandbox` CLIs
* **The [CSI driver](#kubernetes)** for Kubernetes

Removing the client works the same way on Linux and macOS:

1. **Unmount every Archil disk.** A clean unmount flushes recently written data to Archil and releases any files you have
   checked out. If you remove the client while a disk is still mounted, writes that haven't been flushed yet are lost.
2. **Remove the software.**
3. **Optionally remove local files.** These include saved credentials, so remove them if the machine is being
   decommissioned or handed to someone else.

<Note>
  Uninstalling the client doesn't change your disks or the data on them. Disks stay in your account until you delete them
  from the [Archil console](https://console.archil.com).
</Note>

## Linux

The Linux client is distributed as a package named `archil`. It installs two files:

| Path | Purpose |
| - | - |
| `/usr/bin/archil` | The `archil` client |
| `/sbin/mount.archil` | The helper that lets `mount` and `/etc/fstab` mount Archil disks |

<Steps>
  <Step title="Unmount every disk">
    List the Archil disks currently mounted on the server:

    ```bash theme={null}
    grep archil /proc/mounts
    ```

    Unmount each one with `archil unmount`, which flushes pending writes before it disconnects:

    ```bash theme={null}
    sudo archil unmount /mnt/data
    ```

    Then confirm that no client processes are still running:

    ```bash theme={null}
    pgrep -a archil
    ```

    If a process is still listed, it's still flushing data. Wait for it to exit, and don't `kill -9` it.
  </Step>

  <Step title="Remove automatic mounts">
    If you [mount disks automatically on startup](/mounting/linux#mount-automatically-on-startup), remove the Archil
    entries from `/etc/fstab`. Otherwise, the server tries to mount them at the next boot and fails.

    ```bash theme={null}
    grep -nw archil /etc/fstab     # find the entries
    sudo nano /etc/fstab           # delete them
    sudo systemctl daemon-reload   # on systemd hosts, drop the generated mount units
    ```

    Also remove any startup scripts, systemd units, or configuration management that runs `archil mount`.
  </Step>

  <Step title="Remove the package">
    <Tabs>
      <Tab title="Debian / Ubuntu">
        ```bash theme={null}
        sudo apt remove archil
        ```
      </Tab>

      <Tab title="RHEL / Fedora / Amazon Linux">
        ```bash theme={null}
        sudo dnf remove archil
        ```

        On older systems, use `sudo yum remove archil`. On systems without either, use `sudo rpm -e archil`.
      </Tab>

      <Tab title="Alpine">
        On Alpine, the installer copies a standalone binary instead of installing a package. Remove it directly:

        ```bash theme={null}
        sudo rm -f /usr/bin/archil
        ```
      </Tab>
    </Tabs>

    The FUSE library that the installer pulled in (`libfuse2`, `fuse-libs`, or `fuse`) is left installed, because other
    software may depend on it.
  </Step>

  <Step title="Remove leftover files (optional)">
    The package manager doesn't remove the files below, even with `apt purge`, because the package didn't create them.

    | Path | Contents |
    | - | - |
    | `/etc/archil/` | Client configuration, including your automatic-upgrade preference |
    | `~/.cache/archil/` | Upgrade-check state, created separately for each user who ran `archil`, including `root` |
    | `/var/run/archil/` | Control sockets for running mounts. Empty once every disk is unmounted. |
    | `/var/log/archil/` | Log files, present only if the client couldn't log to journald |
    | Any directory you passed to `--log-dir` | Per-mount log files |

    ```bash theme={null}
    sudo rm -rf /etc/archil /var/run/archil /var/log/archil /root/.cache/archil
    rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/archil"   # repeat for each user who ran archil
    ```
  </Step>
</Steps>

To confirm that the client is gone, run the following command. It should print nothing:

```bash theme={null}
command -v archil mount.archil
```

## macOS

The [macOS client](/mounting/macos) is a menu bar app. The first time it launches, it asks for your administrator
password and installs a mount helper and a `sudoers` rule, so that mounting and unmounting disks doesn't require a
password. Removing the app from `/Applications` doesn't remove these files, so the steps below remove them separately.

| Path | Purpose |
| - | - |
| `/Applications/Archil.app` | The menu bar app and its Finder and file system extensions |
| `/usr/local/bin/archil-mount` | Mount helper |
| `/etc/sudoers.d/archil` | Lets administrators run the mount helper without a password |
| `~/Library/Application Support/Archil/` | Your sign-in session and the tokens for each mounted disk |

<Steps>
  <Step title="Unmount every disk and quit Archil">
    Click the Archil icon in the menu bar and choose **Quit**. Quitting unmounts every disk and waits for pending writes
    to flush.

    To check for any disks that are still mounted, run:

    ```bash theme={null}
    mount | grep archilfs
    ```

    Unmount anything listed with `sudo umount "/Volumes/<disk-name>"`.
  </Step>

  <Step title="Remove the app">
    Unregister the file system extension, then delete the app:

    ```bash theme={null}
    pluginkit -r /Applications/Archil.app/Contents/Extensions/ArchilMountExtension.appex
    sudo rm -rf /Applications/Archil.app
    ```
  </Step>

  <Step title="Remove the mount helper and sudoers rule">
    Remove the `sudoers` rule first, then the helper it points to:

    ```bash theme={null}
    sudo rm -f /etc/sudoers.d/archil
    sudo rm -f /usr/local/bin/archil-mount
    ```

    <Warning>
      Don't skip this step. The `sudoers` rule lets administrators run `/usr/local/bin/archil-mount` as root without a
      password. Remove the rule even if the helper file is already gone.
    </Warning>
  </Step>

  <Step title="Remove your data (optional)">
    These folders hold your Archil sign-in session, the tokens for disks you've mounted, and the app's settings and
    caches. Run the following as each macOS user who used Archil:

    ```bash theme={null}
    rm -rf ~/Library/Application\ Support/Archil
    rm -rf ~/Library/Group\ Containers/group.com.archil.Archil
    rm -rf ~/Library/Containers/com.archil.Archil.Extension
    rm -rf ~/Library/Containers/com.archil.Archil.FinderSync
    rm -rf ~/Library/Caches/com.archil.Archil ~/Library/Caches/Archil
    rm -rf ~/Library/HTTPStorages/com.archil.Archil
    defaults delete com.archil.Archil
    ```

    If macOS denies access to the `Containers` or `Group Containers` folders, give Terminal **Full Disk Access** in
    **System Settings → Privacy & Security**, or delete the folders from Finder.

    <Note>
      The [`disk` CLI](#disk-npm-package) stores its profiles in `~/Library/Application Support/Archil/disk`, so the
      first command above removes those too. To keep them, delete only the files directly inside
      `~/Library/Application Support/Archil` and leave the `disk` folder in place.
    </Note>
  </Step>
</Steps>

To confirm that the client is gone, open **System Settings → General → Login Items & Extensions → File System
Extensions**. Archil should no longer be listed. If it still appears, log out and log back in.

<Note>
  Deleting local files doesn't revoke the credentials on Archil's side. If the machine was lost or is moving to someone
  else, also remove its disk tokens from each disk's users in the [Archil console](https://console.archil.com) or with the
  [Remove Disk User API](/api-reference/disk-users/remove-user).
</Note>

## `disk` npm package

The [`disk` package](/reference/disk-cli) provides two commands, `disk` and `sandbox`. It doesn't install anything
outside npm, so how you remove it depends on how you added it.

<Steps>
  <Step title="Remove the package">
    <Tabs>
      <Tab title="npx">
        If you only run `npx disk`, there's no install to remove. npx keeps a copy in npm's cache, which npm manages
        on its own.
      </Tab>

      <Tab title="Global install">
        ```bash theme={null}
        npm uninstall -g disk
        ```
      </Tab>

      <Tab title="Project dependency">
        Run this in your project's directory:

        ```bash theme={null}
        npm uninstall disk
        ```

        With other package managers, use `pnpm remove disk`, `yarn remove disk`, or `bun remove disk`.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Delete saved profiles">
    If you saved credentials with `disk profile create`, they stay on disk after you remove the package. List your
    profiles, then delete each one together with its stored API key:

    ```bash theme={null}
    npx disk profile list
    npx disk profile delete <name>
    ```

    Or delete the whole configuration directory:

    | Platform | Directory |
    | - | - |
    | Linux | `~/.config/archil/disk`, or `$XDG_CONFIG_HOME/archil/disk` if it's set |
    | macOS | `~/Library/Application Support/Archil/disk` |
    | Windows | `%APPDATA%\Archil\disk` |

    If you set `ARCHIL_DISK_CONFIG_DIR`, profiles are stored in that directory instead.
  </Step>
</Steps>

<Note>
  Deleting a profile only removes the local copy of its API key. To revoke the key itself, delete it in the
  [Archil console](https://console.archil.com).
</Note>

## Kubernetes

The [CSI driver](/reference/csi-driver) runs its own copy of the client inside your cluster, so the server steps above
don't apply. First delete the pods and PersistentVolumeClaims that use Archil volumes. Then uninstall the Helm release:

```bash theme={null}
helm uninstall archil-csi-driver --namespace archil-system
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.