> For the complete documentation index, see [llms.txt](https://docs.checkcle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.checkcle.io/getting-started/uninstalling/2.-unistall-server-agent.md).

# 2. Unistall Server Agent

**Guide for uninstalling the Monitoring Agent** (your `.deb` packaged agent) with different scenarios explained:

***

### &#x20;Stop and Disable the Service

```bash
sudo systemctl stop monitoring-agent
sudo systemctl disable monitoring-agent
```

* Ensures the agent is not running anymore.
* `disable` prevents it from starting on boot.

***

### &#x20;Remove vs. Purge

There are two main ways to uninstall Debian packages:

1. **Remove (keep configuration files)**

   ```bash
   sudo dpkg -r monitoring-agent
   ```

   * Removes the package binaries, but **keeps configs** in `/etc/monitoring-agent/` (if you had any).
   * Useful if you plan to reinstall and keep previous settings.
2. **Purge (remove everything)**

   ```bash
   sudo dpkg -P monitoring-agent
   ```

   * Completely removes binaries **and configuration files**.
   * Use this if you want a **fresh clean uninstall**.

### &#x20;Optional Cleanup

If logs or runtime data are stored outside the package (e.g., in `/var/lib/monitoring-agent/` or `/var/log/monitoring-agent/`), you may want to remove them manually:

```bash
sudo rm -rf /var/lib/monitoring-agent
sudo rm -rf /var/log/monitoring-agent
sudo rm -rf /etc/monitoring-agent
```

***

With this, you can:

* **Stop and disable** the service.
* **Remove or purge** the package depending on whether you want to keep configs.
