---
title: Detach
url: https://docs.vultr.com/products/network/load-balancer/management/instances/detach
description: Learn how to remove a server instance from your Vultr Load Balancer configuration
publish_date: 2025-04-07T19:33:19.961158Z
last_updated: 2026-05-26T20:09:24.772780Z
---

# How to Detach an Instance from a Vultr Load Balancer

Detaching an instance from a Vultr Load Balancer removes it from traffic distribution, allowing you to scale down or perform maintenance without affecting other instances. Before detaching, ensure that the instance is no longer needed for load balancing to prevent disruptions.

Follow this guide to attach an instance to a Vultr Load Balancer on your Vultr account using the Vultr Console, API, CLI, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and click **Load Balancers**.
    1. Click your target Load Balancer to open its management page.
    1. In **Resources**, expand the location to view the **Instances** in your desired region's table.
    1. Click the `+` icon, deselect the instance(s) to remove, and save.

=== "Vultr API"

    1. Send a `GET` request to the [**List Load Balancers** endpoint](https://www.vultr.com/api/#tag/load-balancer/operation/list-load-balancers) and note the target Load Balancer's ID.

        ```console
        $ curl "https://api.vultr.com/v2/load-balancers" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `GET` request to the [**List Instances** endpoint](https://www.vultr.com/api/#tag/instances/operation/list-instances) and note your currently attached instance IDs.

        ```console
        $ curl "https://api.vultr.com/v2/instances" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `PATCH` request to the [**Update Load Balancer** endpoint](https://www.vultr.com/api/#tag/load-balancer/operation/update-load-balancer), omitting the instance you want to detach.

        ```console
        $ curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
            -X PATCH \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json" \
            --data '{
                "instances": [
                    "<remaining_instance_1_id>",
                    "<remaining_instance_2_id>"
                ]
            }'
        ```

    1. Confirm the update with a `GET` request:

        ```console
        $ curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

=== "Vultr CLI"

    1. List all Load Balancers and note the target Load Balancer's ID.

        ```console
        $ vultr-cli load-balancer list
        ```

    1. List all instances and note which ones are currently attached.

        ```console
        $ vultr-cli instance list
        ```

    1. Detach an instance by **omitting it** from the `--instances` flag in the update command.

        ```console
        $ vultr-cli load-balancer update <load-balancer-id> \
            --instances "<remaining_instance_1_id>" "<remaining_instance_2_id>"
        ```

    1. Confirm the update.

        ```console
        $ vultr-cli load-balancer get <load-balancer-id>
        ```

=== "Terraform"

    1. Open your Terraform configuration file for the existing Load Balancer.

    1. Remove the target instance ID from the `nodes` list.

        ```terraform
        resource "vultr_load_balancer" "lb" {
            # ...existing fields (region, forwarding_rules, health_check, etc.)

            nodes = [
                vultr_instance.web1.id
                # vultr_instance.web2.id (this instance is detached)
            ]
        }
        ```

    1. Apply the configuration and observe the following output:

        ```
        Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
        ```
