How to Provision Vultr Load Balancer

Updated on April 7, 2025

Vultr Load Balancer efficiently distributes incoming traffic across multiple servers, ensuring balanced resource utilization and enhanced reliability. This service prevents individual servers from becoming overloaded by managing traffic evenly, which helps maintain application performance and uptime. By provisioning a Load Balancer, you can enhance the scalability and resilience of your applications, improving overall user experience.

Follow this guide to provision a Vultr Load Balancer on your Vultr account using the Vultr Customer Portal, API, or CLI.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  1. Navigate to Products and click Load Balancers.

  2. Click Add Load Balancer.

  3. Choose a Load Balancer Location.

  4. Provide a Label, select an Algorithm, set the Timeout, and choose the number of Nodes. The default algorithm is Round Robin.

  5. Configure additional settings:

    • Force HTTP to HTTPS redirects all HTTP traffic to HTTPS. To enable this option, create at least one HTTPS forwarding rule and add a valid SSL certificate.
    • Proxy Protocol forwards the client’s original IP address to backend nodes. If you enable this feature, configure your backend nodes to accept Proxy Protocol headers.
    • Sticky Sessions ensures that the Load Balancer routes a client’s requests to the same backend server.
  6. Configure Forwarding Rules to define how the Load Balancer routes traffic.

    Note
    Create at least one HTTPS forwarding rule before adding an HTTP/2 forwarding rule. Enable HTTP/3 forwarding only if an HTTP/2 forwarding rule exists. HTTP/2 and HTTP/3 are newer versions of the HTTP protocol, designed to improve performance and security by enabling faster data transmission and more efficient use of network resources.
  7. Optional: Select a VPC Network. By default the VPC network is set to Public.

  8. Optional: Configure Firewall rules to control inbound and outbound traffic.

  9. Configure Health Checks to monitor backend node availability. Set the Protocol (HTTP, HTTPS, or TCP), Port, and other parameters like Interval, Timeout, and Thresholds to determine when a node is marked as healthy or unhealthy.

  10. Click Add Load Balancer.

  1. Send a GET request to the List Regions endpoint and note your target region ID.

    console
    $ curl "https://api.vultr.com/v2/regions" \
      -X GET \
      -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a POST request to the Create Load Balancer endpoint to provision a Load Balancer.

    console
    $ curl "https://api.vultr.com/v2/load-balancers" \
        -X POST \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "region" : "{region_id}",
            "balancing_algorithm" : "{roundrobin_or_leastconn}",
            "ssl_redirect" : false,
            "http2": false,
            "http3": false,
            "proxy_protocol" : false,
            "timeout" : {timeout_in_seconds},
            "label" : "{label}",
            "nodes" : {number_of_nodes},
            "health_check" : {
                "protocol" : "{http_or_https_or_tcp}",
                "port" : {port},
                "path" : "/health",
                "check_interval" : {interval_in_seconds},
                "response_timeout" : {timeout_in_seconds},
                "unhealthy_threshold" : {unhealthy_threshold},
                "healthy_threshold" : {healthy_threshold}
            },
            "forwarding_rules": [
            {
                "frontend_protocol" : "{http_or_https_or_tcp}",
                "frontend_port" : {frontend_port_number},
                "backend_protocol" : "{http_or_https_or_tcp}",
                "backend_port" : {backend_port_number}
            }
            ],
            "firewall_rules": [
            {
                "port" : {allowed_port_number},
                "source" : "{source_ip_cidr}",
                "ip_type" : "{v4_or_v6}"
            }
            ],
            "auto_ssl": {
                "domain_zone" : "{your_domain}",
                "domain_sub" : "{subdomain}"
            }
        }'
    

    Visit the Create Load Balancer page to view additional attributes you can include in your request.

  3. Send a GET request to the List Load Balancers endpoint to list all the available Load Balancers.

    console
    $ curl "https://api.vultr.com/v2/load-balancers" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  1. List all Vultr regions and note the target region ID.

    console
    $ vultr-cli regions list
    
  2. Create a Load Balancer.

    console
    $ vultr-cli load-balancer create \
        --region "<region_id>" \
        --balancing-algorithm "<roundrobin_or_leastconn>" \
        --ssl-redirect false \
        --proxy-protocol false \
        --response-timeout <timeout_in_seconds> \
        --label "<label>" \
        --nodes <number_of_nodes> \
        --protocol "<http_or_https_or_tcp>" \
        --port <port> \
        --path "/health" \
        --check-interval <interval_in_seconds> \
        --healthy-threshold <healthy_threshold> \
        --unhealthy-threshold <unhealthy_threshold> \
        --forwarding-rules "frontend_protocol:<http_or_https_or_tcp>,frontend_port:<frontend_port_number>,backend_protocol:<http_or_https_or_tcp>,backend_port:<backend_port_number>" \
        --firewall-rules "port:<allowed_port_number>,ip_type:<v4_or_v6>,source:<source_ip_cidr>"
    

    Run vultr-cli load-balancer create --help to view additional options you can apply when creating a Load Balancer.

  3. List all the available Load Balancers.

    console
    $ vultr-cli load-balancer list
    

Comments

No comments yet.