---
title: "How to Remove a Server from Retrace"
slug: "how-do-i-remove-a-server"
description: "There may be times when you want to remove a server or add back a server that you removed previously. Follow these steps."
updated: 2023-07-21T20:32:31Z
published: 2023-07-21T20:32:31Z
---

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

# How Do I Remove a Server?

> Servers that are offline for more than a certain amount of time will be automatically deleted unless you disable that setting in Server Settings.

There may be times when you want to remove a server manually. Here are the steps:

## Click on the Settings Icon for the server and click remove

![RemoveServer](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/RemoveServer.png)

## Confirm the Removal

![Confirmation](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/Confirmation.png)

Once the button is clicked a remote command is sent to the agent to uninstall. In order to re-add the server after this process, you will need to reinstall the agent again.

## How to Remove Servers Programmatically

This section is intended to help you leverage Stackify's API by making a REST service call to programmatically remove Retrace instances from the Servers page of Retrace.

Below are the REST calls to the API for both Windows and Linux machines that can be added to shutdown scripts of your server.

### Remove a Windows Server with PowerShell

Plug in your API key found in the Settings page of your account and run the call as a PowerShell script:

```
Invoke-RestMethod -Method POST -Header @{ "X-Stackify-Key" = "license_key_here" } -uri https://api.stackify.com/API/Device/RemoveServerByName/?name=$env:computername
```

**Note:** The **$env:computername** variable makes an assumption of what your computer name is. There may be cases where you may need to manually set the computer name: **/?name=your_server_name**

### Remove a Linux Server with cURL

```
curl -X POST -i -H "X-Stackify-Key: license_key_here" -H "Content-Length: 0" https://api.stackify.com/API/Device/RemoveServerByName/?name=hostname
```

> Using **hostname** makes an assumption of what your computer name is. There may be cases where you may need to manually set the computer name: **/?name=your_server_name**

After making the REST call, you should see your instances removed from the Servers page in your Retrace account almost immediately.
