How to Provision Vultr Load Balancer (FAQs)

Updated on November 27, 2024

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 Balancer.

    Load Balancer option in products menu

  2. Click Add Load Balancer.

    Button to create a Load Balancer

  3. Choose a Load Balancer Location.

    Menu to choose server location for Load Balancer

  4. Provide a Label, select an **Algorithm, provide Timeout time and select number of Nodes. By default the algorithm is set to Round Robin.

    Field to provide Load Balancer label, algorithm, nodes and timeout

  5. Configure Forwarding Rules.

    Note
    You must create at least one HTTPS forwarding rule before creating an HTTP/2 forwarding rule. Additionally, HTTP/3 forwarding can only be enabled if there is at least one active HTTP/2 forwarding rule. 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.

    Fields to configure Load Balancer Forwarding rules

  6. Optional: Select a VPC Network. By default the VPC network is set to Public.

    Field to select a VPC Network for the Load Balancer

  7. Optional: Configure any Firewall rules.

    Fields to configure firewall rules for the Load Balancer

  8. Configure any Health Checks.

    Fields to configure any health checks for the load balancer

  9. Click Add Load Balancer.

    Button to deploy a Load Balancer

  1. Send a POST request to the Create Load Balancer endpoint to create 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" : "ewr",
            "balancing_algorithm" : "roundrobin",
            "ssl_redirect" : false,
            "http2": false,
            "http3": false,
            "proxy_protocol" : false,
            "timeout" : 600,
            "label" : "Example Load Balancer",
            "nodes" : 1,
            "health_check" : {
            "protocol" : "http",
            "port" : 80,
            "path" : "/health",
            "check_interval" : 10,
            "response_timeout" : 5,
            "unhealthy_threshold" : 3,
            "healthy_threshold" : 3
            },
            "forwarding_rules": [
            {
                "frontend_protocol" : "http",
                "frontend_port" : 80,
                "backend_protocol" : "http",
                "backend_port" : 80
            }
            ],
            "firewall_rules": [
            {
                "port" : 80,
                "source" : "0.0.0.0/0",
                "ip_type" : "v4"
            }
            ],
            "auto_ssl": {
            "domain_zone" : "<example.com>",
            "domain_sub" : "sub"
            }
        }'
    

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

  2. Send a GET request to the List Load Balancer 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. Create a Load Balancer.

    console
    $ vultr-cli load-balancer create \
        --region="ewr" \
        --balancing-algorithm="roundrobin" \
        --ssl-redirect=false \
        --proxy-protocol=false \
        --response-timeout=5 \
        --label="Example Load Balancer" \
        --protocol="http" \
        --port=80 \
        --path="/health" \
        --check-interval=10 \
        --healthy-threshold=3 \
        --unhealthy-threshold=3 \
        --forwarding-rules="frontend_protocol:http,frontend_port:80,backend_protocol:http,backend_port:80" \
        --firewall-rules="port:80,ip_type:v4,source:0.0.0.0/0"
    

    Run vultr-cli load-balancer create create --help to view additional options you can apply on your instance.

  2. List all the available Load Balancers.

    console
    $ vultr-cli load-balancer list