How to Attach an Instance to a Vultr Load Balancer

Updated on 06 August, 2026

Learn how to connect your Vultr instance to a load balancer for improved traffic distribution and high availability.


A Load Balancer distributes incoming traffic across multiple instances to improve performance, increase availability, and provide failover support. To function correctly, instances within the same geographic region must be attached to the Vultr Load Balancer.

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

Note
Vultr Load Balancer can be attached to both Vultr Compute (VMs) and Vultr Bare Metal servers.
  • Vultr Console
  • Vultr API
  • Vultr CLI
  • Terraform
  1. Navigate to Network and click Load Balancers.

  2. Click your target Load Balancer to open its Manage page.

  3. Expand the Resources section.

  4. Click the expand toggle next to the location where you want to attach instances, such as New York, US. The row displays a Primary badge on the primary location and the current instance count in the Instances column.

  5. Under Instances in LOCATION, click Add Instances. The Add Instances in LOCATION panel opens on the right.

  6. Select the checkbox next to each instance you want to attach. The panel lists each instance by name and UUID, and updates the Selected instances counter as you select them.

    Note
    The panel only lists instances deployed in the same location as the Load Balancer. Use the Search field to filter longer lists.
  7. Click Save Changes.

  8. Verify the attachment under Instances in LOCATION. The table lists each attached instance with its name, UUID, IPv4 address, and IPv6 address, and the Instances count on the location row increases to match.

Replace LOCATION with the geographic location of your Load Balancer, such as New York, US.

  1. Send a GET request to the List Load Balancers endpoint 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}"
    
  2. Send a GET request to the List Instances endpoint and note your target instance's ID, ensuring it is in the same geographic region as the Load Balancer.

    console
    $ curl "https://api.vultr.com/v2/instances" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  3. Send a PATCH request to the Update Load Balancer endpoint to attach instances to the target Load Balancer.

    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": [
                "INSTANCE-1-ID",
                "INSTANCE-2-ID"
            ]
        }'
    
    Note
    A newly created Load Balancer rejects this request with Load Balancer Nodes Still Activating... and a 422 status, even after the Get Load Balancer endpoint reports a status of active. Wait about a minute after creation, then send the request again.
  4. Send a GET request to the Get Load Balancer endpoint to fetch the details of the target Load Balancer.

    console
    $ curl "https://api.vultr.com/v2/load-balancers/{load-balancer-id}" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  1. List all available instances and note the target Load Balancer's ID.

    console
    $ vultr-cli load-balancer list
    
  2. List all available instances and note your target instance's ID, ensuring it is in the same geographic region as the Load Balancer.

    console
    $ vultr-cli instance list
    
  3. Update the target Load Balancer by attaching the new instances.

    console
    $ vultr-cli load-balancer update LOAD-BALANCER-ID --instances "INSTANCE-1-ID,INSTANCE-2-ID,INSTANCE-3-ID"
    

    Pass every instance ID as a single comma-separated value. Separating the IDs with spaces attaches only the first instance and discards the rest, while still reporting Load balancer has been updated.

  4. Get the details of the target Load Balancer.

    console
    $ vultr-cli load-balancer get LOAD-BALANCER-ID
    
  1. Open your Terraform configuration file for the existing Load Balancer.

  2. Add the target instance IDs under the attached_instances attribute.

    terraform
    resource "vultr_load_balancer" "lb" {
        # ...existing fields (region, forwarding_rules, health_check, etc.)
    
        attached_instances = [
            vultr_instance.web1.id,
            vultr_instance.web2.id
        ]
    }
    
  3. Apply the configuration and observe the following output:

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