# Uninstall Linux-Based Nodes

### Overview

This article provides the general process of uninstalling Linux-based nodes (gateways or relays). If you need to remove the StrongDM gateway or relay software from your server and do not intend to destroy the server itself, follow the instructions provided.

### Steps

1. Log in to the server via a command-line interface.
2. Stop any and all StrongDM services with a command similar to the following:

```bash
sudo systemctl stop sdm-proxy sdm-worker sdm
```

3. Remove all StrongDM (`sdm`) files, including environment configuration files, service unit files, and binaries, as in the following example. We suggest running this command with `sudo` and using the `-f` (force) flag to ensure the files are entirely removed regardless of any potential permission issues.

```bash
sudo rm -f /etc/sysconfig/sdm* /etc/systemd/system/sdm*.service /usr/local/bin/sdm /opt/strongdm/bin/sdm
```

4. Reload the systemd configuration to ensure systemd acknowledges the services are gone:

```bash
sudo systemctl daemon-reload
```

5. Unset the `SDM_RELAY_TOKEN` and `SDM_ADMIN_TOKEN` environment variables:

```bash
unset SDM_RELAY_TOKEN
unset SDM_ADMIN_TOKEN
```

6. Although it may not be necessary in your specific situation, we suggest that you reboot the server, to be thorough.


---

# Agent Instructions: 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:

```
GET https://docs.strongdm.com/admin/networking/gateways-and-relays/uninstall-nodes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
