# Uninstalling an Edge Node

> Remove an edge node completely: stop it, delete its local data, and remove its auto-start service.

Source: https://docs.evolvingedge.ai/uninstall/

Removing an edge node stops it from processing workloads, deletes its local data,
and removes the auto-start service so it won't come back after a reboot.

The agent ships a built-in `uninstall` command that handles all of this. Use it
unless the binary is already gone — in which case follow the
[Manual Removal](#manual-removal) steps.

## Quick Uninstall

The binary lives at `~/.ee-cdn/bin/edge-node` (it's only on your `PATH` if you
added it during setup).

### Interactive install (macOS, or Linux with a desktop session)

```
~/.ee-cdn/bin/edge-node uninstall
```

### Headless Linux installed as a system service (installed with sudo)
Run uninstall with sudo too, or it can't stop or remove the system unit:bash
sudo ~/.ee-cdn/bin/edge-node uninstall

The command auto-detects whether the node was installed as a **system** unit
(/etc/systemd/system/) or a **user** unit (`~/.config/systemd/user/`) and
tears down the correct one.

## What Gets Removed

| Item | Removed? | Notes |
|------|----------|-------|
| Running process | ✓  | Stopped gracefully |
| Service unit (systemd / launchd plist) | ✓  | No longer starts on boot |
| Data directory ~/.ee-cdn | ✓  | Cache, settings.json, enrollment config, auth tokens, logs. Your node's identity is not stored here — see Reinstalling Later |
| The edge-node binary | ✘ | Left in place — remove manually if desired |

### Reinstalling Later

Reinstalling the node software brings back the same node. Your node's identity
is derived from the machine, not from the data directory, so removing
`~/.ee-cdn` does not create a new node — your Active Node Hours, badges and
history are intact when you reinstall.

Two cases are different:

- **Reinstalling the operating system** generates a new machine identity. A node
  that enrolls afterwards is a new node, starting with no Active Node Hours.
- **Container nodes** need a fixed hostname and a persistent machine ID to keep
  one identity across recreations. See Docker, below.

See [Node Identity](https://docs.evolvingedge.ai/node-config/) for the full explanation.

To remove the binary as well:

```
rm ~/.ee-cdn/bin/edge-node
```

## Manual Removal

Use these if the edge-node binary is no longer available.

### Linux — user service
```
systemctl --user stop ee-cdn-edge-node.service
systemctl --user disable ee-cdn-edge-node.service
rm -f ~/.config/systemd/user/ee-cdn-edge-node.service
systemctl --user daemon-reload
rm -rf ~/.ee-cdn
```

### Linux — system service (run as root)
```
sudo systemctl stop ee-cdn-edge-node.service
sudo systemctl disable ee-cdn-edge-node.service
sudo rm -f /etc/systemd/system/ee-cdn-edge-node.service
sudo systemctl daemon-reload
rm -rf ~/.ee-cdn
```

### macOS
```
launchctl bootout "gui/$(id -u)/ee-cdn-edge-node" 2>/dev/null
launchctl bootout "user/$(id -u)/ee-cdn-edge-node" 2>/dev/null
rm -f ~/Library/LaunchAgents/ee-cdn-edge-node.plist
rm -rf ~/.ee-cdn
```

### Windows

The command:

```powershell
irm https://cp.3dge.app/install.ps1 | iex
```

downloads and runs an installation script. The script could not be retrieved from this environment, so first identify the Docker container and volume it created rather than assuming their exact names.

Open **PowerShell** and run:

```powershell
docker ps -a
```

Look for a container using this image:

```text
eecdn/ee-cdn-edge
```

Note its container name—this guide uses `edge-node` as the example.

**Remove The Container, Keep Node Data**

Use this if you may reinstall later and want to retain persistent node state. Read Container Nodes and Node Identity, below, before recreating the container — keeping the volume alone does not keep your node's identity.

```powershell
docker stop edge-node
docker rm edge-node
```

Or force-stop and remove it in one command:

```powershell
docker rm -f edge-node
```

Replace `edge-node` with the actual container name shown by `docker ps -a`. Removing a container does not normally remove Docker named volumes. [docs.docker](https://docs.docker.com/reference/cli/docker/container/rm/)

**Completely Remove The Application**

**Warning:** The following removal may delete persistent edge-node state, including activation/registration data.

1. Stop and remove the container:

   ```powershell
   docker rm -f edge-node
   ```

2. List Docker volumes:

   ```powershell
   docker volume ls
   ```

3. Identify the volume used by the edge node—commonly something containing `edge-data`, `ee-cdn`, or the project name.

4. Inspect a candidate volume before deleting it:

   ```powershell
   docker volume inspect edge-data
   ```

5. Remove the confirmed edge-node volume:

   ```powershell
   docker volume rm edge-data
   ```

Docker will refuse to remove a volume that is still attached to a container, so always remove the container first. [docs.docker](https://docs.docker.com/reference/cli/docker/volume/rm/)

**Remove The Downloaded Image**

This is optional and only frees local disk space:

```powershell
docker image rm docker.io/eecdn/ee-cdn-edge:latest
```

If Docker reports the image is in use, check `docker ps -a` for other containers using it before removing it. [docs.docker](https://docs.docker.com/reference/cli/docker/image/rm/)

**Check For Host-Path Data**

The installer may have used a Windows host directory instead of a Docker named volume. Inspect the container *before* removing it if you need to determine its data location:

```powershell
docker inspect edge-node --format '{{json .Mounts}}'
```

Look for a mount whose destination is `/data`.

- If its `Type` is `volume`, remove the named volume only if you want a full reset.
- If its `Type` is `bind`, note the Windows source path, remove the container, then delete that directory manually only if you intentionally want to erase persistent data.

Example for a host-path directory:

```powershell
Remove-Item -LiteralPath 'C:\path\to\ee-cdn-data' -Recurse -Force
```

Verify the path carefully before running `Remove-Item -Recurse -Force`; it permanently deletes all files within that directory.

**Verify Removal**

```powershell
docker ps -a --filter "ancestor=docker.io/eecdn/ee-cdn-edge:latest"
docker volume ls
docker image ls | Select-String 'ee-cdn-edge'
```

Do not use `docker system prune --volumes --all` for this purpose unless you intend to remove unused Docker resources for **every** application on the Windows system. Microsoft documents that command as a system-wide cleanup step, not an app-specific uninstaller. [learn.microsoft](https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon)

### Notes & Gotchas

- **Systemd lingering (headless Linux).** Installation enables systemd user lingering so the node survives logout. It's harmless to leave, but for a fully clean state run:

```
sudo loginctl disable-linger <user>
```
- **Data directory under sudo.** The built-in uninstall deletes ~/.ee-cdn for the user that runs the command. If a system service was installed via sudo but the node's data lived in the operator's home, `sudo edge-node uninstall` removes the service unit correctly but may not clear the operator's ~/.ee-cdn. Run `rm -rf ~/.ee-cdn` as the operator afterward to be sure.

- **Removing the node from the network.** After uninstall the node stops heartbeating and the control plane marks it offline automatically. No portal action is required.

### Docker

**Docker Run Deployment**

**Container Nodes and Node Identity**

A container node takes its identity from the container, not from the `/data`
volume. The standard image has no persistent machine identity, and a container's
hostname changes each time it is recreated. **Recreating the container therefore
enrolls a new node, even when the `/data` volume is kept**, and the new node
starts with no Active Node Hours.

To keep one identity across recreations, give the container a fixed hostname and
a persistent machine ID.

Create the machine ID file once, and keep it:

```bash
uuidgen | tr -d '-' > ~/edge-node-machine-id
```

Then include both in the container:

```bash
docker run -d \
  --name edge-node \
  --hostname edge-node \
  -v ~/edge-node-machine-id:/etc/machine-id:ro \
  -v edge-data:/data \
  ...
```

Or in `docker-compose.yml`:

```yaml
services:
  edge-node:
    hostname: edge-node
    volumes:
      - ~/edge-node-machine-id:/etc/machine-id:ro
      - edge-data:/data
```

This applies from the next enrollment onwards; it does not restore hours a node
has already lost. Deleting `~/edge-node-machine-id` has the same effect as
reinstalling the operating system — the next enrollment creates a new node.

For a container started with `docker run`, uninstalling means removing the container by name. If you used the earlier example, the container name is `edge-node`.

**Remove The Container, Keep Data**

Use this if you may reinstall later and want to retain persistent node state, including activation data:

```bash
docker stop edge-node
docker rm edge-node
```

Or stop and remove it in one command:

```bash
docker rm -f edge-node
```

`docker rm -f` stops a running container and removes it. A named volume is not removed automatically, even when `docker rm -v` is used. [docs.docker](https://docs.docker.com/reference/cli/docker/container/rm/)

**Completely Remove The Application**

**Warning:** This permanently deletes the node’s persistent `/data` contents. The node will need to enroll again after reinstalling, and unless you have set a fixed hostname and a persistent machine ID it will enroll as a new node with no Active Node Hours.

If the container used the named volume from the `docker run` example:

```bash
docker rm -f edge-node
docker volume rm edge-data
```

Verify the exact volume name before deleting it:

```bash
docker volume ls
```

Docker cannot remove a volume while a container still uses it, so remove the container first. [docs.docker](https://docs.docker.com/reference/cli/docker/volume/rm/)

**Remove The Downloaded Image**

This is optional. It frees local disk space but is unnecessary if you might reinstall:

```bash
docker image rm docker.io/eecdn/ee-cdn-edge:latest
```

If Docker reports that the image is in use, check for other containers that use it before forcing removal. Docker supports removing an image by its image reference with `docker image rm`. [docs.docker](https://docs.docker.com/reference/cli/docker/image/rm/)

**If You Used A Host Directory**

If your original command mapped a host directory to `/data`, such as:

```bash
-v /srv/ee-cdn:/data
```

remove the container first:

```bash
docker rm -f edge-node
```

Then, only if you want a full reset, manually delete that host directory:

```bash
rm -rf /srv/ee-cdn
```

Double-check the path before executing `rm -rf`; it permanently deletes its contents. Docker does not delete host-path bind mounts when a container is removed.

**Verify Removal**

```bash
docker ps -a --filter name=edge-node
docker volume ls | grep edge-data
docker image ls | grep ee-cdn-edge
```

No output from the first command means the container has been removed. Keep the volume and image unless you specifically need a full cleanup.

**Docker Compose:**

To uninstall a Docker Compose deployment, stop and remove the stack with `docker compose down`. By default, this removes the containers and Compose-created network but preserves persistent volumes, including the edge node’s `edge-data` state. [docs.docker](https://docs.docker.com/reference/cli/docker/compose/down/)

**Preserve node data**

Use this if you may reinstall the app or want to retain activation and local node state:

```bash
cd /path/to/the/compose-file-directory
docker compose down
```

If you named the file something other than the default `compose.yaml` or `docker-compose.yml`:

```bash
docker compose -f /path/to/docker-compose.yml down
```

For the edge node, this stops and removes `edge-node` but leaves the named `edge-data` volume intact.

**Completely remove it**

**Warning:** This deletes the node’s persistent `/data` contents, which may include registration/activation state.

```bash
cd /path/to/the/compose-file-directory
docker compose down --volumes --remove-orphans
```

`--volumes` (or `-v`) removes named volumes declared in the Compose file as well as anonymous volumes; `--remove-orphans` additionally removes containers associated with the project that are no longer defined in the current Compose file. [docs.docker](https://docs.docker.com/reference/cli/docker/compose/down/)

To also delete the downloaded container image:

```bash
docker compose down --volumes --remove-orphans --rmi local
```

Use `--rmi all` only if you intentionally want Compose to remove every image used by this project, including images that were not built locally. [docs.docker](https://docs.docker.com/reference/cli/docker/compose/down/)

**Host-path data**

Some NAS guides replace the Compose named volume with a host bind mount, for example:

```yaml
- /mnt/tank/appdata/ee-cdn:/data
```

or:

```yaml
- /DATA/AppData/ee-cdn:/data
```

In that case, `docker compose down --volumes` does **not** delete the host folder. After the stack is down, delete the mapped host directory manually only if you intend a complete reset:

```bash
rm -rf /path/to/ee-cdn
```

Double-check the path before running `rm -rf`; it permanently deletes the edge-node data.

### Management UIs & NAS Devices

Use the stack/app’s **Delete**, **Remove**, or **Down** action:

- **Portainer:** Stacks → select the stack → **Remove**. Enable volume removal only for a full reset.
- **Dockge:** Select the Compose stack → **Down** or **Delete**. Keep volumes unless a full reset is intended.
- **Unraid Compose Manager:** Docker → Compose → select stack → **Compose Down**; delete the associated appdata folder separately only if desired.
- **Synology / QNAP / UGOS / ZimaOS / OMV:** Stop and delete the Compose project/application, then separately decide whether to delete its mapped persistent-data folder.

Avoid global cleanup commands such as `docker system prune --volumes` unless you have audited every other container on the host. `docker volume prune --all` can remove any unused named volume, not just this application’s volume. [docs.docker](https://docs.docker.com/reference/cli/docker/volume/prune/)

Have questions? Hop into Discord or [submit a support request](https://docs.evolvingedge.ai/node-support/).
