How to Attach an Instance to a Vultr Load Balancer

Updated on 11 September, 2025

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 Customer Portal, API, CLI, or Terraform.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  • Terraform
  1. Navigate to Products and click Load Balancers.
  2. Click your target Load Balancer to open its management page.
  3. In Resources, expand the location where you want to link instances.
  4. In Instances, go to the desired region, and click Add Instances.
  5. Select one or more instances from the same region, then click Save Changes.
  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>"
            ]
        }'
    
  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>"
    
  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 nodes attribute.

    terraform
    resource "vultr_load_balancer" "lb" {
        # ...existing fields (region, forwarding_rules, health_check, etc.)
    
        nodes = [
            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.