How to Apply an SSL Certificate to Vultr Load Balancer

Updated on November 27, 2024

Applying an SSL Certificate to your Vultr Load Balancer enhances the security of your traffic by encrypting data transmitted between clients and your load balancer. By adding a private key, certificate, and certificate chain, you can ensure secure communications and improve trustworthiness for your users.

Follow the steps below to apply an SSL certificate to your Vultr Load Balancer 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 your target Load Balancer to open its management page.

    Selection of a target Load Balancer

  3. Click Configuration.

    Button to open Load Balancer configuration window

  4. Click SSL Certificate.

    Button to open the SSL certificate window

  5. Add Private Key.

    Field to enter SSL Certificate Private Key

  6. Add Certificate.

    Field to enter SSL Certificate

  7. Add Certificate Chain.

    Field to enter SSL Certificate Chain

  8. Click Save Changes.

    Button to apply SSL and save changes

  1. Send a GET request to the List Load Balancer 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 PATCH request to the Update Load Balancer endpoint to apply an SSL certificate to the target Load Balancer.

    console
    $ curl "https://api.vultr.com/v2/load-balancers/<loadbalancer-id>" \
        -X PATCH \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "ssl": {
            "private_key": "-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY_HERE\n-----END PRIVATE KEY-----",
            "certificate": "-----BEGIN CERTIFICATE-----\nYOUR_CERTIFICATE_HERE\n-----END CERTIFICATE-----",
            "chain": "-----BEGIN CERTIFICATE-----\nYOUR_CHAIN_CERTIFICATE_HERE\n-----END CERTIFICATE-----"
            }
    }'
    
  1. List the available Load Balancers and note the target Load Balancer's ID.

    console
    $ vultr-cli load-balancer list
    
  2. Apply SSL certificate to target Load Balancer.

    console
    $ vultr-cli load-balancer update <loadbalancer-id> \
        --ssl-private-key "-----BEGIN RSA PRIVATE KEY-----\n...YourPrivateKey...\n-----END RSA PRIVATE KEY-----" \
        --certificate "-----BEGIN CERTIFICATE-----\n...YourCertificate...\n-----END CERTIFICATE-----" \
        --certificate-chain "-----BEGIN CERTIFICATE-----\n...YourCertificateChain...\n-----END CERTIFICATE-----"