doctl compute load-balancer create
Generated on 9 Apr 2025
from doctl
version
v1.124.0
Usage
doctl compute load-balancer create [flags]
Aliases
c
Description
Use this command to create a new load balancer on your account. Valid forwarding rules are:
entry_protocol
: The entry protocol used for traffic to the load balancer. Possible values are:http
,https
,http2
,http3
,tcp
, orudp
.entry_port
: The entry port used for incoming traffic to the load balancer.target_protocol
: The target protocol used for traffic from the load balancer to the backend Droplets. Possible values are:http
,https
,http2
,http3
,tcp
, orudp
.target_port
: The target port used to send traffic from the load balancer to the backend Droplets.certificate_id
: The ID of the TLS certificate used for SSL termination, if enabled. Can be obtained withdoctl certificate list
tls_passthrough
: Whether SSL passthrough is enabled on the load balancer.
Flags
Option | Description |
---|---|
--algorithm |
This field has been deprecated. You can no longer specify an algorithm for load balancers. Default: round_robin |
--allow-list |
A comma-separated list of ALLOW rules for the load balancer, e.g.: ip:1.2.3.4,cidr:1.2.0.0/16 |
--deny-list |
A comma-separated list of DENY rules for the load balancer, e.g.: ip:1.2.3.4,cidr:1.2.0.0/16 |
--disable-lets-encrypt-dns-records |
disable automatic DNS record creation for Let’s Encrypt certificates that are added to the load balancer Default: false |
--domains |
A comma-separated list of domains required to ingress traffic to a global load balancer, e.g.: title:test-domain-1 is_managed:true certificate_id:test-cert-id-1 |
--droplet-ids |
A comma-separated list of Droplet IDs to add to the load balancer, e.g.: 12,33 |
--enable-backend-keepalive |
enable keepalive connections to backend target droplets Default: false |
--enable-proxy-protocol |
enable proxy protocol Default: false |
--forwarding-rules |
A comma-separated list of key-value pairs representing forwarding rules, which define how traffic is routed, e.g.: entry_protocol:tcp,entry_port:3306,target_protocol:tcp,target_port:3306 . |
--glb-cdn-settings |
CDN cache settings global load balancer, e.g.: is_enabled:true |
--glb-settings |
Target protocol and port settings for ingressing traffic to a global load balancer, e.g.: target_protocol:http,target_port:80 |
--health-check |
A comma-separated list of key-value pairs representing recent health check results, e.g.: protocol:http,port:80,path:/index.html,check_interval_seconds:10,response_timeout_seconds:5,healthy_threshold:5,unhealthy_threshold:3 |
--help , -h |
Help for this command |
--http-idle-timeout-seconds |
HTTP idle timeout that configures the idle timeout for http connections on the load balancer Default: 0 |
--name |
The load balancer’s name (required) |
--network |
The type of network the load balancer is accessible from, e.g.: EXTERNAL or INTERNAL |
--network-stack |
The network stack type determines the allocation of ipv4/ipv6 addresses to the load balancer, e.g.: IPV4 or DUALSTACK (NOTE: this feature is in private preview, contact DigitalOcean support to review its public availability.) |
--project-id |
Indicates which project to associate the Load Balancer with. If not specified, the Load Balancer will be placed in your default project. |
--redirect-http-to-https |
Redirects HTTP requests to the load balancer on port 80 to HTTPS on port 443 Default: false |
--region |
The load balancer’s region, e.g.: nyc1 |
--size |
The load balancer’s size, e.g.: lb-small . Only one of size and size-unit should be used |
--size-unit |
The load balancer’s size, e.g.: 1. Only one of size-unit and size should be used Default: 0 |
--sticky-sessions |
A comma-separated list of key-value pairs representing a list of active sessions, e.g.: type:cookies, cookie_title:DO-LB, cookie_ttl_seconds:5 |
--tag-name |
The name of a tag. All Droplets with this tag applied will be assigned to the load balancer. |
--target-lb-ids |
A comma-separated list of Load Balancer IDs to add as target to the global load balancer |
--type |
The type of load balancer, e.g.: REGIONAL or GLOBAL |
--vpc-uuid |
The UUID of the VPC to create the load balancer in |
--wait |
Boolean that specifies whether to wait for a load balancer to complete before returning control to the terminal Default: false |
Related Commands
Command | Description |
---|---|
doctl compute load-balancer | Display commands to manage load balancers |
Global Flags
Option | Description |
---|---|
--access-token , -t |
API V2 access token |
--api-url , -u |
Override default API endpoint |
--config , -c |
Specify a custom config file Default: |
--context |
Specify a custom authentication context name |
--http-retry-max |
Set maximum number of retries for requests that fail with a 429 or 500-level error
Default: 5 |
--http-retry-wait-max |
Set the minimum number of seconds to wait before retrying a failed request
Default: 30 |
--http-retry-wait-min |
Set the maximum number of seconds to wait before retrying a failed request
Default: 1 |
--interactive |
Enable interactive behavior. Defaults to true if the terminal supports it (default false)
Default: false |
--output , -o |
Desired output format [text|json] Default: text |
--trace |
Show a log of network activity while performing a command Default: false |
--verbose , -v |
Enable verbose output Default: false |